Add telegraf

And input to ping and output via prometheus
This commit is contained in:
Jake Howard
2021-03-04 15:16:54 +00:00
parent 914676d209
commit aba81f79bc
7 changed files with 161 additions and 0 deletions

View File

@ -6,3 +6,6 @@
- name: Prometheus
include: prometheus.yml
- name: Telegraf
include: telegraf.yml

View File

@ -10,6 +10,15 @@
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install prometheus config
template:
src: files/prometheus.yml
dest: /opt/prometheus/prometheus.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
notify: restart prometheus
become: true
- name: Install prometheus compose file
template:
src: files/docker-compose-prometheus.yml

View File

@ -0,0 +1,26 @@
- name: Create telegraf install directory
file:
path: /opt/telegraf
state: directory
owner: "{{ docker_user.name }}"
mode: "{{ docker_compose_directory_mask }}"
become: true
- name: Install telegraf config
template:
src: files/telegraf.conf
dest: /opt/telegraf/telegraf.conf
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
notify: restart telegraf
become: true
- name: Install telegraf compose file
template:
src: files/docker-compose-telegraf.yml
dest: /opt/telegraf/docker-compose.yml
mode: "{{ docker_compose_file_mask }}"
owner: "{{ docker_user.name }}"
validate: docker-compose -f %s config
notify: restart telegraf
become: true