if failed

25 views
Skip to first unread message

Suporter

unread,
May 1, 2017, 11:52:45 AM5/1/17
to Ansible Project
is there a way i can run a task if a task fails? how can i mention that 

Phonthip Namkaew

unread,
May 1, 2017, 1:36:36 PM5/1/17
to Ansible Project
Ansible block/rescue ?

Brian Coca

unread,
May 1, 2017, 1:37:46 PM5/1/17
to Ansible Project
On the task, ignore_errors=yes + register then the subsequent task
when: registeredvar|failed

----------
Brian Coca

Suporter

unread,
May 1, 2017, 2:10:47 PM5/1/17
to Ansible Project
ok, lets say i have 5 tasks, if 4th one fails, can i run 2nd one using this when: registeredvar|failed  ?

Brian Coca

unread,
May 1, 2017, 2:17:53 PM5/1/17
to Ansible Project
out of order?


----------
Brian Coca

Suporter

unread,
May 1, 2017, 2:21:44 PM5/1/17
to Ansible Project
yeah, it has to be in sequence?

Brian Coca

unread,
May 1, 2017, 2:24:39 PM5/1/17
to Ansible Project
ansible executes in sequence, so task 2 executes before task 4 and you
cannot base the decision of it's execution on something that happens
after.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages