Skip to content

Instantly share code, notes, and snippets.

@KIVagant
Created January 22, 2016 08:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KIVagant/4d8c5a41e6107864ed75 to your computer and use it in GitHub Desktop.
Save KIVagant/4d8c5a41e6107864ed75 to your computer and use it in GitHub Desktop.
Ansible 2 variables priority
#
# ansible 1.9.4
#
ansible-playbook -i localhost.ini playbook.yml
...
TASK: [debug var=hello] *******************************************************
ok: [localhost] => {
"var": {
"hello": "world"
}
}
#
# ansible 2.0.0.2
#
...
TASK [debug] *******************************************************************
ok: [localhost] => {
"hello": "nobody" ← why here is nobody? It's a bug or variables priority was changed?
}
[develop]
localhost ansible_connection=local
[develop:vars]
hello=world
# group_vars/all/main.yml
---
hello: nobody
---
- name: Variables test
hosts: develop
tasks:
- debug: var=hello
@KIVagant
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment