Thanks, I didn't know about async, but it's NOT what I want since I do want the script to run as a daemon indeed.
On Wednesday, January 3, 2018 at 3:54:23 PM UTC-5, Toshio Kuratomi wrote: > > Or option three: use async:. > http://docs.ansible.com/ansible/latest/playbooks_async.html > > > If the script is something you want to run and exit after performing its > tall, I think async is the most idiomatic. If the script is more like a > daemon, having nohup in the script feels right to me but I can't think of a > reason either would be better. > -Toshio > > On Jan 3, 2018 11:56 AM, "ZillaYT" <[email protected] <javascript:>> wrote: > >> Say I want to run a script in the background after my Ansible run >> finishes. Which of these two options is the correct way? >> >> *Option 1: Run a nohup on the Ansible task itself* >> - name:Run a script in the background >> command: nohup myscript.sh 2>&1 & >> >> where myscript.sh does something (anything) but has no nohup calls. >> >> >> *Option 2: Put the nohup in the script itself?* >> - name: Run a script in the background >> command: ./myscript.sh >> >> and myscript.sh has in it the nohup >> >> *myscript.sh* >> nodup do_something 2>&1 & >> >> >> >> >> -- >> 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 [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/ansible-project/70316e05-1357-40d8-aab4-53092dd8edc1%40googlegroups.com >> >> <https://groups.google.com/d/msgid/ansible-project/70316e05-1357-40d8-aab4-53092dd8edc1%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- 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 [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/d9378cad-179c-453d-99e2-d63de13c207b%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
