2021-09-08 11:53:20 +02:00
|
|
|
---
|
|
|
|
- name: Install Prometheus ipmi-exporter
|
|
|
|
apt:
|
|
|
|
update_cache: true
|
|
|
|
name: prometheus-ipmi-exporter
|
|
|
|
register: apt_result
|
|
|
|
retries: 3
|
|
|
|
until: apt_result is succeeded
|
|
|
|
|
|
|
|
- name: Make Prometheus ipmi-exporter scrap on localhost only
|
|
|
|
lineinfile:
|
|
|
|
path: /etc/default/prometheus-ipmi-exporter
|
|
|
|
regexp: '^ARGS='
|
|
|
|
line: |
|
|
|
|
ARGS="--config.file=/etc/prometheus/ipmi_local.yml --freeipmi.path='/etc/prometheus/ipmi_conf/'"
|
|
|
|
notify: Restart prometheus-ipmi-exporter
|
|
|
|
|
|
|
|
- name: Define prometheus to be sudo for some command
|
|
|
|
copy:
|
|
|
|
src: files/prometheus
|
|
|
|
dest: /etc/sudoers.d/prometheus
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: u=r,g=r,o=
|
|
|
|
notify: Restart prometheus-ipmi-exporter
|
|
|
|
|
|
|
|
- name: Override commands launchs by prometheus for ipmi
|
|
|
|
copy:
|
|
|
|
src: files/ipmi_conf
|
|
|
|
dest: /etc/prometheus
|
|
|
|
owner: prometheus
|
|
|
|
group: prometheus
|
|
|
|
mode: u=rx,g=r,o=
|
|
|
|
notify: Restart prometheus-ipmi-exporter
|
|
|
|
|
|
|
|
- name: Override commands launchs by prometheus for ipmi
|
|
|
|
file:
|
|
|
|
src: '/etc/prometheus/ipmi_conf/ipmi.sh'
|
|
|
|
dest: '/etc/prometheus/ipmi_conf/{{ item }}'
|
|
|
|
state: link
|
|
|
|
force: yes
|
|
|
|
owner: prometheus
|
|
|
|
group: prometheus
|
|
|
|
mode: u=rx,g=,o=
|
|
|
|
loop:
|
|
|
|
- bmc-info
|
|
|
|
- ipmi-chassis
|
|
|
|
- ipmi-dcmi
|
|
|
|
- ipmimonitoring
|
|
|
|
- ipmi-raw
|
|
|
|
- ipmi-sensors
|
2021-09-08 18:43:00 +02:00
|
|
|
- ipmi-sel
|
2021-09-08 11:53:20 +02:00
|
|
|
notify: Restart prometheus-ipmi-exporter
|
|
|
|
|
|
|
|
- name: Activate prometheus-ipmi-exporter service
|
|
|
|
systemd:
|
|
|
|
name: prometheus-ipmi-exporter
|
|
|
|
enabled: true
|
|
|
|
state: started
|
|
|
|
|
|
|
|
- name: Restart prometheus-ipmi-exporter
|
|
|
|
systemd:
|
|
|
|
state: restarted
|
|
|
|
daemon_reload: yes
|
|
|
|
name: prometheus-ipmi-exporter
|