2019-10-06 20:55:56 +00:00
|
|
|
---
|
|
|
|
# Server/Telegraf: Install and Setup Telegraf Monitoring
|
|
|
|
|
|
|
|
- name: telegraf - Install apt-transport-https
|
|
|
|
become: yes
|
|
|
|
apt:
|
|
|
|
name: apt-transport-https
|
2019-10-27 10:40:03 +00:00
|
|
|
state: present
|
2019-10-06 20:55:56 +00:00
|
|
|
- name: telegraf - Add telegraf repo key
|
|
|
|
become: yes
|
|
|
|
apt_key:
|
|
|
|
url: https://repos.influxdata.com/influxdb.key
|
|
|
|
state: present
|
|
|
|
- name: telegraf - Add Telegraf repo
|
|
|
|
become: yes
|
|
|
|
apt_repository:
|
2019-11-12 20:42:53 +00:00
|
|
|
repo: "deb https://repos.influxdata.com/debian {{ ansible_distribution_release }} stable"
|
2019-10-06 20:55:56 +00:00
|
|
|
state: present
|
|
|
|
- name: telegraf - Install telegraf
|
|
|
|
become: yes
|
|
|
|
apt:
|
|
|
|
name: telegraf
|
|
|
|
state: latest
|
|
|
|
update_cache: yes
|
|
|
|
cache_valid_time: 3600
|
|
|
|
|
|
|
|
- name: telegraf - Copy telegraf config
|
|
|
|
become: yes
|
|
|
|
template:
|
|
|
|
src: "{{ role_path }}/templates/telegraf.conf"
|
|
|
|
dest: /etc/telegraf/telegraf.conf
|
|
|
|
notify:
|
2019-11-12 20:34:35 +00:00
|
|
|
- Enable and restart telegraf
|