diff --git a/ansible/roles/docker_service/tasks/main.yaml b/ansible/roles/docker_service/tasks/main.yaml index 6e144ac..a0cc840 100644 --- a/ansible/roles/docker_service/tasks/main.yaml +++ b/ansible/roles/docker_service/tasks/main.yaml @@ -120,6 +120,7 @@ when: - health_check_enabled - health_check_url != "" or health_check_port != "" + - not ansible_check_mode - compose_result is changed or template_result is changed or file_result is changed - name: Wait for service HTTP endpoint @@ -132,12 +133,16 @@ until: health_result is not failed retries: "{{ health_check_retries }}" delay: "{{ health_check_retry_delay }}" - when: health_check_enabled and health_check_url != "" - check_mode: false + when: + - health_check_enabled and health_check_url != "" + # A dry run changes nothing to verify, and a new service is not there yet + - not ansible_check_mode - name: Wait for service port ansible.builtin.wait_for: host: "{{ health_check_host }}" port: "{{ health_check_port }}" timeout: "{{ health_check_retries * health_check_retry_delay }}" - when: health_check_enabled and health_check_port != "" + when: + - health_check_enabled and health_check_port != "" + - not ansible_check_mode