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.