[WARNING]: Could not match supplied host pattern, ignoring: unprovisioned [WARNING]: Found variable using reserved name: hosts PLAY [Deploy initial device configuration] ************************************* TASK [Set variables that cannot be set with VARS] ****************************** ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s2] ok: [s1] TASK [Find device readiness script] ******************************************** ok: [h1] ok: [h2] ok: [h4] ok: [h3] ok: [s2] ok: [s1] TASK [Wait for device to become ready] ***************************************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] included: /home/pipi/netlab_gh/netsim/ansible/tasks/readiness-check/eos-clab.yml for s2 included: /home/pipi/netlab_gh/netsim/ansible/tasks/readiness-check/routeros7.yml for s1 TASK [Wait for cEOS SSH daemon to start] *************************************** ok: [s2] TASK [Execute local ssh command to check router readiness] ********************* skipping: [s1] TASK [Normalize config on bridge-like devices] ********************************* included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for s2, h1, h2, h3, h4, s1 TASK [Figure out whether to deploy the module normalize on current device] ***** ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s2] ok: [s1] TASK [Find configuration template for normalize] ******************************* ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s2] ok: [s1] TASK [fail] ******************************************************************** skipping: [s2] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] skipping: [s1] TASK [Find configuration deployment deploy_script for normalize] *************** ok: [h1] ok: [h2] ok: [h4] ok: [h3] ok: [s2] ok: [s1] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] skipping: [s1] ok: [s2] => msg: |- normalize configuration for s2 ========================================= ! interface Ethernet1 shutdown mac-address 52dc.cafe.0601 ! interface Ethernet2 shutdown mac-address 52dc.cafe.0602 ! interface Ethernet3 shutdown mac-address 52dc.cafe.0603 TASK [Deploy normalize configuration] ****************************************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] skipping: [s1] included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/eos.yml for s2 TASK [eos_config: deploying normalize from /home/pipi/netlab_gh/netsim/ansible/templates/normalize/eos.j2] *** [WARNING]: To ensure idempotency and correct diff the input configuration lines should be similar to how they appear if present in the running configuration on device including the indentation changed: [s2] TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for s2, h1, h2, h3, h4, s1 TASK [Figure out whether to deploy the module initial on current device] ******* ok: [h1] ok: [h3] ok: [h2] ok: [h4] ok: [s2] ok: [s1] TASK [Find configuration template for initial] ********************************* ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s2] ok: [s1] TASK [fail] ******************************************************************** skipping: [s2] skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] skipping: [s1] TASK [Find configuration deployment deploy_script for initial] ***************** ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s2] ok: [s1] TASK [Print deployed configuration when running in verbose mode] *************** ok: [h1] => msg: |- initial configuration for h1 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Send ARP requests from a sane source IP address sysctl -w net.ipv4.conf.all.arp_announce=2 # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.0.1/24 dev eth1 2>/dev/null set -e ip addr add 172.16.0.1/24 dev eth1 sysctl -w net.ipv6.conf.eth1.disable_ipv6=1 ip link set dev eth1 mtu 1500 ok: [h2] => msg: |- initial configuration for h2 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Send ARP requests from a sane source IP address sysctl -w net.ipv4.conf.all.arp_announce=2 # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.0.2/24 dev eth1 2>/dev/null set -e ip addr add 172.16.0.2/24 dev eth1 sysctl -w net.ipv6.conf.eth1.disable_ipv6=1 ip link set dev eth1 mtu 1500 ok: [h3] => msg: |- initial configuration for h3 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Send ARP requests from a sane source IP address sysctl -w net.ipv4.conf.all.arp_announce=2 # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.1.3/24 dev eth1 2>/dev/null set -e ip addr add 172.16.1.3/24 dev eth1 sysctl -w net.ipv6.conf.eth1.disable_ipv6=1 ip link set dev eth1 mtu 1500 ok: [h4] => msg: |- initial configuration for h4 ========================================= #!/bin/bash # # This script contains the 'ip' commands needed to set up container # interfaces and route table. It's executed within the container # network namespace on the container host. # # /etc/hosts file is generated as a clab bind. # set -e ### One-Shot configuration (non-Ubuntu VM or container) # # Send ARP requests from a sane source IP address sysctl -w net.ipv4.conf.all.arp_announce=2 # # Disable IPv4 and IPv6 forwarding # sysctl -w net.ipv4.ip_forward=0 sysctl -w net.ipv6.conf.all.forwarding=0 # # Interface addressing, create any bond devices # ip link set dev eth1 up set +e ip addr del 172.16.1.4/24 dev eth1 2>/dev/null set -e ip addr add 172.16.1.4/24 dev eth1 sysctl -w net.ipv6.conf.eth1.disable_ipv6=1 ip link set dev eth1 mtu 1500 ok: [s1] => msg: |- initial configuration for s1 ========================================= /system identity set name="s1" /interface bridge add name=loopback protocol-mode=none /ip address add interface=loopback address=10.0.0.5/32 /interface/bridge/add name=switch vlan-filtering=yes comment="Global Switch Bridge" /interface/vlan/add name=vlan701 vlan-id=701 interface=switch /interface/vlan/add name=vlan700 vlan-id=700 interface=switch /interface ethernet set comment="s1 -> s2" ether2 /interface ethernet set comment="[Access VLAN red] s1 -> h1" ether3 /interface ethernet set comment="[Access VLAN blue] s1 -> h3" ether4 /interface ethernet set comment="VLAN red (700) -> [h1,s2,h2]" vlan700 /ip address add interface=vlan700 address=172.16.0.5/24 /ip address set [find where interface=vlan700] comment="VLAN red (700) -> [h1,s2,h2]" /interface ethernet set comment="VLAN blue (701) -> [h3,s2,h4]" vlan701 /ip address add interface=vlan701 address=172.16.1.5/24 /ip address set [find where interface=vlan701] comment="VLAN blue (701) -> [h3,s2,h4]" /ip neighbor discovery-settings set discover-interface-list=all ok: [s2] => msg: |- initial configuration for s2 ========================================= hostname s2 ! logging monitor debugging aaa authorization exec default local ! lldp run ip routing no ipv6 unicast-routing ! ! ip host h1 172.16.0.1 ip host h2 172.16.0.2 ip host h3 172.16.1.3 ip host h4 172.16.1.4 ip host s1 10.0.0.5 172.16.0.5 172.16.1.5 ! interface Management0 no lldp transmit no lldp receive ! interface Loopback0 ip address 10.0.0.6/32 ! interface Ethernet1 no switchport description s2 -> s1 ! mac-address 52dc.cafe.0601 no shutdown ! interface Ethernet2 no switchport description [Access VLAN red] s2 -> h2 ! mac-address 52dc.cafe.0602 no shutdown ! interface Ethernet3 no switchport description [Access VLAN blue] s2 -> h4 ! mac-address 52dc.cafe.0603 no shutdown ! interface Vlan700 description VLAN red (700) -> [h1,s1,h2] ! interface Vlan701 description VLAN blue (701) -> [h3,s1,h4] ! TASK [Deploy initial configuration] ******************************************** included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/eos.yml for s2 included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/linux-clab.yml for h1, h2, h3, h4 included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/routeros7.yml for s1 TASK [eos_config: deploying initial from /home/pipi/netlab_gh/netsim/ansible/templates/initial/eos.j2] *** changed: [s2] TASK [Define script filename and determine whether to execute in netns] ******** ok: [h1] ok: [h2] ok: [h3] ok: [h4] TASK [Create a temporary file for the rendered script] ************************* changed: [h1 -> localhost] changed: [h4 -> localhost] changed: [h3 -> localhost] changed: [h2 -> localhost] TASK [Create container setup script from /home/pipi/netlab_gh/netsim/ansible/templates/initial/linux-clab.j2] *** changed: [h2 -> localhost] changed: [h3 -> localhost] changed: [h4 -> localhost] changed: [h1 -> localhost] TASK [Copy script into running container at /tmp/config-h1_initial.sh] ********* skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Execute /tmp/config-h1_initial.sh to deploy initial config based on /home/pipi/netlab_gh/netsim/ansible/templates/initial/linux-clab.j2] *** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Container configuration for initial based on /home/pipi/netlab_gh/netsim/ansible/templates/initial/linux-clab.j2 executed in netns] *** changed: [h4 -> localhost] changed: [h1 -> localhost] changed: [h3 -> localhost] changed: [h2 -> localhost] TASK [Remove temporary file /tmp/h1_initial-q93w400p.sh] *********************** changed: [h1 -> localhost] changed: [h3 -> localhost] changed: [h4 -> localhost] changed: [h2 -> localhost] TASK [load initial from /home/pipi/netlab_gh/netsim/ansible/templates/initial/routeros7.j2] *** ok: [s1] TASK [Run commands on CHR] ***************************************************** changed: [s1] PLAY [Deploy module-specific configurations] *********************************** TASK [Set variables that cannot be set with VARS] ****************************** ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s1] ok: [s2] TASK [Deploy individual configuration modules] ********************************* included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for h1, h2, h3, h4, s1, s2 => (item=vlan) included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-module.yml for h1, h2, h3, h4, s1, s2 => (item=routing) TASK [Figure out whether to deploy the module vlan on current device] ********** ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s1] ok: [s2] TASK [Find configuration template for vlan] ************************************ skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] ok: [s1] ok: [s2] TASK [fail] ******************************************************************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] skipping: [s1] skipping: [s2] TASK [Find configuration deployment deploy_script for vlan] ******************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] ok: [s1] ok: [s2] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] ok: [s1] => msg: |- vlan configuration for s1 ========================================= /interface/bridge/vlan add bridge=switch vlan-ids=701 tagged=switch /interface/bridge/vlan add bridge=switch vlan-ids=700 tagged=switch /interface/bridge/port add bridge=switch interface=ether2 /interface/bridge/vlan set tagged=([get value-name=tagged [find vlan-ids=700]],"ether2") [find vlan-ids=700] /interface/bridge/vlan set tagged=([get value-name=tagged [find vlan-ids=701]],"ether2") [find vlan-ids=701] /interface/bridge/port add bridge=switch interface=ether3 pvid=700 /interface/bridge/vlan set untagged=([get value-name=untagged [find vlan-ids=700]],"ether3") [find vlan-ids=700] /interface/bridge/port add bridge=switch interface=ether4 pvid=701 /interface/bridge/vlan set untagged=([get value-name=untagged [find vlan-ids=701]],"ether4") [find vlan-ids=701] ok: [s2] => msg: |- vlan configuration for s2 ========================================= vlan 701 name blue ! vlan 700 name red ! ! interface Ethernet1 switchport switchport mode trunk switchport trunk allowed vlan 700,701 switchport trunk native vlan tag ! interface Ethernet2 switchport switchport access vlan 700 ! interface Ethernet3 switchport switchport access vlan 701 ! interface Vlan700 ! interface Vlan701 TASK [Deploy vlan configuration] *********************************************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/routeros7.yml for s1 included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/eos.yml for s2 TASK [load vlan from /home/pipi/netlab_gh/netsim/ansible/templates/vlan/routeros7.j2] *** ok: [s1] TASK [Run commands on CHR] ***************************************************** changed: [s1] TASK [eos_config: deploying vlan from /home/pipi/netlab_gh/netsim/ansible/templates/vlan/eos.j2] *** changed: [s2] TASK [Figure out whether to deploy the module routing on current device] ******* ok: [h1] ok: [h2] ok: [h3] ok: [h4] ok: [s1] ok: [s2] TASK [Find configuration template for routing] ********************************* ok: [h1] ok: [h2] skipping: [s1] ok: [h3] skipping: [s2] ok: [h4] TASK [fail] ******************************************************************** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] skipping: [s1] skipping: [s2] TASK [Find configuration deployment deploy_script for routing] ***************** skipping: [s1] ok: [h1] skipping: [s2] ok: [h2] ok: [h3] ok: [h4] TASK [Print deployed configuration when running in verbose mode] *************** skipping: [s1] ok: [h1] => msg: |- routing configuration for h1 ========================================= #!/bin/bash # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.0.5 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.0.5 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.0.5 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.0.5 dev eth1 protocol static # # Print the final routing table ip route skipping: [s2] ok: [h2] => msg: |- routing configuration for h2 ========================================= #!/bin/bash # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.0.5 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.0.5 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.0.5 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.0.5 dev eth1 protocol static # # Print the final routing table ip route ok: [h3] => msg: |- routing configuration for h3 ========================================= #!/bin/bash # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.1.5 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.1.5 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.1.5 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.1.5 dev eth1 protocol static # # Print the final routing table ip route ok: [h4] => msg: |- routing configuration for h4 ========================================= #!/bin/bash # # Add static routes (usually IPv4 routes pointing to the first usable gateway) # # echo Removing existing IPv4 routes while ip route del 172.16.0.0/16 2>/dev/null; do : ; done while ip route del 10.0.0.0/24 2>/dev/null; do : ; done while ip route del 10.1.0.0/16 2>/dev/null; do : ; done while ip route del 10.2.0.0/24 2>/dev/null; do : ; done # # # echo Adding direct static routes ip route add 172.16.0.0/16 via 172.16.1.5 dev eth1 protocol static ip route add 10.0.0.0/24 via 172.16.1.5 dev eth1 protocol static ip route add 10.1.0.0/16 via 172.16.1.5 dev eth1 protocol static ip route add 10.2.0.0/24 via 172.16.1.5 dev eth1 protocol static # # Print the final routing table ip route TASK [Deploy routing configuration] ******************************************** skipping: [s1] skipping: [s2] included: /home/pipi/netlab_gh/netsim/ansible/tasks/deploy-config/linux-clab.yml for h1, h2, h3, h4 TASK [Define script filename and determine whether to execute in netns] ******** ok: [h1] ok: [h2] ok: [h3] ok: [h4] TASK [Create a temporary file for the rendered script] ************************* changed: [h1 -> localhost] changed: [h2 -> localhost] changed: [h3 -> localhost] changed: [h4 -> localhost] TASK [Create container setup script from /home/pipi/netlab_gh/netsim/ansible/templates/routing/linux-clab.j2] *** changed: [h1 -> localhost] changed: [h3 -> localhost] changed: [h2 -> localhost] changed: [h4 -> localhost] TASK [Copy script into running container at /tmp/config-h1_routing.sh] ********* skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Execute /tmp/config-h1_routing.sh to deploy routing config based on /home/pipi/netlab_gh/netsim/ansible/templates/routing/linux-clab.j2] *** skipping: [h1] skipping: [h2] skipping: [h3] skipping: [h4] TASK [Container configuration for routing based on /home/pipi/netlab_gh/netsim/ansible/templates/routing/linux-clab.j2 executed in netns] *** changed: [h1 -> localhost] changed: [h2 -> localhost] changed: [h3 -> localhost] changed: [h4 -> localhost] TASK [Remove temporary file /tmp/h1_routing-5v3olfvr.sh] *********************** changed: [h1 -> localhost] changed: [h2 -> localhost] changed: [h3 -> localhost] changed: [h4 -> localhost] PLAY [Deploy custom deployment templates] ************************************** skipping: no hosts matched PLAY RECAP ********************************************************************* h1 : ok=31 changed=8 unreachable=0 failed=0 skipped=15 rescued=0 ignored=0 h2 : ok=31 changed=8 unreachable=0 failed=0 skipped=15 rescued=0 ignored=0 h3 : ok=31 changed=8 unreachable=0 failed=0 skipped=15 rescued=0 ignored=0 h4 : ok=31 changed=8 unreachable=0 failed=0 skipped=15 rescued=0 ignored=0 s1 : ok=26 changed=2 unreachable=0 failed=0 skipped=11 rescued=0 ignored=0 s2 : ok=28 changed=3 unreachable=0 failed=0 skipped=8 rescued=0 ignored=0 The devices under test are layer-3 switches bridging between ports in the same VLAN and routing across VLANs * All hosts should be able to ping each other and switch interfaces in the same VLAN * Hosts should be able to ping loopback address of the adjacent switch (static routes point to nearest router) Please note it might take a while for the lab to work due to STP learning phase