Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: internet2/nslab-ansible
base: master
Choose a base ref
...
head repository: internet2/nslab-ansible
compare: lab
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 11 commits
  • 42 files changed
  • 1 contributor

Commits on Apr 19, 2018

  1. Add lab configs

    knewell committed Apr 19, 2018
    Copy the full SHA
    c3c7e80 View commit details

Commits on Apr 20, 2018

  1. Update core.j2

    knewell committed Apr 20, 2018
    Copy the full SHA
    4e6cb88 View commit details
  2. Update requirements.txt

    knewell committed Apr 20, 2018
    Copy the full SHA
    3ef9ab4 View commit details
  3. Update lab

    knewell committed Apr 20, 2018
    Copy the full SHA
    bfd1a63 View commit details
  4. Copy the full SHA
    3b3e640 View commit details
  5. Add validate.yml

    knewell committed Apr 20, 2018
    Copy the full SHA
    aff1919 View commit details
  6. Copy the full SHA
    6044f31 View commit details
  7. update ansible.cfg

    knewell committed Apr 20, 2018
    Copy the full SHA
    048dbfc View commit details

Commits on Aug 15, 2018

  1. Copy the full SHA
    c3075dd View commit details

Commits on Sep 17, 2018

  1. Update lab branch

    knewell committed Sep 17, 2018
    Copy the full SHA
    aaecb11 View commit details

Commits on Oct 4, 2018

  1. Update lab

    knewell committed Oct 4, 2018
    Copy the full SHA
    e9b9679 View commit details
4 changes: 4 additions & 0 deletions .gitignore
@@ -100,3 +100,7 @@ pip-selfcheck.json

# Rope project settings
.ropeproject
*.retry
*.swp

.retry
Binary file added I2_SR_configs.tgz
Binary file not shown.
1 change: 1 addition & 0 deletions NetAutomationExamples
Submodule NetAutomationExamples added at 567767
12 changes: 2 additions & 10 deletions README.md
@@ -1,6 +1,6 @@
Suggest you use Python3 virtualenv
Suggest you use Python2 and virtualenv
```
python3 -m venv .
virtualenv .
source bin/activate
```

@@ -9,11 +9,3 @@ Update pip and install requirements
pip install --upgrade pip
pip install -r requirements.txt
```

Install napalm-ansible (currently need to install from source, issues when using pip)
```
git clone https://github.com/napalm-automation/napalm-ansible.git
cd napalm-ansible
python setup.py install
```

6 changes: 3 additions & 3 deletions ansible.cfg
@@ -1,8 +1,8 @@
[defaults]
roles_path = /srv/ansible/roles
roles_path = /srv/nslab-ansible/roles
host_key_checking = False
library = /srv/ansible/lib/python3.5/site-packages/napalm_ansible-0.9.1-py3.5.egg/napalm_ansible/modules
action_plugins = /srv/ansible/lib/python3.5/site-packages/napalm_ansible-0.9.1-py3.5.egg/napalm_ansible/plugins/action
library = ./local/lib/python2.7/site-packages/napalm_ansible/modules:./lib/python2.7/site-packages/ansible/modules/
action_plugins = ./local/lib/python2.7/site-packages/napalm_ansible/plugins/action:./lib/python2.7/site-packages/ansible/plugins/actions

[persistent_connection]
command_timeout=100
29 changes: 29 additions & 0 deletions backup/ansible-veos5_config.2018-08-14@17:27:35
@@ -0,0 +1,29 @@
! Command: show running-config
! device: ansible-veos5 (vEOS, EOS-4.20.1F)
!
! boot system flash:/vEOS-lab.swi
!
transceiver qsfp default-mode 4x10G
!
hostname ansible-veos5
!
spanning-tree mode mstp
!
no aaa root
!
username admin privilege 15 role network-admin secret sha512 $6$QooVHYszFBY655A/$WnVBzmLe2LsWQ2kF01jtWff4L9xlxIfCpB0/rS7nWB70dFEoIbIYPRf1LHGg/jSGcR6VdecKvweJxry2vttCR1
username salt privilege 15 role network-admin secret sha512 $6$gNfDGxuNqAufb7SS$XuBAZwDyHEX6Bt6zgDBA0zkJLhOm.5aJ8cwy2wd21DVr9yWr.gqwYBx7NUntbvSjTlKDQBg.XsMIIYRwqU10u1
username salt sshkey ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt knewell@ubuntu
!
interface Ethernet1
!
interface Ethernet2
!
interface Management1
ip address 10.39.0.55/20
!
ip route 0.0.0.0/0 10.39.0.1
!
ip routing
!
end
29 changes: 29 additions & 0 deletions backup/ansible-veos6_config.2018-08-14@17:27:35
@@ -0,0 +1,29 @@
! Command: show running-config
! device: ansible-veos6 (vEOS, EOS-4.20.1F)
!
! boot system flash:/vEOS-lab.swi
!
transceiver qsfp default-mode 4x10G
!
hostname ansible-veos6
!
spanning-tree mode mstp
!
no aaa root
!
username admin privilege 15 role network-admin secret sha512 $6$/7bApigLDgtwdZn4$8zr7AxxO2Lj2CXoV.fFWzmjrsusPfN453qwG/y76NCT7TNokv7XAZhJtgH6m82hwO14Y3W/zqyN4pHKitK1kO1
username salt privilege 15 role network-admin secret sha512 $6$dUVSZEiQz8f5/ZTP$SMN1MWMaOLpyyUuBNjex/rVJL5WLw0SHi1MfOpdDAgPz1Fu7MMrHmJZ8.jU4kUjqC8xY.9VSp47m9MdqZl2Ck/
username salt sshkey ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt knewell@ubuntu
!
interface Ethernet1
!
interface Ethernet2
!
interface Management1
ip address 10.39.0.56/20
!
ip route 0.0.0.0/0 10.39.0.1
!
ip routing
!
end
70 changes: 70 additions & 0 deletions core-deploy.yml
@@ -0,0 +1,70 @@
---
## First Play
- hosts: localhost
name: Create per node data model
gather_facts: no
tags: [ model ]
vars_files:
- "core/{{model|default('core-model.yml')}}"
tasks:
- name: Create per-node data model from fabric data model
template: src=core/core-to-nodes.j2 dest=./nodes.yml

## Second Play
- name: Generate Configuration for all routers
gather_facts: no
# connection: local
hosts: all
tags: [ template ]
tasks:
- include_vars: "./nodes.yml"
- name: Gather facts (eos)
eos_facts:
when: ansible_network_os == 'eos'
- name: Gather facts (junos)
junos_facts:
when: ansible_network_os == 'junos'
- name: create the directory for the configuration
file: path=core_config state=directory
run_once: true
- name: Generate Configuration
template: src={{ansible_network_os}}/core.j2 dest=core_config/{{inventory_hostname}}-config.txt

## Third Play
# commit variable is used to control the play
# if commit=0 then we will not commit the changes we will only generate diff
# if commit=1 then we will commit the changes and generate diff
- name: push the configuration to the devices
gather_facts: no
# connection: local
hosts: all
tags: [ deploy ]
tasks:
- include_vars: "./nodes.yml"
- file: path=diff state=directory
run_once: true

- name: Load config (junos)
junos_config:
src: core_config/{{inventory_hostname}}-config.txt
update: override
comment: Ansible config update
when: ansible_network_os == 'junos'

- name: Load config (eos)
eos_config:
src: core_config/{{inventory_hostname}}-config.txt
when: ansible_network_os == 'eos'

# - name: load the configuration to the devices
# napalm_install_config:
# hostname: "{{ ansible_host }}"
# username: "{{ ansible_user }}"
# dev_os: "{{ ansible_network_os }}"
# optional_args:
# key_file: "{{ ansible_ssh_private_key_file }}"
# config_file: core_config/{{inventory_hostname}}-config.txt
# commit_changes: "{{commit}}"
# replace_config: "{{replace_config|default('0')}}"
# diff_file: diff/{{inventory_hostname}}-diff.txt
# when: "inventory_hostname in nodes.keys()"
114 changes: 114 additions & 0 deletions core/core-model-veos.yml
@@ -0,0 +1,114 @@
---

common:
bgp_asn: 65000

nodes:
- name: ansible-veos1
mgmt: 10.39.0.41
rid: 10.39.8.41
sid: 10
iso: 49.0001.0010.0100.1001.00

- name: ansible-veos2
mgmt: 10.39.0.42
rid: 10.39.8.42
sid: 20
iso: 49.0001.0010.0100.1002.00

- name: ansible-veos3
mgmt: 10.39.0.43
rid: 10.39.8.43
sid: 30
iso: 49.0001.0010.0100.1003.00

- name: ansible-veos4
mgmt: 10.39.0.44
rid: 10.39.8.44
sid: 40
iso: 49.0001.0010.0100.1004.00

- name: ansible-veos5
mgmt: 10.39.0.55
rid: 10.39.8.55
sid: 50
iso: 49.0001.0010.0100.1005.00
# lu: 163.253.39.165

- name: ansible-veos55
mgmt: 10.39.0.155
rid: 10.39.8.155

- name: ansible-veos6
mgmt: 10.39.0.56
rid: 10.39.8.56
sid: 60
iso: 49.0001.0010.0100.1006.00
# lu: 163.253.39.165

- name: ansible-veos66
mgmt: 10.39.0.156
rid: 10.39.8.156

links:
- {left: ansible-veos1, left_port: Ethernet1, left_ip: 172.10.12.1,
right: ansible-veos2, right_port: Ethernet1, right_ip: 172.10.12.2,
cost: 10, mpls: True, iso: True }

- {left: ansible-veos1, left_port: Ethernet2, left_ip: 172.10.13.1,
right: ansible-veos3, right_port: Ethernet1, right_ip: 172.10.13.3,
cost: 10, mpls: True, iso: True }

# - {left: ansible-veos1, left_port: Ethernet3, left_ip: 172.10.14.1,
# right: ansible-veos4, right_port: Ethernet1, right_ip: 172.10.14.4,
# cost: 10, mpls: True, iso: True }

- {left: ansible-veos1, left_port: Ethernet4, left_ip: 172.10.15.1,
right: ansible-veos5, right_port: Ethernet1, right_ip: 172.10.15.5,
cost: 10, mpls: True, iso: True }

# - {left: ansible-veos2, left_port: Ethernet2, left_ip: 172.10.23.2,
# right: ansible-veos3, right_port: Ethernet2, right_ip: 172.10.23.3,
# cost: 10, mpls: True, iso: True }

- {left: ansible-veos2, left_port: Ethernet3, left_ip: 172.10.24.2,
right: ansible-veos4, right_port: Ethernet2, right_ip: 172.10.24.4,
cost: 10, mpls: True, iso: True }

- {left: ansible-veos2, left_port: Ethernet4, left_ip: 172.10.25.2,
right: ansible-veos5, right_port: Ethernet2, right_ip: 172.10.25.5,
cost: 10, mpls: True, iso: True }

- {left: ansible-veos3, left_port: Ethernet3, left_ip: 172.10.34.3,
right: ansible-veos4, right_port: Ethernet3, right_ip: 172.10.34.4,
cost: 10, mpls: True, iso: True }

- {left: ansible-veos3, left_port: Ethernet4, left_ip: 172.10.36.3,
right: ansible-veos6, right_port: Ethernet1, right_ip: 172.10.36.6,
cost: 10, mpls: True, iso: True }

- {left: ansible-veos4, left_port: Ethernet4, left_ip: 172.10.46.4,
right: ansible-veos6, right_port: Ethernet2, right_ip: 172.10.46.6,
cost: 10, mpls: True, iso: True }

- {left: ansible-veos5, left_port: Ethernet3, left_ip: 172.10.55.5,
right: ansible-veos55, right_port: Ethernet1, right_ip: 172.10.55.55,
}

- {left: ansible-veos6, left_port: Ethernet3, left_ip: 172.10.66.6,
right: ansible-veos66, right_port: Ethernet1, right_ip: 172.10.66.66,
}

bgp:
rr: [10.39.8.41]
clients: [10.39.8.42, 10.39.8.43, 10.39.8.44]
af:
- inet
- inet-vpn

#ospf:
# area: 0
# network: p2p

#isis:
# network: p2p