Moin!
The correct syntax for nested list is
stub2:
- - mystub2,example.net
- - - ns1.mystub2.example.net
- - 192.0.2.5
or
stub2:
-
- mystub2,example.net
-
-
- ns1.mystub2.example.net
-
- 192.0.2.5
Thanks a lot. That was the trick I was looking for. You missed one array ( the structure is complex ;-).
I don't think I missed an array, but I didn't test it so I did now.
- hosts: localhost
gather_facts: false
vars:
stub: [["mystub.example.net", [["ns1.mystub.example.net", ["192.0.2.4"]]]]]
stub2:
- - mystub2,example.net
- - - ns1.mystub2.example.net
- - 192.0.2.5
tasks:
- debug: var=stub
- debug: var=stub2
Gives:
TASK [debug] ***********************************
ok: [localhost] => {
"stub": [
[
"mystub.example.net",
[
[
"ns1.mystub.example.net",
[
"192.0.2.4"
]
]
]
]
]
}
TASK [debug] ***********************************
ok: [localhost] => {
"stub2": [
[
"mystub2,example.net",
[
[
"ns1.mystub2.example.net",
[
"192.0.2.5"
]
]
]
]
]
}
As you can see thees two are identical.
Fully correct the yams represantion is:
stub2:
\-
\- mystub2,example\.net
\-
\-
\- ns1\.mystub2\.example\.net
\-
\- 192\.0\.2\.
stub2:
\- \- mystub2,example\.net
\- \- \- \- ns1\.mystub2\.example\.net
\- \- 192\.0\.2\.5
but that was easy to fix myself, so thanks again.
But this gives me
TASK [debug] **************************************
ok: [localhost] => {
"stub3": [
[
"mystub2,example.net",
[
[
[
"ns1.mystub2.example.net"
],
[
"192.0.2.5"
]
]
]
]
]
}
And this is *not* the same as your example in your first mail.