Wait function between Roles

149 views
Skip to first unread message

Mark Matthews

unread,
May 18, 2016, 10:45:16 AM5/18/16
to Ansible Project

Hi

 

Not sure if you able to assist with this question, but is it at all possible to setup a ‘wait’ function between roles in a playbook?

 

So if I have the following playbook:

 

---

- name: Config Web Servers

  hosts: all

  roles:

    - web_common

    - win_update

    - wintech_domain

    - win_reboot

 

web_common has a few PowerShell scripts that it runs at the end of the playbook, and it takes a few minutes in order for these to finish on the servers. Obviously after Ansible has run the PowerShell script in the playbook it considers the job as completed and moves on.

So what is happening is that the next role is being executed before the Powershell scripts have finished…and this is causing problems.

 

So I want to know if there is a way to add some kind of ‘wait’ function so that the next role on starts after a desired time?

 

Cheers

Mark

J Hawkesworth

unread,
May 18, 2016, 10:58:54 AM5/18/16
to Ansible Project
Hi Mark


It might suit your needs in this case to put it into a role so you can pass in an appropriate pause

All the best,

Jon
Reply all
Reply to author
Forward
0 new messages