homeserver/Archiv/mgrote.telegraf/tasks/main.yml
2020-08-18 11:57:53 +02:00

103 lines
3.2 KiB
YAML

- name: Apt-key hinzufuegen fuer das telegraf-repository
become: yes
apt_key:
url: https://repos.influxdata.com/influxdb.key
state: present
when: telegraf_installieren
- name: telegraf-repository hinzufuegen
become: yes
apt_repository:
repo: 'deb https://repos.influxdata.com/ubuntu {{ ansible_distribution_release }} stable'
state: present
filename: telegraf_repo
update_cache: yes
when: telegraf_installieren
- name: telegraf installieren
become: yes
apt:
name: telegraf
state: present
when: telegraf_installieren
- name: telegraf deinstallieren
become: yes
apt:
name: telegraf
state: absent
when: not telegraf_installieren
- name: telegraf.conf kopieren
become: yes
template:
src: "telegraf.conf"
dest: "/etc/telegraf/telegraf.conf"
notify: restart_telegraf
when: telegraf_installieren
# "aktivieren"
- name: add base_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_base_metrics.yml'
when: telegraf_base_metrics
- name: add apcupsd_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_apcupsd_metrics.yml'
when: telegraf_apcupsd_metrics
- name: add hddtemp_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_hddtemp_metrics.yml'
when: telegraf_hddtemp_metrics
- name: add smart_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_smart_metrics.yml'
when: telegraf_smart_metrics
- name: add x509_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_x509_metrics.yml'
when: telegraf_x509_metrics
- name: add zfs_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_zfs_metrics.yml'
when: telegraf_zfs_metrics
- name: add postgres_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_postgres_metrics.yml'
when: telegraf_postgres_metrics
- name: add lm_sensors_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/add_lm_sensors_metrics.yml'
when: telegraf_lm_sensors_metrics
# deaktivieren
- name: add base_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_base_metrics.yml'
when: not telegraf_base_metrics
- name: add apcupsd_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_apcupsd_metrics.yml'
when: not telegraf_apcupsd_metrics
- name: add hddtemp_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_hddtemp_metrics.yml'
when: not telegraf_hddtemp_metrics
- name: add smart_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_smart_metrics.yml'
when: not telegraf_smart_metrics
- name: add x509_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_x509_metrics.yml'
when: not telegraf_x509_metrics
- name: add zfs_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_zfs_metrics.yml'
when: not telegraf_zfs_metrics
- name: add postgres_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_postgres_metrics.yml'
when: not telegraf_postgres_metrics
- name: add lm_sensors_metrics tasks
import_tasks: '{{ role_path }}/tasks/metrics/remove_lm_sensors_metrics.yml'
when: not telegraf_lm_sensors_metrics