Skip to content

Commit

Permalink
Update ansible.cfg and validate.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
knewell committed Apr 20, 2018
1 parent aff1919 commit 6044f31
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ansible.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[defaults]
roles_path = /srv/ansible/roles
roles_path = /srv/nslab-ansible/roles
host_key_checking = False
library = /srv/nslab-ansible/local/lib/python2.7/site-packages/napalm_ansible/modules
action_plugins = /srv/nslab-ansible/local/lib/python2.7/site-packages/napalm_ansible/plugins/action
Expand Down
12 changes: 4 additions & 8 deletions validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,28 @@
- 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
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
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
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
msg: BGP neighbor {{item}} on {{inventory_hostname}} is not operational
with_list: "{{node.bgp.ibgp.peers}}"
ignore_errors: true

Expand Down

0 comments on commit 6044f31

Please sign in to comment.