ansible/roles/telegraf/tasks/main.yml

26 lines
624 B
YAML
Raw Normal View History

2020-08-30 19:35:18 -05:00
#!/usr/bin/ansible-playbook
# vim:ft=ansible:
---
- name: Install and configure Telegraf
block:
- name: Add repo keys by URL
apt_key:
url: "{{ item }}"
loop:
- "https://repos.influxdata.com/influxdb.key"
- name: Add repos
apt_repository:
repo: "{{ item }}"
loop:
- "deb https://repos.influxdata.com/ubuntu {{ ansible_distribution_release }} stable"
- name: Install Telegraf
apt:
name:
- telegraf
- name: Start and enable Telegraf
systemd:
name: telegraf
enabled: yes
state: started
2020-08-30 19:35:18 -05:00
become: yes