Hi everyone,

I'm looping over list of servers where I have two items:

svm_name
protocols

Protocols can be include one or multiple items:

ok: [localhost] => {
>     "msg": [
>         {
>             "protocols": [
>                 "nfs",
>                 "cifs"
>             ],
>             "svm_name": "90101"
>         },
>         {
>             "protocols": "fcp",
>             "svm_name": "90100"
>         }
>     ]
> }


I'm looping through this list to get all the servers, which have cifs 
activated:

  - name: Create_list_of_CIFS_SVMs
>     set_fact:
>        cifs_servers: "{{ cifs_svms + [ {'svm_name': item.0.svm_name} ] }}"
>     loop: "{{ data_svms | subelements('protocols') }}"
>     when: item.1 == "cifs"



That loop works if there are multiple items within protocols available. If 
there is only one item available it fails with fatal:

> [localhost]: FAILED! => {"msg": "the key 'protocols' should point to a 
> list, got u'fcp'"}



Does any one have an idea, how to fix this?

Thanks

Matthias

-- 
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/01b4353d-afac-438e-9f20-9c3e9bd70200%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to