Member-only story
Current ansible-playbook Path — playbook_dir Magic Variable — Ansible Tip and Tricks
How to display the current execution Ansible Playbook file system path using the “playbook_dir” Magic Variables for debugging and simplifying your automation journey.
How to display the Current ansible-playbook Path?
I’m going to show you how to Use the “playbook_dir” Ansible Magic Variable in Ansible Playbook with a live demo and some simple Ansible code.
I’m Luca Berton and welcome to today’s episode of Ansible Pilot.
Ansible Magic Variables
- playbook_dir
The path to the directory of the playbook that was passed to the ansible-playbook command line
How to Ansible Magic Variables in Ansible Playbook.
The good news is that Ansible provides some internal variables that come out of the box with some information such as running the Ansible version, inventory details, or execution options.