# playbook\_file

**URL:** <https://forum.ansible.com/t/playbook-file/15330>\
**Category:** Ansible Project\
**Created:** [May 26, 2014, 2:48am UTC](https://forum.ansible.com/t/playbook-file/15330 "2014-05-26T02:48:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralovely](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@ralovely](https://forum.ansible.com/u/ralovely)\
**Post date:** [May 26, 2014, 2:48am UTC](https://forum.ansible.com/t/playbook-file/15330/1 "2014-05-26T02:48:39Z")

</div>

Hi List.

There are some global variables about a run, like `inventory_dir` or `inventory_file`.  
Is their a similar set of variable for the `playbook_file` (when running ansible-playbook )?

In the same vein,  
is it possible to retrieve the command line that triggered the run i.e… “ansible-playbook -i path/to/inventory path/to/playbook” ?

I would need these for some specific logging purpose.

Thank you.  
raphael.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [May 27, 2014, 7:57pm UTC](https://forum.ansible.com/t/playbook-file/15330/2 "2014-05-27T19:57:54Z")

</div>

There is playbook\_dir, but not file.

I’d generally argue that if your playbook needs to know the filename of itself, it has too much self awareness.

I do understand why it would be useful for logging purposes though.

I can see this being useful for things like the {{ ansible\_managed }} template file, as well, though the same role could be applied by different playbooks.
