Skip to content

Commit

Permalink
Updates and improvements (#99)
Browse files Browse the repository at this point in the history
* Fixes for CML lab generation

* Updated to nso-oc version 2.43.2

* Removed manual install of CML client library (getting it from pypi now)

* Updated to ansible-mdd version 1.2.5
  • Loading branch information
jasonking3 authored Jun 20, 2023
1 parent 966c4db commit 14b515a
Show file tree
Hide file tree
Showing 28 changed files with 123 additions and 474 deletions.
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,13 @@ ENV ANSIBLE_COLLECTIONS_PATH /

COPY requirements.txt /tmp/requirements.txt
COPY requirements.yml /tmp/requirements.yml
COPY files/virl2_client-2.4.0+build.2-py3-none-any.whl /tmp/virl2_client-2.4.0+build.2-py3-none-any.whl
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 && \
pip3 install --upgrade --no-cache-dir setuptools pip && \
echo "===> Installing PIP Requirements <===" && \
pip3 install /tmp/virl2_client-2.4.0+build.2-py3-none-any.whl && \
pip3 install --no-cache -r /tmp/requirements.txt && \
echo "===> Installing Ansible Collections <===" && \
rm -rf /var/lib/apt/lists/* && \
Expand Down
75 changes: 73 additions & 2 deletions files/arch4_csr_pop.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,29 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
interface GigabitEthernet1
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown
!
interface GigabitEthernet2
cdp enable
!
interface GigabitEthernet3
cdp enable
!
interface GigabitEthernet4
cdp enable
!
interface GigabitEthernet5
cdp enable
!
ip http server
ip http secure-server
ip http max-connections 2
Expand Down Expand Up @@ -97,16 +111,16 @@ nodes:
y: -250
configuration: |-
hostname hq-sw1
!I just added this
vrf definition Mgmt-intf
!
address-family ipv4
exit-address-family
!
address-family ipv6
exit-address-familyf
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
Expand All @@ -115,7 +129,9 @@ nodes:
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown

!
ip http server
ip http secure-server
Expand Down Expand Up @@ -225,6 +241,7 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
Expand All @@ -233,6 +250,7 @@ nodes:
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown
!
ip http server
Expand Down Expand Up @@ -343,6 +361,7 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
Expand All @@ -351,6 +370,7 @@ nodes:
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown
!
ip http server
Expand Down Expand Up @@ -461,15 +481,26 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
interface GigabitEthernet1
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown
!
interface GigabitEthernet2
cdp enable
!
interface GigabitEthernet3
cdp enable
!
interface GigabitEthernet4
cdp enable
!
ip http server
ip http secure-server
ip http max-connections 2
Expand Down Expand Up @@ -547,15 +578,26 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
interface GigabitEthernet1
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown
!
interface GigabitEthernet2
cdp enable
!
interface GigabitEthernet3
cdp enable
!
interface GigabitEthernet4
cdp enable
!
ip http server
ip http secure-server
ip http max-connections 2
Expand Down Expand Up @@ -633,15 +675,23 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
interface GigabitEthernet1
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown
!
interface GigabitEthernet2
cdp enable
!
interface GigabitEthernet3
cdp enable
!
ip http server
ip http secure-server
ip http max-connections 2
Expand Down Expand Up @@ -823,15 +873,23 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
interface GigabitEthernet1
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
no cdp enable
no shutdown
!
interface GigabitEthernet2
cdp enable
!
interface GigabitEthernet3
cdp enable
!
ip http server
ip http secure-server
ip http max-connections 2
Expand Down Expand Up @@ -909,6 +967,7 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
Expand All @@ -918,6 +977,7 @@ nodes:
ip address dhcp
negotiation auto
no shutdown
no cdp enable
!
ip http server
ip http secure-server
Expand Down Expand Up @@ -1310,6 +1370,7 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
Expand All @@ -1318,6 +1379,13 @@ nodes:
ip address dhcp
negotiation auto
no shutdown
no cdp enable
!
interface GigabitEthernet2
cdp enable
!
interface GigabitEthernet8
cdp enable
!
ip http server
ip http secure-server
Expand Down Expand Up @@ -1414,6 +1482,7 @@ nodes:
exit-address-family
!
username {{ ansible_user }} privilege 15 secret 0 {{ ansible_password }}
cdp run
no aaa new-model
ip domain-name mdd.cisco.com
!
Expand All @@ -1433,6 +1502,7 @@ nodes:
negotiation auto
no mop enabled
no mop sysid
no cdp enable
!
interface GigabitEthernet2
ip address 10.0.254.1 255.255.255.252
Expand All @@ -1441,6 +1511,7 @@ nodes:
negotiation auto
no mop enabled
no mop sysid
cdp enable
!
interface GigabitEthernet3
no ip address
Expand Down
39 changes: 39 additions & 0 deletions inventory/group_vars/all/cml.yml
Original file line number Diff line number Diff line change
@@ -1 +1,40 @@
cml_lab_file: "{{ lookup('env', 'PWD') }}/files/arch4_csr_pop.yaml.j2"
cml_device_template:
switch:
node_definition: iosvl2
ram: 768
tags:
- switch
type: switch
router:
node_definition: csr1000v
ram: 3072
tags:
- router
type: router
# Uncomment if setting use_cat9kv to True
l3switch:
node_definition: Cat9000v
image_definition: Cat9kv-17.12.1
ram: 18432
cpus: 4
tags:
- l3switch
type: l3switch
# Uncomment if setting use_cat9kv to False
# l3switch:
# node_definition: iosvl2
# ram: 768
# tags:
# - l3switch
# type: l3switch
ext_conn:
node_definition: external_connector
ram: 0
tags: []
# Default interface mappings for CML, uncomment to add/modify
# Note: any interfaces not handled here will be truncated when mapping physical to virtual
# cml_default_mappings:
# Loopback(\d+): Loopback\1
# Vlan(\d+): Vlan\1

40 changes: 0 additions & 40 deletions inventory/group_vars/all/ping_tests.yml

This file was deleted.

15 changes: 0 additions & 15 deletions inventory/group_vars/all/system.yml

This file was deleted.

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.35.8
version: v2.43.2
service_list:
- mdd
children:
Expand Down
4 changes: 2 additions & 2 deletions mdd-data/org/oc-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ mdd_data:
openconfig-system:port: 53 # always 53 for ios
openconfig-system:ssh-server:
openconfig-system:config:
openconfig-system-ext:absolute-timeout-minutes: 1200
# openconfig-system-ext:absolute-timeout-minutes: 1200
openconfig-system-ext:ssh-timeout: 60 # ip ssh timeout
openconfig-system:enable: true # adds line transport input ssh; must be enabled for this to work
openconfig-system:protocol-version: V2 # ip ssh version 2
openconfig-system:rate-limit: 0 # unsupported in ios
openconfig-system:session-limit: 16 # line session-limit 16
# openconfig-system:session-limit: 16 # line session-limit 16
openconfig-system:timeout: 1800 # seconds - line exec-timeout 30 0
Loading

0 comments on commit 14b515a

Please sign in to comment.