-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
263 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,3 +100,5 @@ pip-selfcheck.json | |
|
|
||
| # Rope project settings | ||
| .ropeproject | ||
| *.retry | ||
| *.swp | ||
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,133 @@ | ||
|
|
||
| version 15.1F6.9 | ||
| system { | ||
| host-name ansible-vmx4; | ||
| no-redirects; | ||
| root-authentication { | ||
| encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA | ||
| } | ||
| login { | ||
| user salt { | ||
| uid 2001; | ||
| class super-user; | ||
| authentication { | ||
| encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA | ||
| ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA | ||
| } | ||
| } | ||
| } | ||
| services { | ||
| ssh; | ||
| netconf { | ||
| ssh; | ||
| traceoptions { | ||
| file nc.txt size 1m world-readable; | ||
| flag incoming; | ||
| } | ||
| } | ||
| } | ||
| syslog { | ||
| user * { | ||
| any emergency; | ||
| } | ||
| file messages { | ||
| any any; | ||
| authorization info; | ||
| } | ||
| file interactive-commands { | ||
| interactive-commands any; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| interfaces { | ||
| ge-0/0/0 { | ||
| description "ansible-vmx1" | ||
| unit 0 { | ||
| family inet { | ||
| address 172.10.14.4/24 | ||
| } | ||
| } | ||
| } | ||
|
|
||
| fxp0 { | ||
| description "OOB to MGMT Network"; | ||
| unit 0 { | ||
| family inet { | ||
| address 10.39.0.44/20; | ||
| } | ||
| } | ||
| } | ||
| lo0 { | ||
| unit 0 { | ||
| family inet { | ||
| address 10.39.8.44/32; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| routing-options { | ||
| router-id 10.39.8.44; | ||
| autonomous-system 65000; | ||
| static { | ||
| route 0.0.0.0/0 { | ||
| next-hop 10.39.0.1; | ||
| no-readvertise; | ||
| preference 255; | ||
| } | ||
| } | ||
| } | ||
| protocols { | ||
| bgp { | ||
| group Core { | ||
| type internal; | ||
| export __Ansible_Core_export; | ||
| local-address 10.39.8.44; | ||
| family inet { | ||
| unicast; | ||
| } | ||
| family inet-vpn { | ||
| unicast; | ||
| } | ||
| neighbor 10.39.8.41; | ||
| } | ||
| } | ||
| ospf { | ||
| area 0 { | ||
| interface ge-0/0/0.0 { | ||
| interface-type p2p; | ||
| metric 10; | ||
| } | ||
| interface lo0.0 { | ||
| passive; | ||
| } | ||
| } | ||
| } | ||
| ldp { | ||
| interface ge-0/0/0.0; | ||
| interface lo0.0; | ||
| } | ||
| rsvp { | ||
| interface ge-0/0/0.0; | ||
| } | ||
| mpls { | ||
| interface ge-0/0/0.0; | ||
| } | ||
| lldp { | ||
| interface ge-0/0/0; | ||
| } | ||
| } | ||
| policy-options { | ||
| policy-statement __Ansible_Core_export { | ||
| term ebgp { | ||
| from { | ||
| protocol bgp; | ||
| external; | ||
| } | ||
| then { | ||
| next-hop self; | ||
| accept; | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| [edit protocols rsvp] | ||
| interface ge-0/0/1.0 { ... } | ||
| + interface ge-0/0/2.0; | ||
| - interface ge-0/0/2.40; | ||
| [edit protocols mpls] | ||
| interface ge-0/0/1.0 { ... } | ||
| + interface ge-0/0/2.0; | ||
| - interface ge-0/0/2.40; | ||
| [edit protocols ospf area 0.0.0.0] | ||
| interface ge-0/0/1.0 { ... } | ||
| + interface ge-0/0/2.0 { | ||
| + interface-type p2p; | ||
| + metric 10; | ||
| + } | ||
| interface lo0.0 { ... } | ||
| [edit protocols ospf area 0.0.0.0] | ||
| - interface ge-0/0/2.40 { | ||
| - interface-type p2p; | ||
| - metric 10; | ||
| - } | ||
| [edit protocols ldp] | ||
| + interface ge-0/0/2.0; | ||
| - interface ge-0/0/2.40; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| [edit protocols rsvp] | ||
| + interface ge-0/0/0.0; | ||
| - interface ge-0/0/0.40; | ||
| [edit protocols mpls] | ||
| + interface ge-0/0/0.0; | ||
| - interface ge-0/0/0.40; | ||
| [edit protocols ospf area 0.0.0.0] | ||
| + interface ge-0/0/0.0 { | ||
| + interface-type p2p; | ||
| + metric 10; | ||
| + } | ||
| interface lo0.0 { ... } | ||
| [edit protocols ospf area 0.0.0.0] | ||
| - interface ge-0/0/0.40 { | ||
| - interface-type p2p; | ||
| - metric 10; | ||
| - } | ||
| [edit protocols ldp] | ||
| + interface ge-0/0/0.0; | ||
| - interface ge-0/0/0.40; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| --- | ||
| - name: Validate LLDP and Interfaces | ||
| gather_facts: no | ||
| hosts: all | ||
| tags: [ validate ] | ||
| tasks: | ||
| - name: Get BGP and LLDP output | ||
| napalm_get_facts: | ||
| hostname: "{{ ansible_host }}" | ||
| username: "{{ ansible_user }}" | ||
| dev_os: "{{ ansible_network_os }}" | ||
| optional_args: | ||
| key_file: "{{ ansible_ssh_private_key_file }}" | ||
| filter: | ||
| - lldp_neighbors | ||
| - bgp_neighbors | ||
| - interfaces_ip | ||
| - interfaces | ||
| - include_vars: "./nodes.yml" | ||
| - set_fact: node={{nodes[inventory_hostname]}} | ||
| - name: Validate core interfaces are up | ||
| assert: | ||
| that: napalm_interfaces[item.split('.')[0]].is_up == true | ||
| msg: | | ||
| Interface {{item}} on {{inventory_hostname}} is not operational | ||
| with_list: "{{node.links.keys()}}" | ||
| ignore_errors: true | ||
| - name: Validate LLDP neighbors | ||
| assert: | ||
| that: node.links[item.key].remote == napalm_lldp_neighbors[item.key.split('.')[0]][0].hostname | ||
| msg: | | ||
| Router {{inventory_hostname}} has incorrect neighbor on {{item.key}} interface | ||
| with_dict: "{{node.links}}" | ||
| ignore_errors: True | ||
| - name: Validate correct IP and subnet mask | ||
| assert: | ||
| that: | ||
| - napalm_interfaces_ip[item].ipv4.keys()[0] == node.links[item].ip | ||
| - napalm_interfaces_ip[item].ipv4.values()[0]['prefix_length'] == 24 | ||
| msg: | | ||
| Interface {{item}} on {{inventory_hostname}} has incorrect IP address | ||
| with_list: "{{node.links.keys()}}" | ||
| ignore_errors: True | ||
| - name: Validate BGP Sessions | ||
| assert: | ||
| that: | ||
| - napalm_bgp_neighbors.global.peers[item].is_up == true | ||
| msg: | | ||
| BGP neighbor {{item}} on {{inventory_hostname}} is not operational | ||
| with_list: "{{node.bgp.ibgp.peers}}" | ||
| ignore_errors: true | ||
|
|
||
| - name: Ping test | ||
| gather_facts: no | ||
| hosts: all | ||
| tags: [ ping ] | ||
| tasks: | ||
| - include_vars: "./nodes.yml" | ||
| - set_fact: node={{nodes[inventory_hostname]}} | ||
| - name: Perform ping on JunOS nodes | ||
| napalm_ping: | ||
| hostname: "{{ ansible_host }}" | ||
| username: "{{ ansible_user }}" | ||
| dev_os: "{{ ansible_network_os }}" | ||
| optional_args: | ||
| key_file: "{{ ansible_ssh_private_key_file }}" | ||
| destination: "{{nodes[item].rid}}" | ||
| with_list: "{{nodes.keys()}}" | ||
| when: ansible_network_os == 'junos' | ||
| register: ping_result | ||
| - debug: var=ping_result | ||
| - name: Validate network reachability | ||
| assert: | ||
| that: item.results.success is defined | ||
| msg: "{{item.item}} is not reachable to {{inventory_hostname}}" | ||
| with_list: "{{hostvars[inventory_hostname].ping_result.results}}" | ||
| when: ansible_network_os == 'junos' |