what to do with a command task which starts more scripts

31 views
Skip to first unread message

Rob Mokkink

unread,
Apr 12, 2017, 5:27:50 PM4/12/17
to Ansible Project
Hi,


I am facing an issue with a command task that executes a main ruby script(oreman-proxy-certs-generate), see https://theforeman.org/plugins/katello/3.3/installation/smart_proxy.html.
The command executes the ruby script, but this scripts executes puppet and some other scripts, the first script is done, so the command task is done, which make 
What is the best practice to deal with these situations?

Thanks.

Kind regards,

Rob

J Hawkesworth

unread,
Apr 12, 2017, 6:15:35 PM4/12/17
to Ansible Project
If the ruby script does something like write a file when it has finished you could use async to kick off the job and then use wait_for to wait until the file is written. There are other things you can wait for such as ports as well as files.

Hope this helps,

Jon

Rob Mokkink

unread,
Apr 13, 2017, 12:45:42 PM4/13/17
to Ansible Project
I tried async and wait_for, but both didn't give me the expected result. I ended up writing a small wrapper script that executes the command, and it works.



Op donderdag 13 april 2017 00:15:35 UTC+2 schreef J Hawkesworth:

Rob Mokkink

unread,
Apr 13, 2017, 12:45:42 PM4/13/17
to Ansible Project
I tried everything, wait_for, async etc. The quickest and easiest way was to fix the problem was to create a wrapper script and execute it with the script module.


Op donderdag 13 april 2017 00:15:35 UTC+2 schreef J Hawkesworth:
If the ruby script does something like write a file when it has finished you could use async to kick off the job and then use wait_for to wait until the file is written.  There are other things you can wait for such as ports as well as files.

Hope this helps,

Jon

Reply all
Reply to author
Forward
0 new messages