Hi all,

I have the following playbook 

---                                                                        
                                                                            
                                                                            
           
- hosts: r2
  gather_facts: true
  connection: local
  vars:
    creds:
      host: "{{ ansible_host }}"
      username: cisco
      password: cisco
 
  tasks:
    - name: ios_facts
      ios_facts:
         provider: "{{ creds }}"
 
    - debug:
        var: ansible_net_interfaces


If I do a debut I get this output

"ansible_net_interfaces": {
        "Ethernet0/0": {
            "bandwidth": 10000, 
            "description": null, 
            "duplex": null, 
            "ipv4": [
                {
                    "address": "10.10.10.12", 
                    "subnet": "24"
                }
            ], 
            "lineprotocol": "up ", 
            "macaddress": "aabb.cc00.2000", 
            "mediatype": null, 
            "mtu": 1500, 
            "operstatus": "up", 
            "type": "AmdP2"
        }, 
        "Ethernet0/1": {
            "bandwidth": 10000, 
            "description": null, 
            "duplex": null, 
            "ipv4": [], 
            "lineprotocol": "down ", 
            "macaddress": "aabb.cc00.2010", 
            "mediatype": null, 
            "mtu": 1500, 
            "operstatus": "administratively down", 
            "type": "AmdP2"



What im trying to do is to check if the fact "lineprotocol" is up or down, 
but when I put the fact in my var is not working, how should I do this?

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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fbae18f9-7744-4a5b-bb96-366813cd52f7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to