Skip to content

Latest commit

 

History

History
145 lines (100 loc) · 4.6 KB

README.md

File metadata and controls

145 lines (100 loc) · 4.6 KB

cd into this directory: pathchecker/ansible to spin up a 4 router topology as shown below:

topo

The Container tar ball used by the Vagrantfile will need to be created by a user as described here: https://xrdocs.github.io/application-hosting/tutorials/2016-07-09-pathchecker-iperf-netconf-for-ospf-path-failover/#create-the-pathchecker-lxc-tar-ball. Name it pathchecker_rootfs.tar.gz and place it in this directory before doing a vagrant up.

The steps starting with cloning the git repo are described below:

  • Clone the git repo
git clone https://github.com/ios-xr/pathchecker
  • cd into the ansible directory
cd pathchecker/ansible
  • Create the pathchecker rootfs tar ball See how to,here and place it in the ansible directory so that in the end you have:
$ pwd
<user-directory>/pathchecker/ansible
$ ls -lrt  pathchecker_rootfs.tar.gz 
-rw-r--r--  1 akshshar  staff  301221724 Oct 27 14:19 pathchecker_rootfs.tar.gz
$ 
  • Now spin up the topology by issuing a vagrant up
$ vagrant up
Bringing machine 'rtr1' up with 'virtualbox' provider...
Bringing machine 'bridge' up with 'virtualbox' provider...
Bringing machine 'rtr2' up with 'virtualbox' provider...
Bringing machine 'devbox' up with 'virtualbox' provider...
==> rtr1: Importing base box 'IOS-XRv'...
#########  snip output #############
  • As the topology comes up, the public rsa key from the devbox (Ansible Server) will be automatically added to the ~/.ssh/authorized_keys file in each of the routers to facilitate the setup for Ansible itself.

  • Finally, once the devices are up, jump into the devbox and setup your ansible_hosts file to point to the ports that Vagrant launched for you:

$ vagrant ssh devbox
Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 3.13.0-95-generic x86_64)

 * Documentation:  https://help.ubuntu.com/

  System information as of Thu Oct 27 21:36:49 UTC 2016

  System load:  0.91              Processes:           82
  Usage of /:   3.5% of 39.34GB   Users logged in:     0
  Memory usage: 6%                IP address for eth0: 10.0.2.15
  Swap usage:   0%

  Graph this data and manage this system at:
    https://landscape.canonical.com/

  Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud

0 packages can be updated.
0 updates are security updates.

New release '16.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.


vagrant@vagrant-ubuntu-trusty-64:~$ 
vagrant@vagrant-ubuntu-trusty-64:~$ 
vagrant@vagrant-ubuntu-trusty-64:~$ 
vagrant@vagrant-ubuntu-trusty-64:~$ cd iosxr-ansible/remote/
vagrant@vagrant-ubuntu-trusty-64:~/iosxr-ansible/remote$ 
  • Use device_port_list.json that is automatically generated by the Vagrantfile for you to determine the ports on your laptop that gets used for port 57722 of each router. For example, for rtr1 below, the port for 57722 on the laptop is 2222.
vagrant@vagrant-ubuntu-trusty-64:~/iosxr-ansible/remote$ cat /vagrant/device_port_list.json 
{
"rtr1":{
"22":"2223",
"57722":"2222",
"58822":"58822"
},
"bridge":{
"22":"2200"
},
"rtr2":{
"22":"2202",
"57722":"2201"
},
"devbox":{
"22":"2203"
}
}
vagrant@vagrant-ubuntu-trusty-64:~
  • Now edit the ansible_hosts file to reflect the correct ports as shown below:
vagrant@vagrant-ubuntu-trusty-64:~/iosxr-ansible/remote$ cat ansible_hosts 
[head-end]
rtr1 ansible_ssh_user="vagrant" ansible_ssh_host=10.0.2.2 ansible_ssh_port=2222

[head-end:vars]
pathchecker_port="58822"

[tail-end]
rtr2 ansible_ssh_user="vagrant" ansible_ssh_host=10.0.2.2 ansible_ssh_port=2201

[pathchecker_containers]
ubuntu_rtr1 ospf_process="apphost" reference_interface="GigabitEthernet0/0/0/0" iperf_server="2.2.2.2" jitter_threshold="4" pktloss_threshold="6" iperf_monitoring_interval="10" ansible_become_pass="ubuntu" ansible_ssh_user="ubuntu" ansible_ssh_pass="ubuntu" ansible_ssh_host=10.0.2.2 ansible_ssh_port=58822

vagrant@vagrant-ubuntu-trusty-64:~/iosxr-ansible/remote$ 

  • Now you're ready to launch the ansible-playbook. Run eline.yml to set everything up for you.
vagrant@vagrant-ubuntu-trusty-64:~/iosxr-ansible/remote$ ansible-playbook playbooks/eline.yml 

PLAY [head-end] ****************************************************************

TASK [Copy Config file to XR] **************************************************
changed: [rtr1]

TASK [Copy Config file to XR] **************************************************
changed: [rtr1]