#- name: Enable 'monit' service (chkconfig monit on)
#  command: chkconfig monit on
#  when: is_debian and ansible_local.local_facts.os_ver == "debian-8"

#- name: Restart monit service
#  command: service monit restart

- name: Enable & (Re)Start 'monit' systemd service, if monit_enabled
  systemd:
    daemon_reload: yes
    name: monit
    enabled: yes
    state: restarted
  when: monit_enabled

- name: Disable & Stop 'monit' service, if not monit_enabled
  systemd:
    daemon_reload: yes
    name: monit
    enabled: no
    state: stopped
  when: not monit_enabled
