How do I get a task to always execute even if the task before it fail?

29 views
Skip to first unread message

Jim

unread,
Jun 29, 2022, 9:25:15 AM6/29/22
to Ansible Project
I'm new to ansible and want to set my tasks to always run even if the task above it fails. Can someone provide an example or show me how to set it up with my task shown below?

Here is one of my task that I want to set to run:

    #
    # New Task
    #
    - name: New Task
      uri:
       url: "https://task.com"
       method: POST
       user: "{{ ansible_user }}"
       password: "{{ ansible_ssh_pass }}"
       status_code:
         - 400
       validate_certs: no
       body:
         name:
         id:
         active: true
         priority: 1
         qualityOfService:
           frequency: 3
           intervalSeconds: 8000
         signalId: abcd1234-2479-4f3d-b835-b445e58eef30
       body_format: json

Dick Visser

unread,
Jun 29, 2022, 12:59:15 PM6/29/22
to ansible...@googlegroups.com
You mention multiple tasks, but the play only has one. Which is the task above the other?

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/070bc39c-ece8-4b68-be02-dce2944b8754n%40googlegroups.com.
--
Sent from Gmail Mobile
Reply all
Reply to author
Forward
0 new messages