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

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