Skip to content

Instantly share code, notes, and snippets.

@rohitthakur2590
Created March 24, 2021 12:04
Show Gist options
  • Save rohitthakur2590/0039a98080d156e6ab08ed79bd8cc53f to your computer and use it in GitHub Desktop.
Save rohitthakur2590/0039a98080d156e6ab08ed79bd8cc53f to your computer and use it in GitHub Desktop.
---
- name: Gtaher facts
hosts: junos-lab
collections:
- junipernetworks.junos
tasks:
- name: Get junos Facts
junipernetworks.junos.junos_facts:
gather_subset: all
gather_network_resources: all
"ansible_facts": {
"ansible_net_api": "netconf",
"ansible_net_config": "## Last changed: 2020-12-16 02:47:59 UTC\nversion 17.3R1.10;\nsystem {\n host-name an-vsrx-01;\n domain-name hostname.com;\n domain-search [ redhat.com ansible.com ];\n root-authentication {\n encrypted-password \"$6$fUtrSua7$bNbH4TKUuhbUHDQWEQLocNSMdzs8Dm7XK7Wgj0sQXnFgVC24AwQ/kmPoZbhM5epnKTHOvlrSHXBxlmJze2v.P1\";\n ssh-rsa \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL3izI637an5A/A61R+YzmBF1kzJovluQuSE/kVxitzgvR5bWOJX2E9kp8pJ/3YSCRB8JHxUQNCqD/KY8eOYuzGg0mOOHMbfOCmaQT+oT7TZXKRAkBLmPKv8v/TmAbv7bgzN55XuC5s9tIYBllAMZ7Hrmrh53f8NyIP2UgIpKh4FlJp5nQXrbKzXHFbEHJd757+fjyBSOeHnWN2vE/1ZfjIOXPMoDVRDHqQc2vUsCyk3F2ycFZ+TrddRFYHylpGYUCqLMJtwNbDWKHSa5GlDTX9HVKza84U1VPLlmY6Cl/WDsBfkWWkvmjP3c69les2vYVyoJafMtGIBjXoc0OCMoh vagrant@trusty64\";\n }\n name-server {\n 192.168.1.1;\n 10.8.38.1;\n 10.8.36.1;\n 10.3.3.0;\n 10.3.4.0;\n }\n login {\n message \"THIS DEVICE HAS BEEN CONFIGURED BY ANSIBLE\";\n user ansible {\n uid 2000;\n class super-user;\n authentication {\n encrypted-password \"$6$ZlQIMkTR$.bd1EG/0JZY6VN1SvZ54qSQcO6jAg3b.6CgnK3nbX3jgZsDmDJIq0ucLZcsLI6GxJy0q1KSTfXj4/Z.smTgVs.\";\n ssh-rsa \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvLBCvbloQQwbvlrAEU/txha1cvX0lQ1eGCNddiXfE8u/a+C9IVCs8YxyOV5r2MTC+8GLbMMF4XYgizl1Xtsm0VW4YBtJ1jXo36W+eZZJ8GCwWdjYcyjqFyfHBDA1qLR/G09u45wFDf+ohvUMCwPsCk87T5MuwLLkhD3hFpizkpou2rsop3KOd6d8GBUVQ1z29aOIqE1yrsCKqqD2i8f1eA3uhu0r9Rx22YZWnjx7nZ4PVKZrzH1i6KwPw4aO6Ximd7y9dDXnFVSogpN1gwtL1XgqRfmBH9RiGRWtON/vuvXtw4JoWpy8R6t9tXmNM/SjFkwdNMSaHMGgxtKp+YTXF daniel@mbp.local\";\n }\n }\n user ansible-2 {\n uid 2001;\n class super-user;\n authentication {\n encrypted-password \"$6$IO2eL5xExCzARLG.$5E8DOA7RudawFSH0EhgPgE/AvGySnYBxxmUTt47T6j2vFymT2/BicaudbW7Bx7kIie1b1Kh282zBhOAkcVR7q1\";\n }\n }\n user ansible_tes {\n uid 2011;\n class operator;\n authentication {\n encrypted-password \"$6$7FF1nCKH$MFtEmE2WFhjOu6eT9LFF1isIp3IceBJZ3t/.QuVSwkWh8ImYmVVZDc00Kdo15/6I4GEv0a83dfxqel6ZF/si31\";\n }\n }\n user ansible_test {\n uid 2013;\n class operator;\n authentication {\n encrypted-password \"$6$LBSMVkbC$Oxn0sbzk8AVrVg3flQj6aLO9I3vIz4mniH4Iuci6O6rHhJuu1az8KxrUXo/wRxptx0RQ24O4py3la7GReBof30\";\n }\n }\n }\n services {\n ssh {\n root-login allow;\n }\n telnet;\n netconf {\n ssh {\n port 830;\n }\n }\n web-management {\n http {\n interface fxp0.0;\n }\n }\n }\n syslog {\n archive size 300000 files 3 world-readable;\n file test {\n any any;\n }\n file test5 {\n any any;\n }\n file test6 {\n any any;\n }\n file test2 {\n any any;\n }\n file test4 {\n any any;\n }\n file test7 {\n any any;\n }\n file test8 {\n any any;\n }\n file test9 {\n any any;\n }\n }\n license {\n autoupdate {\n url https://ae1.juniper.net/junos/key_retrieval;\n }\n }\n}\nchassis {\n aggregated-devices {\n ethernet {\n lacp {\n system-priority 63;\n link-protection;\n }\n }\n }\n}\nsecurity {\n screen {\n ids-option untrust-screen {\n icmp {\n ping-death;\n }\n ip {\n source-route-option;\n tear-drop;\n }\n tcp {\n syn-flood {\n alarm-threshold 1024;\n attack-threshold 200;\n source-threshold 1024;\n destination-threshold 2048;\n queue-size 2000;\n timeout 20;\n }\n land;\n }\n }\n }\n policies {\n from-zone trust to-zone trust {\n policy default-permit {\n match {\n source-address any;\n destination-address any;\n application any;\n }\n then {\n permit;\n }\n }\n }\n from-zone trust to-zone untrust {\n policy default-permit {\n match {\n source-address any;\n destination-address any;\n application any;\n }\n then {\n permit;\n }\n }\n }\n }\n zones {\n security-zone trust {\n tcp-rst;\n }\n security-zone untrust {\n screen untrust-screen;\n }\n }\n}\ninterfaces {\n ge-0/0/1 {\n ether-options {\n 802.3ad ae1;\n }\n }\n ge-0/0/2 {\n ether-options {\n 802.3ad ae1;\n }\n }\n ge-0/0/3 {\n ether-options {\n 802.3ad {\n ae2;\n primary;\n }\n }\n }\n ge-0/0/4 {\n ether-options {\n 802.3ad {\n ae2;\n backup;\n }\n }\n }\n ge-1/0/0 {\n unit 0 {\n family inet {\n address 192.168.100.1/24;\n address 10.200.16.20/24;\n }\n family inet6;\n }\n }\n ge-2/0/0 {\n unit 0 {\n family inet {\n address 192.168.100.2/24;\n address 10.200.16.21/24;\n }\n family inet6;\n }\n }\n ge-3/0/0 {\n unit 0 {\n family inet {\n address 192.168.100.3/24;\n address 10.200.16.22/24;\n }\n family inet6;\n }\n }\n em0 {\n description \"configured by ansible netconf plugin test\";\n }\n em1 {\n description TEST;\n }\n fxp0 {\n unit 0 {\n family inet {\n address 10.8.38.38/24;\n }\n }\n }\n}\nrouting-options {\n static {\n route 0.0.0.0/0 {\n next-hop 10.8.38.1;\n install;\n }\n }\n}\nprotocols {\n lldp {\n management-address 10.1.1.1;\n advertisement-interval 10000;\n transmit-delay 400;\n hold-multiplier 10;\n interface ge-0/0/1;\n interface ge-0/0/2 {\n disable;\n }\n }\n}\nfirewall {\n family inet {\n filter ANSIBLE-TEST {\n term TEST-TERM-1 {\n from {\n protocol udp;\n }\n then {\n log;\n discard;\n }\n }\n }\n filter filter_if_group {\n term term1 {\n from {\n interface-group 1;\n }\n }\n }\n }\n}\nvlans {\n test12 {\n description \"test vlan 12\";\n vlan-id 12;\n }\n test13 {\n description \"test vlan 13\";\n vlan-id 13;\n }\n vlan100 {\n vlan-id 100;\n }\n vlan200 {\n vlan-id 200;\n }\n vlan300 {\n vlan-id 300;\n }\n vlan400 {\n vlan-id 400;\n }\n}",
"ansible_net_filesystems": [
"/dev/vtbd0s1a",
"devfs",
"/dev/md0",
"/cf",
"devfs",
"procfs",
"/dev/vtbd1s1e",
"/dev/vtbd1s1f",
"/dev/vtbd3s2",
"/dev/md1",
"/dev/md2",
"/var/jail",
"/var/jails/rest-api",
"/var/log",
"devfs",
"192.168.1.1:/var/tmp/corefiles",
"192.168.1.1:/var/volatile",
"192.168.1.1:/var/log",
"192.168.1.1:/var/traffic-log",
"192.168.1.1:/var/local",
"192.168.1.1:/var/db/aamwd",
"192.168.1.1:/var/db/secinteld",
"192.168.1.1:/app_disk"
],
"ansible_net_gather_network_resources": [
"lag_interfaces",
"bgp_global",
"l3_interfaces",
"acl_interfaces",
"bgp_address_family",
"static_routes",
"interfaces",
"lacp",
"l2_interfaces",
"acls",
"ospfv3",
"lldp_interfaces",
"ospf",
"ospf_interfaces",
"lacp_interfaces",
"lldp_global",
"vlans"
],
"ansible_net_gather_subset": [
"default",
"interfaces",
"config",
"hardware"
],
"ansible_net_has_2RE": false,
"ansible_net_hostname": "an-vsrx-01",
"ansible_net_interfaces": {
".local.": {
"admin-status": "up",
"macaddress": "Unspecified",
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "Loopback"
},
"dsc": {
"admin-status": "up",
"macaddress": "Unspecified",
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unspecified",
"type": "Software-Pseudo"
},
"em0": {
"admin-status": "up",
"macaddress": "02:00:00:00:00:04",
"mtu": "1514",
"oper-status": "up",
"speed": "1000mbps",
"type": "Ethernet"
},
"em1": {
"admin-status": "up",
"macaddress": "52:54:00:ae:90:40",
"mtu": "1514",
"oper-status": "up",
"speed": "1000mbps",
"type": "Ethernet"
},
"em2": {
"admin-status": "up",
"macaddress": "52:54:00:73:9b:f1",
"mtu": "1514",
"oper-status": "up",
"speed": "1000mbps",
"type": "Ethernet"
},
"fxp0": {
"admin-status": "up",
"macaddress": "00:50:56:94:fb:3d",
"mtu": "1514",
"oper-status": "up",
"speed": "1000mbps",
"type": "Ethernet"
},
"gre": {
"admin-status": "up",
"macaddress": null,
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "GRE"
},
"ipip": {
"admin-status": "up",
"macaddress": null,
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "IPIP"
},
"irb": {
"admin-status": "up",
"macaddress": "4c:96:14:fb:3d:70",
"mtu": "1514",
"oper-status": "up",
"speed": "Unspecified",
"type": "Ethernet"
},
"lo0": {
"admin-status": "up",
"macaddress": "Unspecified",
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unspecified",
"type": "Loopback"
},
"lsi": {
"admin-status": "up",
"macaddress": "Unspecified",
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "Software-Pseudo"
},
"mtun": {
"admin-status": "up",
"macaddress": null,
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "Multicast-GRE"
},
"pimd": {
"admin-status": "up",
"macaddress": null,
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "PIMD"
},
"pime": {
"admin-status": "up",
"macaddress": null,
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "PIME"
},
"pp0": {
"admin-status": "up",
"macaddress": "Unspecified",
"mtu": "1532",
"oper-status": "up",
"speed": "Unspecified",
"type": "PPPoE"
},
"ppd0": {
"admin-status": "up",
"macaddress": null,
"mtu": "Unlimited",
"oper-status": "up",
"speed": "800mbps",
"type": "PIMD"
},
"ppe0": {
"admin-status": "up",
"macaddress": null,
"mtu": "Unlimited",
"oper-status": "up",
"speed": "800mbps",
"type": "PIME"
},
"st0": {
"admin-status": "up",
"macaddress": null,
"mtu": "9192",
"oper-status": "up",
"speed": "Unspecified",
"type": "Secure-Tunnel"
},
"tap": {
"admin-status": "up",
"macaddress": "Unspecified",
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "Software-Pseudo"
},
"vlan": {
"admin-status": "up",
"macaddress": "00:00:00:00:00:00",
"mtu": "1518",
"oper-status": "down",
"speed": "1000mbps",
"type": "VLAN"
},
"vtep": {
"admin-status": "up",
"macaddress": "Unspecified",
"mtu": "Unlimited",
"oper-status": "up",
"speed": "Unlimited",
"type": "Software-Pseudo"
}
},
"ansible_net_memfree_mb": 26832,
"ansible_net_memtotal_mb": 979404,
"ansible_net_model": "vsrx",
"ansible_net_modules": [
{
"description": "VSRX",
"name": "Midplane",
"part_number": "750-058562",
"serial_number": "4214F7E7",
"version": "REV 08"
},
{
"name": "CB 0"
},
{
"description": "VSRX-S",
"name": "Routing Engine 0",
"part_number": "BUILTIN",
"serial_number": "BUILTIN"
},
{
"description": "FPC",
"name": "FPC 0",
"part_number": "611-049549",
"serial_number": "RL3714040884",
"version": "REV 07"
}
],
"ansible_net_python_version": "3.9.0",
"ansible_net_routing_engines": {
"null": {
"cpu_background": "0",
"cpu_background1": "0",
"cpu_background2": "0",
"cpu_background3": "0",
"cpu_idle": "100",
"cpu_idle1": "98",
"cpu_idle2": "99",
"cpu_idle3": "99",
"cpu_interrupt": "0",
"cpu_interrupt1": "1",
"cpu_interrupt2": "0",
"cpu_interrupt3": "0",
"cpu_system": "0",
"cpu_system1": "1",
"cpu_system2": "0",
"cpu_system3": "0",
"cpu_temperature": "0 degrees C / 32 degrees F",
"cpu_user": "0",
"cpu_user1": "1",
"cpu_user2": "0",
"cpu_user3": "0",
"last_reboot_reason": "0x4000:VJUNOS reboot ",
"load_average_fifteen": "0.00",
"load_average_five": "0.00",
"load_average_one": "0.00",
"memory_buffer_utilization": "53",
"memory_system_total": "977",
"memory_system_total_used": "635",
"memory_system_total_util": "65",
"model": "VSRX-S",
"serial_number": "BUILTIN",
"slot": null,
"start_time": "2020-10-16 15:18:48 UTC",
"status": "OK",
"temperature": "0 degrees C / 32 degrees F",
"up_time": "67 days, 18 hours, 47 minutes, 18 seconds"
}
},
"ansible_net_serialnum": "35C463ACD59C",
"ansible_net_system": "junos",
"ansible_net_version": "17.3R1.10",
"ansible_network_resources": {
"interfaces": [
{
"enabled": true,
"name": "ge-0/0/1"
},
{
"enabled": true,
"name": "ge-0/0/2"
},
{
"enabled": true,
"name": "ge-0/0/3"
},
{
"enabled": true,
"name": "ge-0/0/4"
},
{
"enabled": true,
"name": "ge-1/0/0"
},
{
"enabled": true,
"name": "ge-2/0/0"
},
{
"enabled": true,
"name": "ge-3/0/0"
},
{
"description": "configured by ansible netconf plugin test",
"enabled": true,
"name": "em0"
},
{
"description": "TEST",
"enabled": true,
"name": "em1"
},
{
"enabled": true,
"name": "fxp0"
}
],
"junos_acls": [
{
"acls": [
{
"aces": [
{
"grant": "deny",
"name": "TEST-TERM-1",
"protocol": "udp"
}
],
"name": "ANSIBLE-TEST"
},
{
"aces": [
{
"name": "term1"
}
],
"name": "filter_if_group"
}
],
"afi": "ipv4"
}
],
"l3_interfaces": [
{
"ipv4": [
{
"address": "192.168.100.1/24"
},
{
"address": "10.200.16.20/24"
}
],
"name": "ge-1/0/0",
"unit": "0"
},
{
"ipv4": [
{
"address": "192.168.100.2/24"
},
{
"address": "10.200.16.21/24"
}
],
"name": "ge-2/0/0",
"unit": "0"
},
{
"ipv4": [
{
"address": "192.168.100.3/24"
},
{
"address": "10.200.16.22/24"
}
],
"name": "ge-3/0/0",
"unit": "0"
},
{
"ipv4": [
{
"address": "10.8.38.38/24"
}
],
"name": "fxp0",
"unit": "0"
}
],
"lacp": {
"link_protection": "revertive",
"system_priority": 63
},
"lldp_global": {
"address": "10.1.1.1",
"hold_multiplier": 10,
"interval": 10000,
"transmit_delay": 400
},
"lldp_interfaces": [
{
"name": "ge-0/0/1"
},
{
"enabled": false,
"name": "ge-0/0/2"
}
],
"static_routes": [
{
"address_families": [
{
"afi": "ipv4",
"routes": [
{
"dest": "0.0.0.0/0",
"next_hop": [
{
"forward_router_address": "10.8.38.1"
}
]
}
]
}
]
}
],
"vlans": [
{
"description": "test vlan 12",
"name": "test12",
"vlan_id": 12
},
{
"description": "test vlan 13",
"name": "test13",
"vlan_id": 13
},
{
"name": "vlan100",
"vlan_id": 100
},
{
"name": "vlan200",
"vlan_id": 200
},
{
"name": "vlan300",
"vlan_id": 300
},
{
"name": "vlan400",
"vlan_id": 400
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment