mirror of
https://gitlab.com/s3lph/ansible-collection-prometheus
synced 2024-11-22 17:51:01 +01:00
36 lines
913 B
YAML
36 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' }}"
|