On 04.03.2019 12:56, Ralf Weber wrote:
> Moin!
> 
> For a recent project I needed to have a data structure with nested arrays, 
> however I could not get it to work using yaml syntax. When using the 
> following playbook:
> 
> - hosts: all
>    tasks:
>      - name: Set some test facts
>        set_fact:
>          bla: True
>          stub: [["mystub.example.net", [["ns1.mystub.example.net", 
> ["192.0.2.4"]]]]]
>          stub2:
>            -
>              - mystub2,example.net
>                -
>                  - ns1.mystub2.example.net
>                    -
>                      - 192.0.2.5

<snip />

> 
> but IMHO these data structures should be identical. I also tried to put the 
> same yams in a var file with the same result. What am I doing wrong? Any 
> ideas?

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


-- 
Kai Stian Olstad

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/4f2db15a-fed3-1732-e500-e4f6dbb87a2f%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to