ansible-role-telegraf/tasks/main.yml
2021-08-20 09:33:22 +02:00

41 lines
916 B
YAML

---
- name: install depencies packages
ansible.builtin.package:
name:
- apt-transport-https
- gpg
tags: telegraf
- name: add key for influx repository
ansible.builtin.apt_key:
url: https://repos.influxdata.com/influxdb.key
tags: telegraf
- name: add influx repository
ansible.builtin.apt_repository:
filename: influx
repo: 'deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable'
tags: telegraf
- name: install influxdb package
ansible.builtin.package:
name:
- telegraf
tags: telegraf
- name: copy config file
ansible.builtin.template:
src: telegraf.conf.j2
dest: /etc/telegraf/telegraf.conf
owner: root
group: telegraf
mode: 0640
notify: restart telegraf
tags: telegraf
- name: start and enable service
ansible.builtin.service:
name: telegraf
state: started
enabled: true
tags: telegraf