Skip to content

Instantly share code, notes, and snippets.

@infernix
Created March 2, 2016 23:38
Show Gist options
  • Save infernix/538374924cb65c9c6d33 to your computer and use it in GitHub Desktop.
Save infernix/538374924cb65c9c6d33 to your computer and use it in GitHub Desktop.
Ansible vars_files
Bootstrap:
mkdir -p vars/bar
touch vars/bar/all.yml
./hosts content:
[test]
localhost
[all:vars]
somevar=bar
test.yml play:
- name: Foo
hosts: all
vars_files:
- "vars/{{ somevar }}/all.yml"
tasks:
- debug: var=somevar
Result with -vvv:
skipping vars_file 'vars/{{ somevar }}/all.yml' due to an undefined variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment