Creating Device configuration snippets [CREATED] dut: initial [CREATED] p1: normalize,initial,routing [CREATED] t_1300: initial,routing [CREATED] t_1400: initial,routing Checking Are lab devices ready to be configured? [INFO] Checking SSH server(s) on p1 Config Normalizing device configurations [INFO] Executing normalize configuration for node p1 Config Deploying device configurations [INFO] Executing initial configuration for node p1 [INFO] Executing routing configuration for node p1 [INFO] Starting Ansible playbook to deploy the rest of the configurations [WARNING]: Found variable using reserved name: hosts PLAY [Deploy initial device configuration] ************************************* TASK [Set variables that cannot be set with VARS] ****************************** ok: [t_1300] ok: [t_1400] ok: [dut] TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for t_1300, t_1400, dut TASK [Figure out whether to deploy the module initial on current device] ******* ok: [t_1300] ok: [t_1400] ok: [dut] TASK [Find configuration template for initial] ********************************* ok: [t_1300] ok: [t_1400] ok: [dut] TASK [fail] ******************************************************************** skipping: [t_1300] skipping: [t_1400] skipping: [dut] TASK [Find configuration deployment deploy_script for initial] ***************** ok: [t_1300] ok: [t_1400] ok: [dut] TASK [Print deployed configuration when running in verbose mode] *************** ok: [t_1300] => { "msg": "initial configuration for t_1300\n=========================================\n#!/bin/bash\n#\nset -e\n#\n# Create bash profile script\n#\ncat <<'SCRIPT' >/root/.bash_profile\n#!/bin/bash\n#\nexport PS1=\"\\h(bash)$ \"\nSCRIPT\nhostname t-1300\n#\n# Build hosts file\n#\n#\ncat <<'SCRIPT' >/tmp/hosts\n#\n# Created by netlab initial\n#\n10.0.0.1 dut\n2001:db8:0:1::1 dut\n172.16.0.1 vio1.dut\n2001:db8:1::1 vio1.dut\n172.16.1.1 vio2.dut\n2001:db8:1:1::1 vio2.dut\n172.16.2.1 vio3.dut\n2001:db8:1:2::1 vio3.dut\n10.0.0.2 p1\n2001:db8:0:2::1 p1\n172.16.0.2 Ethernet1.p1\n2001:db8:1::2 Ethernet1.p1\n172.16.2.3 t-1300 eth1.t_1300\n2001:db8:1:2::3 t-1300 eth1.t_1300\n172.16.1.4 t-1400 eth1.t_1400\n2001:db8:1:1::4 t-1400 eth1.t_1400\nSCRIPT\ngrep \"Created by netlab\" /etc/hosts || uniq /tmp/hosts >>/etc/hosts\n# It seems on the Vagrant box for ubuntu 20.04, DNS Servers are hardcoded as 4.2.2.1 & Co.\n# This is annoying on a network with filtered DNS.\n# DNSMasq server used for giving out DHCP addresses on the management network is able to act as a DNS Server.\n# Let's use that.\n#\n# (Overwrite netplan config to remove DNS stuff)\necho -n 'Starting initial config ' && date\ncat <<'SCRIPT' >/etc/netplan/01-netcfg.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth0:\n dhcp4: true\n dhcp6: false\n optional: true\nSCRIPT\nnetplan apply\n\n# (Overwrite resolved config to remove DNS stuff)\ncat <<'SCRIPT' > /etc/systemd/resolved.conf \n[Resolve]\nDNS=\nFallbackDNS=\nDomains=\nDNSOverTLS=no\nCache=yes\nDNSStubListener=yes\nSCRIPT\n\nsystemctl restart systemd-resolved\n\n# Set persistent hostname\nhostnamectl set-hostname t_1300\n\nNEED_APT_UPDATE=YES\n\n# Loopback addressing\n\n# Interface addressing and bonds, including any static routes\ncat <<'SCRIPT' > /etc/netplan/03-eth-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n addresses:\n - 172.16.2.3/24\n - 2001:db8:1:2::3/64\nSCRIPT\n\n# Disable auto-negotiation on Ethernet interfaces, needed to make LACP work correctly\ncat <<'SCRIPT' > /etc/systemd/network/98-eth.link\n\n[Match]\nOriginalName=eth*\n\n[Link]\nBitsPerSecond=1G\nAutoNegotiation=no\nDuplex=full\nSCRIPT\n\nchmod 400 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnetplan apply\n\n#\n# Sysctl settings: IPv4/IPv6 forwarding, IPv6 LLA\n# Do this after 'netplan apply', e.g. bond devices won't exist before that\n#\ncat <<'SCRIPT' > /etc/sysctl.d/10-netsim.conf\nnet.ipv4.conf.all.arp_announce=2\nnet.ipv4.ip_forward=0\nnet.ipv6.conf.all.forwarding=0\n\nnet.ipv6.conf.eth1.disable_ipv6=0\n\nSCRIPT\nsysctl -p /etc/sysctl.d/10-netsim.conf\n" } ok: [t_1400] => { "msg": "initial configuration for t_1400\n=========================================\n#!/bin/bash\n#\nset -e\n#\n# Create bash profile script\n#\ncat <<'SCRIPT' >/root/.bash_profile\n#!/bin/bash\n#\nexport PS1=\"\\h(bash)$ \"\nSCRIPT\nhostname t-1400\n#\n# Build hosts file\n#\n#\ncat <<'SCRIPT' >/tmp/hosts\n#\n# Created by netlab initial\n#\n10.0.0.1 dut\n2001:db8:0:1::1 dut\n172.16.0.1 vio1.dut\n2001:db8:1::1 vio1.dut\n172.16.1.1 vio2.dut\n2001:db8:1:1::1 vio2.dut\n172.16.2.1 vio3.dut\n2001:db8:1:2::1 vio3.dut\n10.0.0.2 p1\n2001:db8:0:2::1 p1\n172.16.0.2 Ethernet1.p1\n2001:db8:1::2 Ethernet1.p1\n172.16.2.3 t-1300 eth1.t_1300\n2001:db8:1:2::3 t-1300 eth1.t_1300\n172.16.1.4 t-1400 eth1.t_1400\n2001:db8:1:1::4 t-1400 eth1.t_1400\nSCRIPT\ngrep \"Created by netlab\" /etc/hosts || uniq /tmp/hosts >>/etc/hosts\n# It seems on the Vagrant box for ubuntu 20.04, DNS Servers are hardcoded as 4.2.2.1 & Co.\n# This is annoying on a network with filtered DNS.\n# DNSMasq server used for giving out DHCP addresses on the management network is able to act as a DNS Server.\n# Let's use that.\n#\n# (Overwrite netplan config to remove DNS stuff)\necho -n 'Starting initial config ' && date\ncat <<'SCRIPT' >/etc/netplan/01-netcfg.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth0:\n dhcp4: true\n dhcp6: false\n optional: true\nSCRIPT\nnetplan apply\n\n# (Overwrite resolved config to remove DNS stuff)\ncat <<'SCRIPT' > /etc/systemd/resolved.conf \n[Resolve]\nDNS=\nFallbackDNS=\nDomains=\nDNSOverTLS=no\nCache=yes\nDNSStubListener=yes\nSCRIPT\n\nsystemctl restart systemd-resolved\n\n# Set persistent hostname\nhostnamectl set-hostname t_1400\n\nNEED_APT_UPDATE=YES\n\n# Loopback addressing\n\n# Interface addressing and bonds, including any static routes\ncat <<'SCRIPT' > /etc/netplan/03-eth-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n addresses:\n - 172.16.1.4/24\n - 2001:db8:1:1::4/64\nSCRIPT\n\n# Disable auto-negotiation on Ethernet interfaces, needed to make LACP work correctly\ncat <<'SCRIPT' > /etc/systemd/network/98-eth.link\n\n[Match]\nOriginalName=eth*\n\n[Link]\nBitsPerSecond=1G\nAutoNegotiation=no\nDuplex=full\nSCRIPT\n\nchmod 400 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnetplan apply\n\n#\n# Sysctl settings: IPv4/IPv6 forwarding, IPv6 LLA\n# Do this after 'netplan apply', e.g. bond devices won't exist before that\n#\ncat <<'SCRIPT' > /etc/sysctl.d/10-netsim.conf\nnet.ipv4.conf.all.arp_announce=2\nnet.ipv4.ip_forward=0\nnet.ipv6.conf.all.forwarding=0\n\nnet.ipv6.conf.eth1.disable_ipv6=0\n\nSCRIPT\nsysctl -p /etc/sysctl.d/10-netsim.conf\n" } ok: [dut] => { "msg": "initial configuration for dut\n=========================================\n#!/bin/sh\n\nset -e # Exit immediately when any command fails\nset -x # Track commands for troubleshooting\n\nhostname dut\n#\n# Build hosts file\n#\n#\ncat <<'SCRIPT' >/tmp/hosts\n#\n# Created by netlab initial\n#\n10.0.0.1 dut\n2001:db8:0:1::1 dut\n172.16.0.1 vio1.dut\n2001:db8:1::1 vio1.dut\n172.16.1.1 vio2.dut\n2001:db8:1:1::1 vio2.dut\n172.16.2.1 vio3.dut\n2001:db8:1:2::1 vio3.dut\n10.0.0.2 p1\n2001:db8:0:2::1 p1\n172.16.0.2 Ethernet1.p1\n2001:db8:1::2 Ethernet1.p1\n172.16.2.3 t-1300 eth1.t_1300\n2001:db8:1:2::3 t-1300 eth1.t_1300\n172.16.1.4 t-1400 eth1.t_1400\n2001:db8:1:1::4 t-1400 eth1.t_1400\nSCRIPT\ngrep \"Created by netlab\" /etc/hosts || uniq /tmp/hosts >>/etc/hosts\n\n#\n# Enable forwarding\n#\nsysctl net.inet.ip.forwarding=1\nsysctl net.inet6.ip6.forwarding=1\necho -n > /etc/rad.conf\n\n#\n# Interface configuration\n#\nifconfig lo0 inet 10.0.0.1/32 alias\necho interface lo0 >> /etc/rad.conf\nifconfig lo0 inet6 2001:db8:0:1::1/64\nifconfig lo0 up\n\n\n\n\nifconfig vio1 -inet\nifconfig vio1 -inet6\nifconfig vio1 inet 172.16.0.1/24 \necho interface vio1 >> /etc/rad.conf\nifconfig vio1 inet6 2001:db8:1::1/64\nifconfig vio1 mtu 1500\nifconfig vio1 description \"dut -> p1\"\nifconfig vio1 up\n\nifconfig vio2 -inet\nifconfig vio2 -inet6\nifconfig vio2 inet 172.16.1.1/24 \necho interface vio2 >> /etc/rad.conf\nifconfig vio2 inet6 2001:db8:1:1::1/64\nifconfig vio2 mtu 1400\nifconfig vio2 description \"dut -> t_1400\"\nifconfig vio2 up\n\nifconfig vio3 -inet\nifconfig vio3 -inet6\nifconfig vio3 inet 172.16.2.1/24 \necho interface vio3 >> /etc/rad.conf\nifconfig vio3 inet6 2001:db8:1:2::1/64\nifconfig vio3 mtu 1300\nifconfig vio3 description \"dut -> t_1300\"\nifconfig vio3 up\n\n\n#\n# (re-)start RA daemon\n#\npkill -q rad || true\nrad\n" } TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/linux.yml for t_1300, t_1400 included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/openbsd.yml for dut TASK [template] **************************************************************** changed: [t_1400] changed: [t_1300] TASK [Execute /tmp/config.sh to deploy initial config from /work/netlab_cicd/node_files/t_1300/initial] *** changed: [t_1300] changed: [t_1400] TASK [template] **************************************************************** changed: [dut] TASK [Execute /tmp/config.sh to deploy initial config from /work/netlab_cicd/node_files/dut/initial] *** changed: [dut] PLAY [Deploy module-specific configurations] *********************************** TASK [Set variables that cannot be set with VARS] ****************************** ok: [t_1300] ok: [t_1400] TASK [Deploy individual configuration modules] ********************************* included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for t_1300, t_1400 => (item=routing) TASK [Figure out whether to deploy the module routing on current device] ******* ok: [t_1300] ok: [t_1400] TASK [Find configuration template for routing] ********************************* ok: [t_1300] ok: [t_1400] TASK [fail] ******************************************************************** skipping: [t_1300] skipping: [t_1400] TASK [Find configuration deployment deploy_script for routing] ***************** ok: [t_1300] ok: [t_1400] TASK [Print deployed configuration when running in verbose mode] *************** ok: [t_1300] => { "msg": "routing configuration for t_1300\n=========================================\n#!/bin/bash\n# netplan static route configuration\n#\ncat <<'SCRIPT' > /etc/netplan/11-routes-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n routes:\n - to: 172.16.0.0/16\n via: 172.16.2.1\n - to: 10.0.0.0/24\n via: 172.16.2.1\n - to: 10.1.0.0/16\n via: 172.16.2.1\n - to: 10.2.0.0/24\n via: 172.16.2.1\nSCRIPT\nchmod 600 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnohup netplan apply &\n" } ok: [t_1400] => { "msg": "routing configuration for t_1400\n=========================================\n#!/bin/bash\n# netplan static route configuration\n#\ncat <<'SCRIPT' > /etc/netplan/11-routes-eth1.yaml\nnetwork:\n version: 2\n renderer: networkd\n ethernets:\n eth1:\n routes:\n - to: 172.16.0.0/16\n via: 172.16.1.1\n - to: 10.0.0.0/24\n via: 172.16.1.1\n - to: 10.1.0.0/16\n via: 172.16.1.1\n - to: 10.2.0.0/24\n via: 172.16.1.1\nSCRIPT\nchmod 600 /etc/netplan/*\n\necho -n 'Starting netplan generate ' && date\nnetplan generate\necho -n 'Starting netplan apply ' && date\nnohup netplan apply &\n" } TASK [Deploy routing configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/linux.yml for t_1300, t_1400 TASK [template] **************************************************************** changed: [t_1300] changed: [t_1400] TASK [Execute /tmp/config.sh to deploy routing config from /work/netlab_cicd/node_files/t_1300/routing] *** changed: [t_1300] changed: [t_1400] PLAY [Deploy custom deployment templates] ************************************** skipping: no hosts matched PLAY RECAP ********************************************************************* dut : ok=9 changed=2 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 t_1300 : ok=18 changed=4 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0 t_1400 : ok=18 changed=4 unreachable=0 failed=0 skipped=2 rescued=0 ignored=0 Results of configuration script deployments ================================================================================ p1 Script: normalize,initial,routing This scenario tests MTU configuration and path MTU discovery (generation of ICMP unreachables)