Skip to content

Instantly share code, notes, and snippets.

@odyssey4me
Created December 14, 2018 14:35
Show Gist options
  • Save odyssey4me/72920ef07b68a8d98d45153b95235feb to your computer and use it in GitHub Desktop.
Save odyssey4me/72920ef07b68a8d98d45153b95235feb to your computer and use it in GitHub Desktop.
ansible update vs combine
PLAY [localhost] ************************************************************************************************************************************************************
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": ""
}
TASK [debug] ****************************************************************************************************************************************************************
ok: [localhost] => {
"msg": {
"Service": {
"Environment": "foo"
}
}
}
PLAY RECAP ******************************************************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0
- hosts: localhost
connection: local
gather_facts: no
vars:
test1:
enabled: yes
state: started
config_overrides: override1.update(override2)
override1:
Service:
Environment: "foo"
override2: {}
tasks:
- debug:
msg: "{{ override1.update(override2) }}"
- debug:
msg: "{{ override1 | combine(override2) }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment