---
- name: Start sensu-agent (Linux)
  service:
    name: sensu-agent
    state: started
    enabled: true
  when: ansible_facts.os_family != "Windows"

- name: Start sensu-agent (Windows)
  action:
    module: win_service
    name: SensuAgent
    path: C:\Program Files\sensu\sensu-agent\bin\sensu-agent.exe service run
    state: started
  when: ansible_facts.os_family == "Windows"
