root@lucas-VirtualBox:/etc/ansible/JUNOS# ansible-playbook /etc/ansible/JUNOS/show-inter.yaml
PLAY [get interfaces] ***********************************************************************************************************************************************************************
TASK [Acessando e coletando versao...] ******************************************************************************************************************************************************
[WARNING]: arguments wait_for, match, rpcs are not supported when using transport=cli
ok: [192.168.1.180]
TASK [Coletando configuracoes...] ***********************************************************************************************************************************************************
ok: [192.168.1.180]
TASK [getting status] ***********************************************************************************************************************************************************************
ok: [192.168.1.180] => {
"response.stdout_lines": [
[
"Hostname: ROUTER-PR",
"Model: olive",
"JUNOS Base OS boot [12.1R1.9]",
"JUNOS Base OS Software Suite [12.1R1.9]",
"JUNOS Kernel Software Suite [12.1R1.9]",
"JUNOS Crypto Software Suite [12.1R1.9]",
"JUNOS Packet Forwarding Engine Support (M/T Common) [12.1R1.9]",
"JUNOS Packet Forwarding Engine Support (M20/M40) [12.1R1.9]",
"JUNOS Online Documentation [12.1R1.9]",
"JUNOS Voice Services Container package [12.1R1.9]",
"JUNOS Border Gateway Function package [12.1R1.9]",
"JUNOS Services AACL Container package [12.1R1.9]",
"JUNOS Services LL-PDF Container package [12.1R1.9]",
"JUNOS Services PTSP Container package [12.1R1.9]",
"JUNOS Services Stateful Firewall [12.1R1.9]",
"JUNOS Services NAT [12.1R1.9]",
"JUNOS Services Application Level Gateways [12.1R1.9]",
"JUNOS Services Captive Portal and Content Delivery Container package [12.1R1.9]",
"JUNOS Services RPM [12.1R1.9]",
"JUNOS Services HTTP Content Management package [12.1R1.9]",
"JUNOS AppId Services [12.1R1.9]",
"JUNOS IDP Services [12.1R1.9]",
"JUNOS Services Crypto [12.1R1.9]",
"JUNOS Services SSL [12.1R1.9]",
"JUNOS Services IPSec [12.1R1.9]",
"JUNOS Runtime Software Suite [12.1R1.9]",
"JUNOS Routing Software Suite [12.1R1.9]"
],
[
"Interface Admin Link Proto Local Remote",
"cbp0 up up ",
"demux0 up up ",
"dsc up up ",
"em0 up up ",
"em0.0 up up inet 192.168.1.2/30 ",
" mpls ",
"em1 up up ",
"em1.512 up up ",
"em2 up up ",
"em2.0 up up inet 192.168.1.180/24",
"em3 up up ",
"gre up up ",
"ipip up up ",
"irb up up ",
"lo0 up up ",
"lo0.0 up up inet 1.1.1.1 --> 0/0",
" mpls ",
"lo0.16384 up up inet 127.0.0.1 --> 0/0",
"lo0.16385 up up inet 128.0.0.4 --> 0/0",
" inet6 fe80::5200:f:fc01:0",
"lsi up up ",
"mtun up up ",
"pimd up up ",
"pime up up ",
"pip0 up up ",
"pp0 up up ",
"tap up up"
]
]
}
TASK [Configuracao] *************************************************************************************************************************************************************************
ok: [192.168.1.180] => {
"response1.stdout_lines": [
[
"## Last commit: 2021-08-27 01:57:01 UTC by admin",
"version 12.1R1.9;",
"system {",
" host-name ROUTER-PR;",
" root-authentication {",
" encrypted-password encrypted-password; ## SECRET-DATA",
" }",
" login {",
" user admin {",
" full-name ADMINISTRADOR;",
" uid 100;",
" class super-user;",
" authentication {",
" encrypted-password \"$1$7HIQbfrq$TB3x4EVFJRBDWJUxnqhZM/\"; ## SECRET-DATA",
" }",
" }",
" }",
" services {",
" ftp;",
" ssh;",
" telnet;",
" }",
" syslog {",
" user * {",
" any emergency;",
" }",
" file messages {",
" any notice;",
" authorization info;",
" }",
" file interactive-commands {",
" interactive-commands any;",
" }",
" }",
"}",
"interfaces {",
" em0 {",
" unit 0 {",
" family inet {",
" address 192.168.1.2/30;",
" }",
" family mpls;",
" }",
" }",
" em1 {",
" vlan-tagging;",
" encapsulation vlan-vpls;",
" unit 512 {",
" encapsulation vlan-vpls;",
" vlan-id 512;",
" }",
" }",
" em2 {",
" unit 0 {",
" family inet {",
" address 192.168.1.180/24;",
" }",
" }",
" }",
" lo0 {",
" unit 0 {",
" family inet {",
" address 1.1.1.1/32;",
" }",
" family mpls;",
" }",
" }",
"}",
"routing-options {",
" autonomous-system 2;",
" auto-export;",
"}",
"protocols {",
" mpls {",
" traffic-engineering mpls-forwarding;",
" interface em0.0;",
" }",
" bgp {",
" group EXTERNOS {",
" type external;",
" peer-as 1;",
" local-as 2;",
" neighbor 192.168.1.1 {",
" peer-as 1;",
" }",
" }",
" group INTERNO {",
" type internal;",
" local-address 10.0.0.1;",
" peer-as 65000;",
" local-as 65000;",
" neighbor 10.0.0.2;",
" }",
" }",
" ospf {",
" area 0.0.0.0 {",
" interface em0.0;",
" interface lo0.0;",
" }",
" }",
" ldp {",
" interface em0.0;",
" interface lo0.0;",
" }",
"}",
"policy-options {",
" policy-statement ACEITA-LOOPBACK {",
" term 1 {",
" from {",
" route-filter 1.1.1.1/32 exact;",
" }",
" then accept;",
" }",
" }",
" policy-statement REDISTRIBUI-LOOPBACK {",
" from protocol direct;",
" then accept;",
" }",
"}"
]
]
}
PLAY RECAP **********************************************************************************************************************************************************************************
192.168.1.180 : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0