aboutsummaryrefslogtreecommitdiffstats
path: root/docker/ansible/roles/config_files/tasks/ipmi.yml
diff options
context:
space:
mode:
Diffstat (limited to 'docker/ansible/roles/config_files/tasks/ipmi.yml')
-rw-r--r--docker/ansible/roles/config_files/tasks/ipmi.yml41
1 files changed, 28 insertions, 13 deletions
diff --git a/docker/ansible/roles/config_files/tasks/ipmi.yml b/docker/ansible/roles/config_files/tasks/ipmi.yml
index da3f42bd..12913a85 100644
--- a/docker/ansible/roles/config_files/tasks/ipmi.yml
+++ b/docker/ansible/roles/config_files/tasks/ipmi.yml
@@ -1,4 +1,4 @@
-#Copyright 2018 OPNFV and Intel Corporation
+# Copyright 2018-21 Anuket, Intel Corporation and others
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -13,14 +13,6 @@
# limitations under the License.
---
-- name: Check if /dev/ipmi0 exists
- stat:
- path: /dev/ipmi0
- register: ipmi0_exists
- ignore_errors: True
- tags:
- - ipmi
-
- name: check ipmi_devintf is loaded
shell: "lsmod | cut -d' ' -f1 | grep ipmi_devintf"
register: ipmi_devintf
@@ -35,11 +27,34 @@
tags:
- ipmi
+- name: insert ipmi module ipmi_devintf
+ command: "modprobe ipmi_devintf"
+ register: ipmi_devintf
+ ignore_errors: true
+ when: (ipmi_devintf is failed) and (insert_ipmi_modules|default(false)|bool)
+ tags:
+ - ipmi
+
+- name: insert ipmi module ipmi_si
+ command: "modprobe ipmi_si"
+ register: ipmi_devsi
+ ignore_errors: true
+ when: (ipmi_devsi is failed) and (insert_ipmi_modules|default(false)|bool)
+ tags:
+ - ipmi
+
+- name: Check if /dev/ipmi0 exists
+ stat:
+ path: /dev/ipmi0
+ register: ipmi0_exists
+ ignore_errors: true
+ tags:
+ - ipmi
+
- name: enable ipmi plugin
- template:
- src: ipmi.conf.j2
- dest: "{{ config_file_dir }}/ipmi.conf"
- when: ipmi0_exists|succeeded and ipmi_devintf|succeeded and ipmi_devsi|succeeded
+ set_fact:
+ collectd_plugins: '{{ collectd_plugins | union(["ipmi"]) | unique }}'
+ when: (ipmi0_exists is succeeded) and (ipmi_devintf is succeeded) and (ipmi_devsi is succeeded)
tags:
- ipmi