---
# handlers file for ansible-telegraf

- name: "Restart Telegraf"
  service:
    name: telegraf
    state: restarted
    enabled: true
  when: not telegraf_agent_docker
  become: true

- name: "Restart Telegraf container"
  docker_container:
    name: "{{ telegraf_agent_docker_name }}"
    restart: True
  when: telegraf_agent_docker

- name: "Restart Windows Telegraf"
  win_service:
    name: Telegraf
    start_mode: auto
    state: restarted

- name: "Restart MacOS Telegraf"
  shell: brew services restart telegraf
