for some reason, this task has to be done in 2 steps otherwise it fails.
1/ stop and disable the service
2/ mask it
when done with with a single task, the module says the service has been
stopped while this isn't the case (Ansible systemd module bug?).
it possibly relates to https://github.com/ansible/ansible/issues/68680
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
name: ceph-mgr@{{ ansible_facts['hostname'] }}
state: stopped
enabled: no
+ masked: no
+ failed_when: false
+
+ - name: mask ceph mgr systemd unit
+ systemd:
+ name: ceph-mgr@{{ ansible_facts['hostname'] }}
masked: yes
failed_when: false