Closed lemoer closed 4 years ago
- dns_recursive_allowed_private_rdns_zones:
- "8.0.0.0.e.e.f.f.a.c.d.f.ip6.arpa."
from vars/all_hosts.yml
should be migrated to there as well.
Maybe we could use another level of abstaction with include:
supernode.yml:
---
- hosts: sn01
tasks:
- name: foo und bar
set_fact:
a:
c: ['foo', 'bar']
- name: print
debug: var=a
- include: add_it.yml b="hey"
- include: add_it.yml b="hey"
- name: print
debug: var=a
add_it.yml:
---
- name: add it
set_fact:
a: "{{ a|combine({ \"c\": a[\"c\"] + [b] }) }}"
This include snippet adds variable b into array in a["c"].
output:
PLAY [sn01] ***********************************************************************************
TASK [Gathering Facts] ************************************************************************
ok: [sn01]
TASK [foo und bar] ****************************************************************************
ok: [sn01]
TASK [print] **********************************************************************************
ok: [sn01] => {
"a": {
"c": [
"foo",
"bar"
]
},
"changed": false
}
TASK [add it] *********************************************************************************
ok: [sn01]
TASK [add it] *********************************************************************************
ok: [sn01]
TASK [print] **********************************************************************************
ok: [sn01] => {
"a": {
"c": [
"foo",
"bar",
"hey",
"hey"
]
},
"changed": false
}
PLAY RECAP ************************************************************************************
sn01 : ok=6 changed=0 unreachable=0 failed=0
Can you add a tangible example please? ;-)
And everybody is complaining about Perl regexes.
There are a lot of variables, that are shared between all supernodes. We should outsource them into an own file
vars/all_sn.yml