-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtelegraf.yml
52 lines (43 loc) · 1.24 KB
/
telegraf.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
- hosts: all
vars:
http_port: 80
max_clients: 200
remote_user: root
tasks:
- name: Update apt cache
apt: update_cache=yes
- name: Download Telegraf
get_url: url=http://dl.influxdata.com/telegraf/releases/telegraf_1.3.2-1_amd64.deb dest=/opt/telegraf.deb
- name: Install Telegraf
apt:
deb: /opt/telegraf.deb
- name: Replace IP-server
replace:
path: /etc/telegraf/telegraf.conf
regexp: 'localhost:8086'
replace: '{{ iptelegraf }}'
backup: no
- name: Replace password
replace:
path: /etc/telegraf/telegraf.conf
regexp: '# password = "metricsmetricsmetricsmetrics"'
replace: 'password = "{{ passtelegraf }}"'
backup: no
- name: Replace login
replace:
path: /etc/telegraf/telegraf.conf
regexp: '# username = "telegraf"'
replace: 'username = "{{ usertelegraf }}"'
backup: no
- name: Start telegraf
service:
service: name=telegraf state=restarted enabled=yes
- name: Autoload in system Telegraf
replace:
path: /etc/rc.local
regexp: 'exit 0'
replace: 'telegraf \nexit 0'
backup: no
- name: reboot
shell: reboot&