mirror of
https://git.lapiole.org/dani/ansible-roles.git
synced 2025-08-07 00:57:00 +02:00
Update to 2021-12-01 19:13
This commit is contained in:
50
roles/zabbix_agent/tasks/sensors_RedHat.yml
Normal file
50
roles/zabbix_agent/tasks/sensors_RedHat.yml
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
|
||||
- name: Install hardware sensors support
|
||||
yum:
|
||||
name:
|
||||
- smartmontools
|
||||
- lm_sensors
|
||||
when: ansible_virtualization_role != "guest"
|
||||
tags: zabbix
|
||||
|
||||
- name: Check if lm_sensors is configured
|
||||
stat: path=/etc/sysconfig/lm_sensors
|
||||
register: lm_sensors
|
||||
when: ansible_virtualization_role != "guest"
|
||||
tags: zabbix
|
||||
|
||||
- name: Configure lm_sensors
|
||||
shell: "/sbin/sensors-detect < /dev/null"
|
||||
# Configure only if /etc/sysconfig/lm_sensors doesn't exists or has been customized
|
||||
when:
|
||||
- ansible_virtualization_role != "guest"
|
||||
- not lm_sensors.stat.exists or lm_sensors.stat.checksum == "c27ae43795d152a7fc7503c7109288e3fdc2207c"
|
||||
tags: zabbix
|
||||
|
||||
- name: Check if there's an ipmi controler
|
||||
stat: path=/dev/ipmi0
|
||||
register: zabbix_ipmi
|
||||
tags: zabbix
|
||||
|
||||
- name: Install ipmi support
|
||||
yum:
|
||||
name:
|
||||
- OpenIPMI
|
||||
- ipmitool
|
||||
when:
|
||||
- ansible_virtualization_role != "guest"
|
||||
- zabbix_ipmi.stat.exists
|
||||
tags: zabbix
|
||||
|
||||
- name: Start and enable lm_sensors service
|
||||
service: name=lm_sensors state=started enabled=yes
|
||||
when: ansible_virtualization_role != "guest"
|
||||
tags: zabbix
|
||||
|
||||
- name: Start and enable ipmi service
|
||||
service: name=ipmi state=started enabled=yes
|
||||
when:
|
||||
- ansible_virtualization_role != "guest"
|
||||
- zabbix_ipmi.stat.exists
|
||||
tags: zabbix
|
Reference in New Issue
Block a user