Get project directory in a playbook

Hi all,
For a playbook I need to get the projects directory in order not to hardcode it in the playbook or create an bash variable. Is this possible?
The project is on git and is cloned using awx project with git as source.

Thanks
Daniel

Hi Daniel,

You use the following variable:

playbook_dir
The path to the directory of the playbook that was passed to the `ansible-playbook`command line.
[https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html](https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html)

Konstantin.

Thanks for the answer it worked and with a little regex I could get the path of the project.