On Tuesday, 8 January 2019 22:21:44 CET Rama wrote:
> Hi,
>
> Edited the PB and it is
>
> ---
> - hosts: localhost
> connection: local
> gather_facts: no
> tasks:
> - name: ILO Facts
> hpilo_facts:
> host: 10.20.64.51
> login: xxxxxxx
> password: xxxxxxx
> delegate_to: localhost
>
> - debug:
> var: hw_health.storage['Controller on System
> Board']['logical_drives']
>
>
>
> Got output:
> TASK [debug]
> **************************************************************************************************************************************
> ok: [localhost] => {
> "hw_health.storage['Controller on System Board']['logical_drives']": [
> {
> "encryption_status": "Not Encrypted",
> "label": "01",
> "physical_drives": [
> {
> "configuration": "Configured",
> "version": "PD-0.7",
> "label": "device-1",
> "location": "1",
> "serial_number": "PWH12GVF",
> "status": "OK"
> },
> {
> "configuration": "Configured",
> "version": "PD-0.7",
> "label": "device-2",
> "location": "2",
> "serial_number": "PWH12GWF",
> "status": "OK"
> },
> {
> "configuration": "Configured",
> "version": "PD-0.7",
> "label": "device-3",
> "location": "3",
> "serial_number": "PWH12GXF",
> "status": "CRITICAL"
> }
> ],
> "status": "OK"
> }
> ]
> }
This makes it easier to understand structure of the variable, you should get
the critical ones with this
{{ hw_health.storage['Controller on System
Board']['logical_drives'][0]['physical_drives'] | selectattr('status',
'equalto', 'CRITICAL') | 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/2659697.GgzaTtlp0l%40x1.
For more options, visit https://groups.google.com/d/optout.