Skip to content

Commit

Permalink
Update to Ansible 8.4.0 and NSO OC 2.79.3
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonking3 committed Oct 4, 2023
1 parent 0c1191e commit 53c0728
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=linux/amd64 ubuntu:20.04
FROM --platform=linux/amd64 ubuntu:22.04

ARG build_date=unspecified

Expand All @@ -20,7 +20,7 @@ USER root
RUN mkdir /root/.ssh && bash -c 'echo -e "Host *\n KexAlgorithms +diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1" > /root/.ssh/config'
RUN mkdir /ansible_collections && chmod 777 /ansible_collections
RUN apt-get update && \
apt-get install -y python3.8 python3-pip sshpass git && \
apt-get install -y python3.10 python3-pip sshpass git && \
pip3 install --upgrade --no-cache-dir setuptools pip && \
echo "===> Installing PIP Requirements <===" && \
pip3 install --no-cache -r /tmp/requirements.txt && \
Expand Down
2 changes: 1 addition & 1 deletion inventory/nso.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ all:
nso_package_repos:
- name: mdd
repo: https://github.com/model-driven-devops/nso-oc-services.git
version: v2.71.0
version: v2.79.3
service_list:
- mdd
children:
Expand Down
2 changes: 1 addition & 1 deletion mdd-data/org/check-bgp-neighbor-status.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ mdd_checks:
- name: BGP VPNV4 Neighbor Status
command: 'show ip bgp vpnv4 all neighbors'
schema: 'pyats/bgp-neighbor-state.yml'
method: cli_parse
method: nso_parse
8 changes: 4 additions & 4 deletions mdd-data/org/check-site-routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ mdd_checks:
- name: Check Network-wide Routes
command: 'show ip route vrf internal_1'
schema: 'pyats/show_ip_route.yml.j2'
method: cli_parse
method: nso_parse
check_vars:
vrf: internal_1
routes:
- 172.16.0.0/24
- 192.168.1.0/24
- 192.168.2.0/24
- route: 172.16.0.0/24
- route: 192.168.1.0/24
- route: 192.168.2.0/24
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ansible==4.5.0
virl2_client==2.4.0
ansible==8.4.0
virl2_client==2.6.0
netaddr
pynetbox
jsonschema
Expand All @@ -11,6 +11,6 @@ jmespath
passlib
botocore
boto3
nso-oc==2.71.0
nso-oc==2.79.3
networkx
scipy
110 changes: 101 additions & 9 deletions schemas/pyats/show_ip_route.yml.j2
Original file line number Diff line number Diff line change
@@ -1,27 +1,119 @@
type: object
required:
- vrf
properties:
required:
- vrf
vrf:
type: object
required:
- {{ check_vars.vrf }}
properties:
required:
- {{ check_vars.vrf }}
{{ check_vars.vrf }}:
type: object
required:
- address_family
properties:
required:
- address_family
address_family:
type: object
required:
- ipv4
properties:
required:
- ipv4
ipv4:
type: object
required:
- routes
properties:
routes:
type: object
required: {{ check_vars.routes }}
required:
{% for route in check_vars.routes %}
- {{ route.route }}
{% endfor %}
properties:
{% for route in check_vars.routes %}
{{ route.route }}:
type: object
required:
- route
{% if route.active is defined and route.active %}
- active
{% endif %}
{% if route.metric is defined and route.metric %}
- metric
{% endif %}
{% if route.next_hop is defined and route.next_hop %}
- next_hop
{% endif %}
{% if route.source_protocol is defined and route.source_protocol %}
- source_protocol
{% endif %}
{% if route.next_hop is defined and route.next_hop %}
- next_hop
{% endif %}
properties:
route:
type: string
const: {{ route.route }}
{% if route.active is defined and route.active %}
active:
type: boolean
const: {{ route.active }}
{% endif %}
{% if route.metric is defined and route.metric %}
metric:
type: integer
const: {{ route.metric }}
{% endif %}
{% if route.next_hop is defined and route.next_hop %}
next_hop:
{% if route.next_hop.next_hop_list is defined and route.next_hop.next_hop_list %}
type: object
required:
- next_hop_list
properties:
next_hop_list:
type: object
required:
{% for next_hop in route.next_hop.next_hop_list %}
- "{{ next_hop.index }}"
{% endfor %}
properties:
{% for next_hop in route.next_hop.next_hop_list %}
"{{ next_hop.index }}":
type: object
required:
- index
- next_hop
{% if next_hop.outgoing_interface is defined and next_hop.outgoing_interface %}
- outgoing_interface
{% endif %}
properties:
index:
type: integer
const: {{ next_hop.index }}
next_hop:
type: string
const: {{ next_hop.next_hop }}
{% if next_hop.outgoing_interface is defined and next_hop.outgoing_interface %}
outgoing_interface:
type: string
const: {{ next_hop.outgoing_interface }}
{% endif %}
{% endfor %}
{% endif %}
{% if route.next_hop.outgoing_interface is defined and route.next_hop.outgoing_interface %}
type: object
required:
- outgoing_interface
properties:
outgoing_interface:
type: object
required:
- {{ route.next_hop.outgoing_interface }}
{% endif %}
{% endif %}
{% if route.source_protocol is defined and route.source_protocol %}
source_protocol:
type: string
const: {{ route.source_protocol }}
{% endif %}
{% endfor %}

0 comments on commit 53c0728

Please sign in to comment.