# Capture ansible playbook command line

**URL:** <https://forum.ansible.com/t/capture-ansible-playbook-command-line/25249>\
**Category:** Ansible Project\
**Created:** [August 14, 2017, 4:50pm UTC](https://forum.ansible.com/t/capture-ansible-playbook-command-line/25249 "2017-08-14T16:50:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![graftonmaple](https://avatars.discourse-cdn.com/v4/letter/g/50afbb/32.png) [@graftonmaple](https://forum.ansible.com/u/graftonmaple)\
**Post date:** [August 14, 2017, 4:50pm UTC](https://forum.ansible.com/t/capture-ansible-playbook-command-line/25249/1 "2017-08-14T16:50:02Z")

</div>

For auditing purpose we would like to capture all ansible playbook commands being run by another team. How do I approach this?

Ideally we would like to assign it same pid as rest of the play and be part of ansible.log

Basically capture entire below command or everything after ansible-playbook:

ansible-playbook -i hosts dosomething.yaml --extra-vars ‘{“hostgroup”:“webservers”,“web\_app”:[“uploads”]}’

---

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [August 14, 2017, 7:02pm UTC](https://forum.ansible.com/t/capture-ansible-playbook-command-line/25249/2 "2017-08-14T19:02:55Z")

</div>

see script(1). it starts a logged shell. when you exit, it leaves a file called typescript where you ran it.
