homeserver/Archiv/mgrote.telegraf/tasks/metrics/add_smart_metrics.yml

22 lines
557 B
YAML
Raw Normal View History

2020-08-18 11:57:53 +02:00
- name: smartmontools installieren
become: yes
apt:
name: smartmontools
state: present
- name: telegraf passwordless sudo
become: yes
blockinfile:
path: /etc/sudoers
block: |
Cmnd_Alias SMARTCTL = {{ telegraf_smart_pfad_zu_smartctl }}
telegraf ALL=(ALL) NOPASSWD: SMARTCTL
Defaults!SMARTCTL !logfile, !syslog, !pam_session
- name: smart.conf kopieren
become: yes
template:
src: "smart.conf"
dest: "/etc/telegraf/telegraf.d/smart.conf"
notify: restart_telegraf