infrastructure/ansible/roles/forrest/tasks/telegraf.yml

27 lines
727 B
YAML
Raw Normal View History

- 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