Move telegraf to its own role
This commit is contained in:
parent
b26fb5d741
commit
1982326553
@ -3,21 +3,14 @@
|
|||||||
---
|
---
|
||||||
- name: Install and configure Influxdb
|
- name: Install and configure Influxdb
|
||||||
block:
|
block:
|
||||||
- name: Install influxdb
|
- name: Install package
|
||||||
block:
|
apt:
|
||||||
- name: Install package
|
name:
|
||||||
apt:
|
- influxdb
|
||||||
name:
|
- influxdb-client
|
||||||
- influxdb
|
- name: Template out config
|
||||||
- influxdb-client
|
template:
|
||||||
- name: Template out config
|
src: "influxdb.conf"
|
||||||
template:
|
dest: "/etc/influxdb/influxdb.conf"
|
||||||
src: "influxdb.conf"
|
notify: restart influxdb
|
||||||
dest: "/etc/influxdb/influxdb.conf"
|
|
||||||
notify: restart influxdb
|
|
||||||
- name: Install telegraf
|
|
||||||
block:
|
|
||||||
- name: Install package
|
|
||||||
apt:
|
|
||||||
deb: "https://dl.influxdata.com/telegraf/releases/telegraf_1.14.2-1_amd64.deb"
|
|
||||||
become: yes
|
become: yes
|
||||||
|
8
roles/telegraf/handlers/main.yml
Normal file
8
roles/telegraf/handlers/main.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#!/usr/bin/ansible-playbook
|
||||||
|
# vim:ft=ansible:
|
||||||
|
---
|
||||||
|
- name: restart telegraf
|
||||||
|
systemd:
|
||||||
|
name: telegraf
|
||||||
|
state: restarted
|
||||||
|
become: yes
|
20
roles/telegraf/tasks/main.yml
Normal file
20
roles/telegraf/tasks/main.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/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
|
2
site.yml
2
site.yml
@ -31,6 +31,8 @@
|
|||||||
tags: [ common, snmpd ]
|
tags: [ common, snmpd ]
|
||||||
- role: influxdb
|
- role: influxdb
|
||||||
tags: [ common, influxdb ]
|
tags: [ common, influxdb ]
|
||||||
|
- role: telegraf
|
||||||
|
tags: [ common, telegraf ]
|
||||||
- import_playbook: playbooks/dns.yml
|
- import_playbook: playbooks/dns.yml
|
||||||
- import_playbook: playbooks/dbservers.yml
|
- import_playbook: playbooks/dbservers.yml
|
||||||
- import_playbook: playbooks/webservers.yml
|
- import_playbook: playbooks/webservers.yml
|
||||||
|
Loading…
Reference in New Issue
Block a user