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.

Luca Berton
4 min readJul 22, 2022

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.

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet