--- - name: "🔎 Check {{ system_service_run_unit }} is installed on this host" ansible.builtin.command: "systemctl cat {{ system_service_run_unit }}" register: system_service_run_unit_present changed_when: false failed_when: false when: DEPLOYMENT_MODE == 'swarm' - name: "🔄 Apply state (retry up to {{ SYS_SERVICE_RUNNER_RETRIES }} times)" ansible.builtin.systemd: name: "{{ system_service_run_unit }}" state: "{{ SYS_SERVICE_RUNNER_STATE }}" register: result retries: "{{ SYS_SERVICE_RUNNER_RETRIES }}" delay: "{{ SYS_SERVICE_RUNNER_DELAY }}" until: result is not failed when: >- DEPLOYMENT_MODE == 'compose' or system_service_run_unit_present.rc == 0