Does the ansible-playbook command can be run in background ?

1,195 views
Skip to first unread message

Honsen

unread,
Dec 29, 2015, 3:43:07 PM12/29/15
to Ansible Project
The salt command salt state.sls can be run in background by use --async parameter, does ansible has some parameters to run ansible-playbook command in background ?

Now I use nohup to achieve my goal, like this:

nohup ansible-playbook main.yml &

But this is not I want. Does anyone has a good idea ?

chris meyers

unread,
Dec 31, 2015, 11:52:57 AM12/31/15
to Ansible Project
Please be more specific. What is nohup lacking that salt --async has that you would like?

Javier Palacios

unread,
Jan 7, 2016, 4:28:56 AM1/7/16
to ansible...@googlegroups.com
On Wed, Dec 30, 2015 at 3:40 AM, chris meyers <chris.me...@gmail.com> wrote:
Please be more specific. What is nohup lacking that salt --async has that you would like?

Ansible is interactive by nature, so it uses stdin. Using nohup will only work if the playbook runs very nicely. Any arising question (for example, accept an unknown ssh key) will stop the playbook. So I believe that one of the the ´async´ functionalities missing is handling playbook questions.
If the use of nohup is just to capture both stdout & stderr, there are other ways to do it.

Javier Palacios
Reply all
Reply to author
Forward
0 new messages