How to execute pre tasks on all hosts before running tasks serial:1

31 views
Skip to first unread message

Mark van der Hout

unread,
Jun 19, 2015, 4:55:45 AM6/19/15
to ansible...@googlegroups.com
Hi,

I have a playbook which deploys a new .war file for a tomcat instance. Since there are 6 hosts in a loadbalanced setup I have configured to run the playbook on 1 host at a time.
However, I want to do a 'pre flight check' on all hosts if the directory where the .war file is placed even exists, to make sure the playbook won't break in the middle of a deployment.

Is there a way to execute tasks on all hosts before running serial=1 and thus doing the actual deployment?




Barry Kaplan

unread,
Jun 19, 2015, 5:09:55 AM6/19/15
to ansible...@googlegroups.com
Just create two plays in the same playbook file. The first can run in parallel and the second in serial.

Mark van der Hout

unread,
Jun 19, 2015, 5:20:50 AM6/19/15
to ansible...@googlegroups.com
I feel kinda stupid now. Thanks for pointing out the obvious!
Reply all
Reply to author
Forward
0 new messages