- name: Enable & (Re)Start 'mongodb.service' if mongodb_enabled
  systemd:
    name: mongodb
    daemon_reload: yes
    enabled: yes
    state: restarted
  when: mongodb_enabled

- name: Disable & Stop 'mongodb.service' if not mongodb_enabled
  systemd:
    name: mongodb
    enabled: no
    state: stopped
  when: not mongodb_enabled
