how to abort playbook run on first failed host during 'gathering facts' phase?

274 views
Skip to first unread message

nusenu

unread,
Jun 15, 2015, 5:09:45 PM6/15/15
to ansible...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hi,

my playbook/role requires that it is run against all given hosts.
Proceeding in case of a single failed host would generate incomplete
configs and must be prevented.

Is there a way to tell ansible-playbook to terminate/abort immediately
as soon as one host fails the 'gathering facts' phase?
(something better than manual ctrl-c?)

thanks,
nusenu
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVfz8JAAoJEFv7XvVCELh0EhwQAINC9lwVS/BytVogD0G4SqLV
NxcXac3zbQl9NvB2OoyJ6tIPL2quiESUx4UBRqnb3SnarjZ25HmMqPwMJtTylWHC
R5xMcNXjShdjD9KT1dgnN21YdhkMuN7/P/v51SVzMDAqyr+saZlxyMcdQZHaXW1H
9v/tj6pFq1bvr4976CSikIuhrTdEAJ6KiC4wx2EF4cAknq10c6+5ei26KLblNgh7
9XkN/YNR9YMwRqFr2lvvXv5M/iroRsKgrDnvbdGu8BY6Ylu1bIxcs3QZHvcxoFa7
CGSzws8S68OTYd+USzGlhjt+apAUDmVH7PUKXMFiwIrJmMdniAFVG/wQmKrFHfdi
0CLBDGBasEduZxs2A9ZH3akjZatyR4CB4j35vMTW45ihtICrki2AxOTa6cX0pTCS
mre7B59dm1p4xa9NKWF+TybuSpot7kxcZbVhW1IW1QCJ7zUYrt3cj4e2rPqxH3LY
ioGz+9P4afbjEVwwF3i7lULcJVUwF7uxPcQ3rYceEzaqVxwua8ysvNJm3upQSImp
cZzsh1l9IwSDh6363gSjFc9v2Lisuj+apL+5jJbyyPVqmrkeM8zNsltkZTTw1V8U
2JRJn2BqmIQqNedbOYzBMbBLX7Tls7gBhLajaHVAwyI8vHUMjFviwM6CrfLTEeaw
nik8mGLoBH/Smv1X/6cz
=vtwU
-----END PGP SIGNATURE-----

Brian Coca

unread,
Jun 15, 2015, 5:24:05 PM6/15/15
to ansible...@googlegroups.com
you might want to play with serial and max fails.
http://docs.ansible.com/playbooks_delegation.html#maximum-failure-percentage
> --
> 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 post to this group, send email to ansible...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/557F3F09.4000706%40openmailbox.org.
> For more options, visit https://groups.google.com/d/optout.



--
Brian Coca

nusenu

unread,
Jun 15, 2015, 7:23:35 PM6/15/15
to ansible...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512



Brian Coca:
> you might want to play with serial and max fails.
> http://docs.ansible.com/playbooks_delegation.html

thank you, I'll go with

max_fail_percentage: 1
serial: 1

to abort on the first failed host.
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJVf15mAAoJEFv7XvVCELh0gbkP/A7BBfzj2fB1thYj1vP7Ie+0
txz3PIdWyygFyUt/trE1VaegcAWnJnsMnTHjLoWRPN2bN6/7TIyq+xpBARRNFxoP
pffwfHpXTxz5zLw+0GzcbjrxPlBfQg+u8mvLSUaoQOkWuYG6h7YGaEvDOdxFJHt0
2R0iCX/XOqg8VKyTP91rhm2/Io3rYqBHIgf3NQmbG3KpsgET8XACibINqJYMV/uW
EHz0f5dVAe964WYP5zSGhVzWoCtaHVJqVIWh2YiAzSMbYr11Gu/MsbbTdk68eOHS
ZFJNdqbgT8m4CpVZuiAeyePJ3YJNo5es9rOt7c7yC9icb5ai0ILzOQPqkq47YvIG
3XQk2YBRKlARp1vynSdC5UUrwck4z6Ch37U1aidok9Ytvfk6nr/3ebMzUbIEEWIv
/rFJ3yjTT2ZFJgx6SLILp2CnN+HNMsfoXHVgs5pWBfHIU8SN8eU/HPvGwBuVELWH
/WKprBP8BC2Dck4nZBcAN0q2StdczA05ksG3cTYPsgbzQbcvJmjZlBQ4rHVxcTmY
2k5EktRtMRypuJdyBfNjo+bgu+ga8l9XeYFRzWZboeqZ1di5fkJWXLFKtYD6YJRi
mqBXdzryDesl67bI30Uc75RnEBQehEpitle2Tda+36Ht/Gcr9MIIjoy+69pA36xo
kPxYq0D3athCS+2X51NP
=B7DL
-----END PGP SIGNATURE-----
Reply all
Reply to author
Forward
0 new messages