My Playbook execution is not stopping in case of failure

Sankar_Kumar
Tue, 17 Mar 2026 05:56:59 +0000
Get Help

I have an Ansible task in my playbook for api automation, where i have looped the payloads.
Here I am expecting to stop the playbook execution whenever there is a module.fail_json() called during an execution. But currently, the playbook does not stop execution. I have tried any_errors_fatal: true but this is not working in my case.

    - name: Configure user details
      user_details:
        ip_address: "{{ server_address }}"
        token: "{{  token }}"
        request_payload: "{{ item }}"
      loop: "{{ users.request_payloads }}"
      loop_control:
        label: "{{ item.alias }}"
      register: results

2 posts - 2 participants