Hi

On Thu, 2015-08-06 at 12:05 -0700, Kathy Allen wrote:
> Hi.
> 
> I'm working on some orchestration where I need to run a task across
> sets of N remote nodes. If that task fails on any one of the remote
> nodes, the orchestration needs to halt (or be handled somehow). In my
> test, I cause one node to fail and I expected the entire ansible run
> to bomb out, but that's not what happened. The failed node is
> reported, but the playbook continues on.

That is by design.

> 
> How can I make ansible exit upon the failure of any one of these
> nodes?

http://docs.ansible.com/ansible/playbooks_delegation.html#maximum-failure-percentage

You can set mail_fail_percentage: 0 


> 
> Or, how can I have some kind of handler to pause the run before
> continuing? (I've not yet looked into handlers)

Don't think so ....

> 
> Playbook, plays, tasks, and output are shown below. One question about
> the output: for the node that failed, the task "debug: var=output" is
> absent. That task only fires for the successful node. Should I expect
> that task to also fire for the failed node? I was surprised by that.

No - once a node fails (without "ignore_errors: True"), it is no longer
part of the remainder of the play, so no further tasks will be executed
on the failed node. 

Hope this helps

-- 
Karl E. Jorgensen

-- 
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-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1438890629.29148.8.camel%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to