Re: [ansible-project] how to abort execution upon a single fail on any host

2015-07-29 Thread Serge van Ginderachter
On 29 July 2015 at 14:49, Leon Xie qdxiaoli...@gmail.com wrote:

 max_fail_percentage:



​Perhaps ​any_errors_fatal: true might help?

(btw Seems undocumented)

-- 
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/CAEhzMJAgmEEOPW_bQN2aQGQ5mP3THtarnUXd6Y4GEfz1Y11i0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how to abort execution upon a single fail on any host

2015-07-29 Thread Leon Xie
thanks a lot for your suggestion.
I had a try by adding any_errors_fatal: true.
however, it doesn't work.

++
- hosts: aa
  max_fail_percentage: 0
  any_errors_fatal: true 
  roles:
- stop_server

- hosts: allhosts
  max_fail_percentage: 0
  roles:
- backup_data
++

+
PLAY [aa] 


TASK: [stop_server | stop server] ***
failed: [xxx.xxx.0.xx] = {attempts: 1, changed: true, cmd: 
[xxx], delta: 0:00:00.006697, end: 2015-07-29 
21:04:35.801786, failed: true, rc: 255, start: 2015-07-29 
21:04:35.795089, warnings: []}
msg: Task failed as maximum retries was encountered

PLAY [allhosts] 
**

TASK: [backup_data | create directory] ***
ok: [xx.xxx.0.xx]
ok: [xx.xxx.0.xx]

TASK: [backup_data | mount directory] *
skipping: [xx.xxx.0.xx]
skipping: [xx.xxx.0.xx]
++

On Wednesday, July 29, 2015 at 8:54:59 PM UTC+8, Serge van Ginderachter 
wrote:


 On 29 July 2015 at 14:49, Leon Xie qdxia...@gmail.com javascript: 
 wrote:

 max_fail_percentage:



 ​Perhaps ​any_errors_fatal: true might help?

 (btw Seems undocumented)


-- 
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/38c6a052-ed86-4238-9021-7e275beda62a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] how to abort execution upon a single fail on any host

2015-07-29 Thread Leon Xie
Hi Serge,

your suggestion about any_errors_fatal works for the hosts that in a single 
play.
if there is another play and one of the hosts in the play is not in the 
hosts that marked as any_errors_fatal, the tasks in this play will also be 
executed.


On Wednesday, July 29, 2015 at 8:54:59 PM UTC+8, Serge van Ginderachter 
wrote:


 On 29 July 2015 at 14:49, Leon Xie qdxia...@gmail.com javascript: 
 wrote:

 max_fail_percentage:



 ​Perhaps ​any_errors_fatal: true might help?

 (btw Seems undocumented)


-- 
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/d1698750-6695-4843-9843-548c1f58df78%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.