Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New variable containing the name of the running playbook #170

Open
utoddl opened this issue Aug 7, 2019 · 1 comment
Open

New variable containing the name of the running playbook #170

utoddl opened this issue Aug 7, 2019 · 1 comment

Comments

@utoddl
Copy link

utoddl commented Aug 7, 2019

Proposal: create ansible_playbook_name variable

Author: Todd Lewis <@utoddl>

Date: 2019-08-07

  • Status: New
  • Proposal type: core
  • Estimated time to implement: 5 minutes for the right person

Motivation

Trying to create messages pinpointing the relevant playbook is currently not possible. This should be simple, and useful for messages in shared roles, or templates for files containing comments about provenance, etc.

Problem

  • In conjunction with playbook_dir, it would be possible to include the relevant playbook name in messages, template output, etc.

Solution proposal

  • Create ansible_playbook_name at the same time as playbook_dir.

Dependencies (optional)

This would only be relevant when running playbooks. Not for ad hoc commands.

Documentation (optional)

Adding an entry to https://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html

@sivel
Copy link
Member

sivel commented Aug 7, 2019

fwiw, a playbook doesn't have a name, but it does have a filename. I'd either be explicit and use filename in the variable, or just call it ansible_playbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants