infrastructure/ansible/roles/forrest/tasks/telegraf.yml
Jake Howard aba81f79bc
Add telegraf
And input to ping and output via prometheus
2021-03-04 15:16:54 +00:00

26 lines
727 B
YAML

- 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