Hi @Vladimir,
Thanks !
It worked.
On Tuesday, October 10, 2023 at 6:12:09 PM UTC+5:30 Vladimir Botka wrote:
> > my_dict:
> > {
> > 100098f2b3a1f324 : myserver3_host4
> > 100098f2b3a12635 : myserver3_host5
> > 100098f2b3a14633 : myserver11_host3
> > 100098f2b3a1d541 : myserver11_host1
> > }
>
>
> storage_details_combined:
> - server_name: myserver3.domain.org
> wwns_dict:
> host4: '0x100098f2b3a1f324'
> host5: '0x100098f2b3a12635'
> wwns_pmax_list:
> - 100098f2b3a12635
> - 100098f2b3a1f324
> - server_name: myserver11.domain.org
> wwns_dict:
> host1: '0x100098f2b3a1d541'
> host3: '0x100098f2b3a14633'
> wwns_pmax_list:
> - 100098f2b3a1d541
> - 100098f2b3a14633
>
> Use Jinja
>
> my_dict: |
> {% filter from_yaml %}
> {% for i in storage_details_combined %}
> {% set srv=i.server_name|split('.')|first %}
> {% for k,v in i.wwns_dict.items() %}
> {{ v[2:] }}: {{ srv }}_{{ k }}
> {% endfor %}
> {% endfor %}
> {% endfilter %}
>
>
> --
> Vladimir Botka
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/78beabdc-9963-438f-8d2a-c039aff11349n%40googlegroups.com.