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

**URL:** <https://forum.ansible.com/t/does-the-ansible-playbook-command-can-be-run-in-background/20089>\
**Category:** Ansible Project\
**Created:** [December 29, 2015, 11:40am UTC](https://forum.ansible.com/t/does-the-ansible-playbook-command-can-be-run-in-background/20089 "2015-12-29T11:40:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honsen](https://avatars.discourse-cdn.com/v4/letter/h/aca169/32.png) [@Honsen](https://forum.ansible.com/u/Honsen)\
**Post date:** [December 29, 2015, 11:40am UTC](https://forum.ansible.com/t/does-the-ansible-playbook-command-can-be-run-in-background/20089/1 "2015-12-29T11:40:54Z")

</div>

`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 ?

---

<div class="post-metadata">

**Author:** ![chrismeyersfsu](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chrismeyersfsu/32/1016_2.png) [@chrismeyersfsu](https://forum.ansible.com/u/chrismeyersfsu)\
**Post date:** [December 30, 2015, 2:40am UTC](https://forum.ansible.com/t/does-the-ansible-playbook-command-can-be-run-in-background/20089/2 "2015-12-30T02:40:13Z")

</div>

Please be more specific. What is nohup lacking that salt --async has that you would like?

---

<div class="post-metadata">

**Author:** ![Javier\_Palacios](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@Javier\_Palacios](https://forum.ansible.com/u/Javier_Palacios)\
**Post date:** [January 7, 2016, 9:28am UTC](https://forum.ansible.com/t/does-the-ansible-playbook-command-can-be-run-in-background/20089/3 "2016-01-07T09:28:36Z")

</div>

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
