It is possible to delay "delegate_to" until remote server is ready?

Hello!

I have a site.yml file, which includes a ‘frontend.yml’ and a ‘backend.yml’ playbook to configure app servers and database servers. The frontend.yml playbook is applied to the hosts in the “frontend” group, while the backend.yml file applies to the hosts in the “backend” group.

Is there a way to ensure that the step specified in ‘delegate_to’ is only run on the remote host (the database host), once the remote host is in a certain state or has finished the setup of a specific step?

Thank you very much!

Maybe it would be easier instead to have the ‘access-config’ file be a template and have a template task that runs on the database server.

You can see info on accessing data about other hosts at http://docs.ansible.com/playbooks_variables.html#magic-variables-and-how-to-access-information-about-other-hosts

You can look up “wait_for” for basic port open-ness or use a “until” loop in Ansible, so plenty of options if you want to wait until something gets into a particular state.

http://docs.ansible.com/wait_for_module.html

http://docs.ansible.com/playbooks_loops.html#do-until-loops