1
0
Fork 0
mirror of https://gitlab.com/s3lph/ansible-collection-prometheus synced 2024-11-22 09:41:01 +01:00
ansible-collection-prometheus/roles/prometheus_node/tasks/debian11.yml
2020-11-13 10:36:46 +01:00

35 lines
913 B
YAML

---
- name: install prometheus-node-exporter
apt:
name: "{{ item }}"
state: present
update_cache: yes
loop:
- prometheus-node-exporter
- prometheus-node-exporter-collectors
- name: start prometheus-node-exporter.service
systemd:
name: prometheus-node-exporter.service
state: started
enabled: yes
- name: start prometheus-node-exporter-apt.timer
systemd:
name: prometheus-node-exporter-apt.timer
state: started
enabled: yes
- name: install smartmontools
apt:
name: smartmontools
state: present
when:
- ansible_virtualization_role == 'host'
- name: start prometheus-node-exporter-smartmon.timer
systemd:
name: prometheus-node-exporter-smartmon.timer
state: "{{ (ansible_virtualization_role == 'host' and not smartmon_exporter_force_off) | ternary('started', 'stopped') }}"
enabled: "{{ ansible_virtualization_role == 'host' }}"