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

53 views
Skip to first unread message

Juergen Brendel

unread,
Mar 17, 2014, 7:19:28 PM3/17/14
to ansible...@googlegroups.com

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.

From my app servers, I would like to use "delegate_to" in order to add their individual IP address to the access-config file of a database server(s). The database server, however, may not be ready yet, so the access-config file may not be in place yet.

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!


Matt Martz

unread,
Mar 21, 2014, 8:11:39 AM3/21/14
to ansible...@googlegroups.com, Juergen Brendel
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.

-- 
Matt Martz
ma...@sivel.net
--
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/c04b73ec-d798-47b7-9730-b11adf31ff3f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael DeHaan

unread,
Mar 21, 2014, 9:30:35 AM3/21/14
to ansible...@googlegroups.com, Juergen Brendel
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.




Reply all
Reply to author
Forward
0 new messages