-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-telegraf.yml
60 lines (57 loc) · 1.52 KB
/
deploy-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
53
54
55
56
57
58
59
60
---
- name: Deploy Telegraf
hosts: app
become: true
gather_facts: False
vars_files:
- "vars/main.yml"
- "vars/credentials.yml"
tasks:
- name: Assures telegraf directories exists
file: path=/etc/telegraf state=directory
tags:
- telegraf
- name: Copy telegraf configurations
template: src="config/telegraf/telegraf.conf.j2"
dest="/etc/telegraf/telegraf.conf"
owner=root
group=root
tags:
- telegraf
- name: create application networks
docker_network:
name: "{{ app_network_name }}"
- name: pull telegraf image
docker_image:
state: present
source: pull
force_source: yes
name: "telegraf:1.11.1"
tag: "1.11.1"
tags:
- telegraf
- name: run telegraf via docker
docker_container:
name: telegraf
image: telegraf:1.11.1
state: started
restart_policy: always
force_kill: yes
ports:
- "8092:8092/udp"
- "8125:8125/udp"
- "8094:8094"
networks:
- name: "{{ app_network_name }}"
volumes:
- /etc/telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /sys:/rootfs/sys:ro
- /proc:/rootfs/proc:ro
- /etc:/rootfs/etc:ro
env:
HOST_PROC: /rootfs/proc
HOST_SYS: /rootfs/sys
HOST_ETC: /rootfs/etc
tags:
- telegraf