Skip to content

Instantly share code, notes, and snippets.

@natefoo
Created April 7, 2015 16:33
Show Gist options
  • Save natefoo/35548eca0ad5c9b2663f to your computer and use it in GitHub Desktop.
Save natefoo/35548eca0ad5c9b2663f to your computer and use it in GitHub Desktop.
PLAY [localhost] **************************************************************
GATHERING FACTS ***************************************************************
ok: [localhost]
TASK: [debug var=hash] ********************************************************
ok: [localhost] => {
"var": {
"hash": {
"bar": "bar",
"foo": "foo"
}
}
}
TASK: [debug var=hash.foo] ****************************************************
ok: [localhost] => {
"var": {
"hash.foo": "foo"
}
}
TASK: [set_fact hash="{{ hash2 }}"] *******************************************
ok: [localhost]
TASK: [debug var=hash] ********************************************************
ok: [localhost] => {
"var": {
"hash": {
"foo": "baz",
"quux": "quux"
}
}
}
TASK: [debug var=hash.foo] ****************************************************
ok: [localhost] => {
"var": {
"hash.foo": "{{hash.foo}}"
}
}
PLAY RECAP ********************************************************************
localhost : ok=6 changed=0 unreachable=0 failed=0
---
- hosts: localhost
connection: local
vars_files:
- vars.yml
vars:
hash: "{{ hash1 }}"
tasks:
- debug: var=hash
- debug: var=hash.foo
- set_fact: hash="{{ hash2 }}"
- debug: var=hash
- debug: var=hash.foo
---
hash1:
foo: foo
bar: bar
hash2:
foo: baz
quux: quux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment