Hi, 


I am using the Napalm module with Ansible and using its get_facts module to 
obtain some basic information from the device. The relevant output is below,
 



"ansible_facts": {
     "napalm_environment": { 
                "cpu": { 
                    "0": { 
                        "%usage": 0.0 
                         }
                       }, 




Using the debug module for troubleshooting, the following

 
- name: print data
      debug:
        msg: "{{ result.ansible_facts.napalm_environment.cpu }} "



outputs the following:


 "msg": {
        "0": { 
            "%usage": 0.0 
        } 
    }



The question is how do I access the value for the key "%usage".


 
- name: print data
      debug:
        msg: "{{ result.ansible_facts.napalm_environment.cpu.0}} "


 
- name: print data
      debug:
        msg: "{{ result.ansible_facts.napalm_environment.cpu.'0'. }} "


 

 The error was: dict object has no element 0





Many thanks

-- 
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/13067f81-753b-43bb-979d-d8be9c39c829%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to