Asynchronously calling roles

I’m looking to call groups of roles at the same time in an asynchronous fashion, but have yet to figure out how to do so. My playbook is relatively simple:


release.yml

  • hosts: “{{ host_group }}”

remote_user: “{{ release_user }}”

serial: 99

vars_files:

  • release_vars.yml

roles:

  • { role : release_copy_srl_files, when : dmgr != ‘yes’ }

  • { role : release_copy_reporting_jars, when : reportingServer == ‘true’ }

  • { role : release_deploy_portal_ears, when : dmgr == ‘yes’ }

  • { role : release_deploy_portal_paa, when : primaryNode == ‘true’ }

  • { role : release_deploy_portal_paa, when : secondaryNode == ‘true’ }

  • { role : release_deploy_appserver_ears, when : dmgr == ‘yes’ }

  • { role : release_start_checkout_IHS, when : ihs_checkout == ‘true’ }

No host will have multiple conditions met in the when statements. Being able to run these simultaneously would save about the amount of time that it’d take to have a human do the job, so the goal is to optimize this playbook to the extent that we can.

Any suggestions?

Thanks!
Nick

Have a look at this presentation - the last part covers various ways you can run playbooks in parallel.

http://www.slideshare.net/bcoca/more-tips-n-tricks

There’s some more discussion here https://github.com/ansible/proposals/issues/31 and mention of various other tools you could use to wrap ansible to achieve parallel runs.

Hope this helps,

Jon