Created
January 22, 2016 08:22
-
-
Save KIVagant/4d8c5a41e6107864ed75 to your computer and use it in GitHub Desktop.
Ansible 2 variables priority
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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? | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[develop] | |
localhost ansible_connection=local | |
[develop:vars] | |
hello=world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# group_vars/all/main.yml | |
--- | |
hello: nobody |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Variables test | |
hosts: develop | |
tasks: | |
- debug: var=hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ansible/ansible#14067