ansible / proposals

Repository for sharing and tracking progress on enhancement proposals for Ansible.
Creative Commons Zero v1.0 Universal
93 stars 19 forks source link

Playbook variables. #123

Open jsalts opened 6 years ago

jsalts commented 6 years ago

Contrary to this, playbook variables don't actually exist. This is a variable defined on a play.

Proposal: Playbook level variables:

e.g. vars: url: example.com

import_playbook: cluster_services.yml import_playbook: cluster_services.yml import_playbook: cluster_services.yml

Author: jsalts

Date: 2018/06/29

Motivation

Makes import_playbook more useful.

Problems

What problems exist that this proposal will solve?

Currently there is no way to define variables exclusively for a playbook. Group vars is undesirable because it can affect multiple playbooks and --extra-vars means you can't store the variable in the yaml if you want to. There is a clear use case for passing the same variable into multiple import-playbook calls.

agaffney commented 6 years ago

This can currently be accomplished via --extra-vars or a set_fact task.

jmcgill298 commented 6 years ago

to clarify, files can be used by prefixing the filepath with "@"