root@lucas-VirtualBox:/etc/ansible/JUNOS# ansible-playbook backup.yaml
PLAY [Iniciando Backup] *******************************************************************************************************************************************************
TASK [Acessando e coletando dados] ********************************************************************************************************************************************
[WARNING]: arguments wait_for, match, rpcs are not supported when using transport=cli
ok: [192.168.1.180]
TASK [getting status] *********************************************************************************************************************************************************
ok: [192.168.1.180] => {
"response.stdout_lines": [
[
"set version 12.1R1.9",
"set system host-name ROUTER-PR",
"set system root-authentication encrypted-password encrypted-password",
"set system login user admin full-name ADMINISTRADOR",
"set system login user admin uid 100",
"set system login user admin class super-user",
"set system login user admin authentication encrypted-password \"$1$7HIQbfrq$TB3x4EVFJRBDWJUxnqhZM/\"",
"set system services ftp",
"set system services ssh",
"set system services telnet",
"set system services netconf ssh port 830",
"set system syslog user * any emergency",
"set system syslog file messages any notice",
"set system syslog file messages authorization info",
"set system syslog file interactive-commands interactive-commands any",
"set interfaces em0 description INTERNET",
"set interfaces em0 unit 0 family inet address 192.168.1.2/30",
"set interfaces em0 unit 0 family mpls",
"set interfaces em1 vlan-tagging",
"set interfaces em1 encapsulation vlan-vpls",
"set interfaces em1 unit 512 encapsulation vlan-vpls",
"set interfaces em1 unit 512 vlan-id 512",
"set interfaces em2 unit 0 family inet address 192.168.1.200/24",
"set interfaces em2 unit 0 family inet address 192.168.1.180/24",
"set interfaces lo0 unit 0 family inet address 1.1.1.1/32",
"set interfaces lo0 unit 0 family mpls",
"set routing-options autonomous-system 2",
"set routing-options auto-export",
"set protocols mpls traffic-engineering mpls-forwarding",
"set protocols mpls interface em0.0",
"set protocols bgp group EXTERNOS type external",
"set protocols bgp group EXTERNOS peer-as 1",
"set protocols bgp group EXTERNOS local-as 2",
"set protocols bgp group EXTERNOS neighbor 192.168.1.1 peer-as 1",
"set protocols bgp group INTERNO type internal",
"set protocols bgp group INTERNO local-address 10.0.0.1",
"set protocols bgp group INTERNO peer-as 65000",
"set protocols bgp group INTERNO local-as 65000",
"set protocols bgp group INTERNO neighbor 10.0.0.2",
"set protocols ospf area 0.0.0.0 interface em0.0",
"set protocols ospf area 0.0.0.0 interface lo0.0",
"set protocols ldp interface em0.0",
"set protocols ldp interface lo0.0",
"set policy-options policy-statement ACEITA-LOOPBACK term 1 from route-filter 1.1.1.1/32 exact",
"set policy-options policy-statement ACEITA-LOOPBACK term 1 then accept",
"set policy-options policy-statement REDISTRIBUI-LOOPBACK from protocol direct",
"set policy-options policy-statement REDISTRIBUI-LOOPBACK then accept"
]
]
}
TASK [CRIANDO DIRETORIO DE BACKUP.] *******************************************************************************************************************************************
ok: [192.168.1.180]
TASK [save output to /etc/ansible/backups] ************************************************************************************************************************************
ok: [192.168.1.180]
PLAY RECAP ********************************************************************************************************************************************************************
192.168.1.180 : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
root@lucas-VirtualBox:/etc/ansible/JUNOS#
root@lucas-VirtualBox:/etc/ansible# ls
ansible.cfg CONFIGS file01.txt JUNOS projects show_run_192.168.1.180.txt show_run_192.168.1.99.cfg TEMPLATES
BACKUPJUNOS estudos_pdf hosts Linux-ansible PROJETO-ANSIBLE-JINJA2 show_run_192.168.1.200.txt show_run_192.168.1.99.txt
root@lucas-VirtualBox:/etc/ansible# cd BACKUPJUNOS/
root@lucas-VirtualBox:/etc/ansible/BACKUPJUNOS# ls
show_run_192.168.1.180.txt
root@lucas-VirtualBox:/etc/ansible/BACKUPJUNOS#