vars_files cannot see facts or other variables that a role in same play can #28024
Labels
affects_2.4
This issue/PR affects Ansible v2.4
bug
This issue/PR relates to a bug.
support:core
This issue/PR relates to code supported by the Ansible Engineering Team.
ISSUE TYPE
COMPONENT NAME
playbooks
ANSIBLE VERSION
CONFIGURATION
I'm importing roles and plays from another directory so I have in ansible.cfg
OS / ENVIRONMENT
OSX 10.10.5
SUMMARY
When I try to dynamically decide which vault file I want to import by using a variable in vars_files (unit tests shouldn't be using production passwords!) for imported plays, I'm unable to do so using either group_vars, host_vars, or facts set in an setup play. I can only use an ansible command line argument.
STEPS TO REPRODUCE
ansible-playbook -t app_test -i inventories/localhost/local.hosts unit.yml
EXPECTED RESULTS
If the variable
vault_file
is specified on the ansible command line using--extra-vars
the script runs just fine. It should run just fine whenvault_file
is set from an inventory file or set as a fact inunitenv_setup
, but it does notACTUAL RESULTS
Using any method besides the command line to set
vault_file
, I get the following error:extremely verbose mode:
The text was updated successfully, but these errors were encountered: