ansible/roles/telegraf/tasks/main.yml

21 lines
504 B
YAML

#!/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
become: yes