On Monday, 21 January 2019 17:38:10 CET Rama wrote:
> Hi,
> 
> I am facing another issue. In the first scenario we used 
> *{{hw_health.storage['Controller 
> on System Board']['logical_drives'][0]['physical_drives'] | 
> selectattr('status', 'match', 'Failed') | list}} *where only one 
> physical_drives.  Some servers having two "physical_drives" sections. The 
> status: Failed may happen either sections.   Can you please help me here 
> how can we get the Failed list from either.  

It's not pretty and it's probably a better way to this, but this should work

"{{ hw_health.storage['Controller on System Board'].logical_drives | 
map(attribute='physical_drives') | list | flatten | selectattr('status', 
'match', 'OK') | list }}"


-- 
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/2117101.T0LdcmorQR%40x1.
For more options, visit https://groups.google.com/d/optout.

Reply via email to