diff --git a/core-deploy.yml b/deploy-topo.yml similarity index 91% rename from core-deploy.yml rename to deploy-topo.yml index fd0abd0..959ef82 100644 --- a/core-deploy.yml +++ b/deploy-topo.yml @@ -1,14 +1,10 @@ --- -## 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 + roles: + - deploy-topo.yml ## Second Play - name: Generate Configuration for all routers diff --git a/roles/deploy-dhcpd/tasks/dhcpd_deploy_iso.yml b/dhcpd_deploy_iso.yml similarity index 100% rename from roles/deploy-dhcpd/tasks/dhcpd_deploy_iso.yml rename to dhcpd_deploy_iso.yml diff --git a/roles/deploy-dhcpd/tasks/dhcpd_server.yml b/dhcpd_server.yml similarity index 100% rename from roles/deploy-dhcpd/tasks/dhcpd_server.yml rename to dhcpd_server.yml diff --git a/roles/deploy-topo/defaults/nodes.yml b/files/nodes.yml similarity index 100% rename from roles/deploy-topo/defaults/nodes.yml rename to files/nodes.yml diff --git a/roles/deploy-topo/files/ova/ubuntu-bionic-18.04-cloudimg.mf b/files/ova/ubuntu-bionic-18.04-cloudimg.mf similarity index 100% rename from roles/deploy-topo/files/ova/ubuntu-bionic-18.04-cloudimg.mf rename to files/ova/ubuntu-bionic-18.04-cloudimg.mf diff --git a/roles/deploy-topo/files/ova/ubuntu-bionic-18.04-cloudimg.ovf b/files/ova/ubuntu-bionic-18.04-cloudimg.ovf similarity index 100% rename from roles/deploy-topo/files/ova/ubuntu-bionic-18.04-cloudimg.ovf rename to files/ova/ubuntu-bionic-18.04-cloudimg.ovf diff --git a/files/srlab-config/srlab-vmx1-config.txt b/files/srlab-config/srlab-vmx1-config.txt new file mode 100644 index 0000000..d8ddc22 --- /dev/null +++ b/files/srlab-config/srlab-vmx1-config.txt @@ -0,0 +1,171 @@ + +version VERSION +system { + host-name srlab-vmx1; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +interfaces { + ge-0/0/0 { + description "srlab-vmx2" + unit 0 { + family inet { + address 10.0.0.0.0/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx4" + unit 0 { + family inet { + address 10.0.0.2/31 + } + family mpls; + family iso; + } + } + + ge-0/0/2 { + description "srlab-vmx3" + unit 0 { + family inet { + address 10.0.0.22/31 + } + family mpls; + family iso; + } + } + + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.57/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.1/32; + } + family iso { + address 49.0001.0010.0100.1001.00; + } + + } + } +} +routing-options { + router-id 192.168.0.1; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + export __Ansible_Core_export; + local-address 192.168.0.1; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.4; + neighbor 192.168.0.7; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 10; + } + } + level 1 disable; + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/2.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ge-0/0/0.0; + interface ge-0/0/1.0; + interface ge-0/0/2.0; + } + lldp { + interface ge-0/0/0; + interface ge-0/0/1; + interface ge-0/0/2; + } +} +policy-options { + policy-statement __Ansible_Core_export { + term ebgp { + from { + protocol bgp; + external; + } + then { + next-hop self; + accept; + } + } + } +} diff --git a/files/srlab-config/srlab-vmx2-config.txt b/files/srlab-config/srlab-vmx2-config.txt new file mode 100644 index 0000000..a360ed6 --- /dev/null +++ b/files/srlab-config/srlab-vmx2-config.txt @@ -0,0 +1,154 @@ + +version VERSION +system { + host-name srlab-vmx2; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +interfaces { + ge-0/0/0 { + description "srlab-vmx1" + unit 0 { + family inet { + address 10.0.0.0.1/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx5" + unit 0 { + family inet { + address 10.0.0.4/31 + } + family mpls; + family iso; + } + } + + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.58/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.2/32; + } + family iso { + address 49.0001.0010.0100.1002.00; + } + + } + } +} +routing-options { + router-id 192.168.0.2; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + export __Ansible_Core_export; + local-address 192.168.0.2; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.4; + neighbor 192.168.0.7; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 20; + } + } + level 1 disable; + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ge-0/0/0.0; + interface ge-0/0/1.0; + } + lldp { + interface ge-0/0/0; + interface ge-0/0/1; + } +} +policy-options { + policy-statement __Ansible_Core_export { + term ebgp { + from { + protocol bgp; + external; + } + then { + next-hop self; + accept; + } + } + } +} diff --git a/files/srlab-config/srlab-vmx3-config.txt b/files/srlab-config/srlab-vmx3-config.txt new file mode 100644 index 0000000..5da309b --- /dev/null +++ b/files/srlab-config/srlab-vmx3-config.txt @@ -0,0 +1,154 @@ + +version VERSION +system { + host-name srlab-vmx3; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +interfaces { + ge-0/0/2 { + description "srlab-vmx1" + unit 0 { + family inet { + address 10.0.0.23/31 + } + family mpls; + family iso; + } + } + + ge-0/0/4 { + description "srlab-vmx6" + unit 0 { + family inet { + address 10.0.0.24/31 + } + family mpls; + family iso; + } + } + + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.59/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.3/32; + } + family iso { + address 49.0001.0010.0100.1003.00; + } + + } + } +} +routing-options { + router-id 192.168.0.3; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + export __Ansible_Core_export; + local-address 192.168.0.3; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.4; + neighbor 192.168.0.7; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 30; + } + } + level 1 disable; + interface ge-0/0/2.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/4.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ge-0/0/2.0; + interface ge-0/0/4.0; + } + lldp { + interface ge-0/0/2; + interface ge-0/0/4; + } +} +policy-options { + policy-statement __Ansible_Core_export { + term ebgp { + from { + protocol bgp; + external; + } + then { + next-hop self; + accept; + } + } + } +} diff --git a/files/srlab-config/srlab-vmx4-config.txt b/files/srlab-config/srlab-vmx4-config.txt new file mode 100644 index 0000000..9f808ce --- /dev/null +++ b/files/srlab-config/srlab-vmx4-config.txt @@ -0,0 +1,176 @@ + +version VERSION +system { + host-name srlab-vmx4; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +interfaces { + ge-0/0/0 { + description "srlab-vmx5" + unit 0 { + family inet { + address 10.0.0.6/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx1" + unit 0 { + family inet { + address 10.0.0.3/31 + } + family mpls; + family iso; + } + } + + ge-0/0/2 { + description "srlab-vmx6" + unit 0 { + family inet { + address 10.0.0.8/31 + } + family mpls; + family iso; + } + } + + ge-0/0/3 { + description "srlab-vmx6" + unit 0 { + family inet { + address 10.0.0.10/31 + } + family mpls; + family iso; + } + } + + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.60/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.4/32; + } + family iso { + address 49.0001.0010.0100.1004.00; + } + + } + } +} +routing-options { + router-id 192.168.0.4; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + local-address 192.168.0.4; + cluster 192.168.0.4; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.1; + neighbor 192.168.0.2; + neighbor 192.168.0.8; + neighbor 192.168.0.9; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 40; + } + } + level 1 disable; + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/2.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/3.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ge-0/0/0.0; + interface ge-0/0/1.0; + interface ge-0/0/2.0; + interface ge-0/0/3.0; + } + lldp { + interface ge-0/0/0; + interface ge-0/0/1; + interface ge-0/0/2; + interface ge-0/0/3; + } +} diff --git a/files/srlab-config/srlab-vmx5-config.txt b/files/srlab-config/srlab-vmx5-config.txt new file mode 100644 index 0000000..e64603d --- /dev/null +++ b/files/srlab-config/srlab-vmx5-config.txt @@ -0,0 +1,190 @@ + +version VERSION +system { + host-name srlab-vmx5; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +chassis { + aggregated-devices { + ethernet { + device-count 10; + } + } +} +interfaces { + ae0 { + description "srlab-vmx7" + unit 0 { + family inet { + address 10.0.0.12/31 + } + family mpls; + family iso; + } + } + + ge-0/0/0 { + description "srlab-vmx4" + unit 0 { + family inet { + address 10.0.0.7/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx2" + unit 0 { + family inet { + address 10.0.0.5/31 + } + family mpls; + family iso; + } + } + + ge-0/0/2 { + description "[ae0]" + gigether-options { + 802.3.ad ae0 + } + } + ge-0/0/3 { + description "[ae0]" + gigether-options { + 802.3.ad ae0 + } + } + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.55/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.5/32; + } + family iso { + address 49.0001.0010.0100.1005.00; + } + + } + } +} +routing-options { + router-id 192.168.0.5; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + export __Ansible_Core_export; + local-address 192.168.0.5; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.4; + neighbor 192.168.0.7; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 50; + } + } + level 1 disable; + interface ae0.0 { + point-to-point; + metric 500; + } + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ae0.0; + interface ge-0/0/0.0; + interface ge-0/0/1.0; + } + lldp { + interface ae0; + interface ge-0/0/0; + interface ge-0/0/1; + } +} +policy-options { + policy-statement __Ansible_Core_export { + term ebgp { + from { + protocol bgp; + external; + } + then { + next-hop self; + accept; + } + } + } +} diff --git a/files/srlab-config/srlab-vmx6-config.txt b/files/srlab-config/srlab-vmx6-config.txt new file mode 100644 index 0000000..b3d2fed --- /dev/null +++ b/files/srlab-config/srlab-vmx6-config.txt @@ -0,0 +1,205 @@ + +version VERSION +system { + host-name srlab-vmx6; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +interfaces { + ge-0/0/0 { + description "srlab-vmx7" + unit 0 { + family inet { + address 10.0.0.14/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx8" + unit 0 { + family inet { + address 10.0.0.16/31 + } + family mpls; + family iso; + } + } + + ge-0/0/2 { + description "srlab-vmx4" + unit 0 { + family inet { + address 10.0.0.9/31 + } + family mpls; + family iso; + } + } + + ge-0/0/3 { + description "srlab-vmx4" + unit 0 { + family inet { + address 10.0.0.11/31 + } + family mpls; + family iso; + } + } + + ge-0/0/4 { + description "srlab-vmx3" + unit 0 { + family inet { + address 10.0.0.25/31 + } + family mpls; + family iso; + } + } + + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.56/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.6/32; + } + family iso { + address 49.0001.0010.0100.1006.00; + } + + } + } +} +routing-options { + router-id 192.168.0.6; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + export __Ansible_Core_export; + local-address 192.168.0.6; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.4; + neighbor 192.168.0.7; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 60; + } + } + level 1 disable; + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/2.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/3.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/4.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ge-0/0/0.0; + interface ge-0/0/1.0; + interface ge-0/0/2.0; + interface ge-0/0/3.0; + interface ge-0/0/4.0; + } + lldp { + interface ge-0/0/0; + interface ge-0/0/1; + interface ge-0/0/2; + interface ge-0/0/3; + interface ge-0/0/4; + } +} +policy-options { + policy-statement __Ansible_Core_export { + term ebgp { + from { + protocol bgp; + external; + } + then { + next-hop self; + accept; + } + } + } +} diff --git a/files/srlab-config/srlab-vmx7-config.txt b/files/srlab-config/srlab-vmx7-config.txt new file mode 100644 index 0000000..d221854 --- /dev/null +++ b/files/srlab-config/srlab-vmx7-config.txt @@ -0,0 +1,178 @@ + +version VERSION +system { + host-name srlab-vmx7; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +chassis { + aggregated-devices { + ethernet { + device-count 10; + } + } +} +interfaces { + ae0 { + description "srlab-vmx5" + unit 0 { + family inet { + address 10.0.0.13/31 + } + family mpls; + family iso; + } + } + + ge-0/0/0 { + description "srlab-vmx6" + unit 0 { + family inet { + address 10.0.0.15/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx9" + unit 0 { + family inet { + address 10.0.0.18/31 + } + family mpls; + family iso; + } + } + + ge-0/0/2 { + description "[ae0]" + gigether-options { + 802.3.ad ae0 + } + } + ge-0/0/3 { + description "[ae0]" + gigether-options { + 802.3.ad ae0 + } + } + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.57/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.7/32; + } + family iso { + address 49.0001.0010.0100.1007.00; + } + + } + } +} +routing-options { + router-id 192.168.0.7; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + local-address 192.168.0.7; + cluster 192.168.0.7; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.1; + neighbor 192.168.0.2; + neighbor 192.168.0.8; + neighbor 192.168.0.9; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 70; + } + } + level 1 disable; + interface ae0.0 { + point-to-point; + metric 500; + } + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ae0.0; + interface ge-0/0/0.0; + interface ge-0/0/1.0; + } + lldp { + interface ae0; + interface ge-0/0/0; + interface ge-0/0/1; + } +} diff --git a/files/srlab-config/srlab-vmx8-config.txt b/files/srlab-config/srlab-vmx8-config.txt new file mode 100644 index 0000000..ba19ccf --- /dev/null +++ b/files/srlab-config/srlab-vmx8-config.txt @@ -0,0 +1,154 @@ + +version VERSION +system { + host-name srlab-vmx8; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +interfaces { + ge-0/0/0 { + description "srlab-vmx9" + unit 0 { + family inet { + address 10.0.0.20/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx6" + unit 0 { + family inet { + address 10.0.0.17/31 + } + family mpls; + family iso; + } + } + + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.58/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.8/32; + } + family iso { + address 49.0001.0010.0100.1008.00; + } + + } + } +} +routing-options { + router-id 192.168.0.8; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + export __Ansible_Core_export; + local-address 192.168.0.8; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.4; + neighbor 192.168.0.7; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 80; + } + } + level 1 disable; + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ge-0/0/0.0; + interface ge-0/0/1.0; + } + lldp { + interface ge-0/0/0; + interface ge-0/0/1; + } +} +policy-options { + policy-statement __Ansible_Core_export { + term ebgp { + from { + protocol bgp; + external; + } + then { + next-hop self; + accept; + } + } + } +} diff --git a/files/srlab-config/srlab-vmx9-config.txt b/files/srlab-config/srlab-vmx9-config.txt new file mode 100644 index 0000000..ff60865 --- /dev/null +++ b/files/srlab-config/srlab-vmx9-config.txt @@ -0,0 +1,154 @@ + +version VERSION +system { + host-name srlab-vmx9; + no-redirects; + root-authentication { + encrypted-password "$5$mcE0Hfiq$JfBeC3QSAvnd1tjqlOhlYXDgVrwvd6S4G3oVj5wiMO7"; ## SECRET-DATA + } + login { + user salt { + uid 2001; + class super-user; + authentication { + encrypted-password "$5$yp7ziGTI$F5F.6AUlR8hDK2JIsw5WRrTLex/yTCWH3iSR1Auk293"; ## SECRET-DATA + ssh-rsa "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCjxY2hLZ+ju5wdK4GYNhKGgnS8EWLBoEVpo+xQkhDzkTiBx3HGAnmARcVV0B9MqrHZl1omdnirJeygWzVbVY4yPUqGgEcUsTTq9fvK4AjTwtaoB5txAosaOnZq0zewmuZ6EMi6E3RND6A3FGXkf1Il2jg3I8k/dGqdyFI80B7sWy90fk+EqsGMPxVc+l5vAtY2jm84ellxxzBsulxfCSKPH86hZ1GqZ8A1ZBWITu15NjQw0aGssSYGMMTa1T8eFyY4hHWqqdwgOlODg9mZwwP1JdJH79SRoTOjqGGixuAFDGAgH3fNX6u8wTmYya/z7WXH6B2XwiiaZYdcyEbMLPZt"; ## SECRET-DATA + } + } + } + services { + ssh; + netconf { + ssh; + traceoptions { + file nc.txt size 1m world-readable; + flag all; + } + } + } + syslog { + user * { + any emergency; + } + file messages { + any any; + authorization info; + } + file interactive-commands { + interactive-commands any; + } + } +} +interfaces { + ge-0/0/0 { + description "srlab-vmx8" + unit 0 { + family inet { + address 10.0.0.21/31 + } + family mpls; + family iso; + } + } + + ge-0/0/1 { + description "srlab-vmx7" + unit 0 { + family inet { + address 10.0.0.19/31 + } + family mpls; + family iso; + } + } + + fxp0 { + description "OOB to MGMT Network"; + unit 0 { + family inet { + address 10.39.0.59/20; + } + } + } + lo0 { + unit 0 { + family inet { + address 192.168.0.9/32; + } + family iso { + address 49.0001.0010.0100.1009.00; + } + + } + } +} +routing-options { + router-id 192.168.0.9; + autonomous-system 65000; + static { + route 0.0.0.0/0 { + next-hop 10.39.0.1; + no-readvertise; + preference 255; + } + } +} +protocols { + bgp { + group Core { + type internal; + export __Ansible_Core_export; + local-address 192.168.0.9; + family inet { + unicast; + } + family inet-vpn { + unicast; + } + neighbor 192.168.0.4; + neighbor 192.168.0.7; + } + } + isis { + no-ipv6-routing; + source-packet-routing { + node-segment { + ipv4-index 90; + } + } + level 1 disable; + interface ge-0/0/0.0 { + point-to-point; + metric 1000; + } + interface ge-0/0/1.0 { + point-to-point; + metric 1000; + } + interface lo0.0 { + passive; + } + } + mpls { + interface ge-0/0/0.0; + interface ge-0/0/1.0; + } + lldp { + interface ge-0/0/0; + interface ge-0/0/1; + } +} +policy-options { + policy-statement __Ansible_Core_export { + term ebgp { + from { + protocol bgp; + external; + } + then { + next-hop self; + accept; + } + } + } +} diff --git a/files/srlab-tasks/srlab-vmx1_task.yml b/files/srlab-tasks/srlab-vmx1_task.yml new file mode 100644 index 0000000..5e64c86 --- /dev/null +++ b/files/srlab-tasks/srlab-vmx1_task.yml @@ -0,0 +1,27 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx1-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx1-br-int" + - name: "srlab-vmx1-1--srlab-vmx4-1" + device_type: vmxnet3 + - name: "srlab-vmx1-2--srlab-vmx3-2" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx2_task.yml b/files/srlab-tasks/srlab-vmx2_task.yml new file mode 100644 index 0000000..38f71c2 --- /dev/null +++ b/files/srlab-tasks/srlab-vmx2_task.yml @@ -0,0 +1,26 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx2-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx2-br-int" + - name: "srlab-vmx2-1--srlab-vmx5-1" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx3_task.yml b/files/srlab-tasks/srlab-vmx3_task.yml new file mode 100644 index 0000000..242558d --- /dev/null +++ b/files/srlab-tasks/srlab-vmx3_task.yml @@ -0,0 +1,27 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx3-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx3-br-int" + - name: "DUMMY" + - name: "srlab-vmx1-2--srlab-vmx3-2" + device_type: vmxnet3 + - name: "DUMMY" + - name: "srlab-vmx3-4--srlab-vmx6-4" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx4_task.yml b/files/srlab-tasks/srlab-vmx4_task.yml new file mode 100644 index 0000000..5ea5eb1 --- /dev/null +++ b/files/srlab-tasks/srlab-vmx4_task.yml @@ -0,0 +1,28 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx4-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx4-br-int" + - name: "srlab-vmx1-1--srlab-vmx4-1" + device_type: vmxnet3 + - name: "srlab-vmx4-2--srlab-vmx6-2" + device_type: vmxnet3 + - name: "srlab-vmx4-3--srlab-vmx6-3" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx5_task.yml b/files/srlab-tasks/srlab-vmx5_task.yml new file mode 100644 index 0000000..14adc4a --- /dev/null +++ b/files/srlab-tasks/srlab-vmx5_task.yml @@ -0,0 +1,28 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx5-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx5-br-int" + - name: "srlab-vmx2-1--srlab-vmx5-1" + device_type: vmxnet3 + - name: "srlab-vmx5-2--srlab-vmx7-2" + device_type: vmxnet3 + - name: "srlab-vmx5-3--srlab-vmx7-3" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx6_task.yml b/files/srlab-tasks/srlab-vmx6_task.yml new file mode 100644 index 0000000..52e05df --- /dev/null +++ b/files/srlab-tasks/srlab-vmx6_task.yml @@ -0,0 +1,29 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx6-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx6-br-int" + - name: "srlab-vmx6-1--srlab-vmx8-1" + device_type: vmxnet3 + - name: "srlab-vmx4-2--srlab-vmx6-2" + device_type: vmxnet3 + - name: "srlab-vmx4-3--srlab-vmx6-3" + device_type: vmxnet3 + - name: "srlab-vmx3-4--srlab-vmx6-4" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx7_task.yml b/files/srlab-tasks/srlab-vmx7_task.yml new file mode 100644 index 0000000..567b415 --- /dev/null +++ b/files/srlab-tasks/srlab-vmx7_task.yml @@ -0,0 +1,28 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx7-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx7-br-int" + - name: "srlab-vmx7-1--srlab-vmx9-1" + device_type: vmxnet3 + - name: "srlab-vmx5-2--srlab-vmx7-2" + device_type: vmxnet3 + - name: "srlab-vmx5-3--srlab-vmx7-3" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx8_task.yml b/files/srlab-tasks/srlab-vmx8_task.yml new file mode 100644 index 0000000..b878ddf --- /dev/null +++ b/files/srlab-tasks/srlab-vmx8_task.yml @@ -0,0 +1,26 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx8-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx8-br-int" + - name: "srlab-vmx6-1--srlab-vmx8-1" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/files/srlab-tasks/srlab-vmx9_task.yml b/files/srlab-tasks/srlab-vmx9_task.yml new file mode 100644 index 0000000..87861ca --- /dev/null +++ b/files/srlab-tasks/srlab-vmx9_task.yml @@ -0,0 +1,26 @@ + - name: Update vmx networking + vmware_guest: + hostname: "{{ vcenter_hostname }}" + username: "{{ vcenter_username }}" + password: "{{ vcenter_password }}" + esxi_hostname: "{{ esxi_hostname }}" + validate_certs: False + name: "srlab-vmx9-vfpc" + folder: / + datastore: datastore2 + networks: + - name: NS-DEV-NAT + - name: "srlab-vmx9-br-int" + - name: "srlab-vmx7-1--srlab-vmx9-1" + device_type: vmxnet3 + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + - name: "DUMMY" + hardware: + num_cpus: 3 + memory_mb: 8192 + state: present + delegate_to: localhost diff --git a/roles/deploy-topo/files/switch_sort.py b/files/switch_sort.py similarity index 100% rename from roles/deploy-topo/files/switch_sort.py rename to files/switch_sort.py diff --git a/group_vars/srlab b/group_vars/srlab index 0c2100c..f013704 100644 --- a/group_vars/srlab +++ b/group_vars/srlab @@ -1,4 +1,6 @@ --- ansible_connection: local model: core-model-sr.yml +config_dir: files/srlab-config +tasks_dir: files/srlab-tasks dryrun: True diff --git a/hosts.ini b/hosts.ini index ff1c5ca..9d9b93e 100644 --- a/hosts.ini +++ b/hosts.ini @@ -9,8 +9,7 @@ srlab-vmx7 ansible_host=10.0.0.7 srlab-vmx8 ansible_host=10.0.0.8 srlab-vmx9 ansible_host=10.0.0.9 -[vmx:children] -srlab +[vmxlab] vmx1 ansible_host=10.39.8.10 vmx2 ansible_host=10.39.8.11 vmx3 ansible_host=10.39.8.12 @@ -18,6 +17,10 @@ vmx4 ansible_host=10.39.8.13 vmx5 ansible_host=10.39.8.14 vmx6 ansible_host=10.39.8.15 +[vmx:children] +srlab +vmxlab + [mx5] mx5-1 ansible_host=10.39.8.1 mx5-2 ansible_host=10.39.8.2 diff --git a/roles/deploy-dhcpd/defaults/main.yml b/roles/deploy-dhcpd/defaults/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-dhcpd/files/main.yml b/roles/deploy-dhcpd/files/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-dhcpd/handlers/main.yml b/roles/deploy-dhcpd/handlers/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-dhcpd/meta/main.yml b/roles/deploy-dhcpd/meta/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-dhcpd/tasks/main.yml b/roles/deploy-dhcpd/tasks/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-dhcpd/templates/main.yml b/roles/deploy-dhcpd/templates/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-dhcpd/vars/main.yml b/roles/deploy-dhcpd/vars/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-topo/defaults/main.yml b/roles/deploy-topo/defaults/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-topo/files/main.yml b/roles/deploy-topo/files/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-topo/handlers/main.yml b/roles/deploy-topo/handlers/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-topo/meta/main.yml b/roles/deploy-topo/meta/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-topo/tasks/main.yml b/roles/deploy-topo/tasks/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-topo/templates/main.yml b/roles/deploy-topo/templates/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/roles/deploy-topo/vars/main.yml b/roles/deploy-topo/vars/main.yml deleted file mode 100644 index e69de29..0000000 diff --git a/srlab-config.yml b/srlab-config.yml new file mode 100644 index 0000000..5140ef9 --- /dev/null +++ b/srlab-config.yml @@ -0,0 +1,57 @@ +--- +- hosts: srlab + name: Create per node data model + gather_facts: no + tags: [ model ] + vars_files: + - "vars_files/{{model|default('core-model.yml')}}" + tasks: + - name: Create per-node data model from fabric data model + template: src=core-to-nodes.j2 dest=files/nodes.yml + delegate_to: localhost + run_once: True + + +- name: Generate Configuration for all routers + gather_facts: no + hosts: srlab + tags: [ template ] + vars_files: + - "files/nodes.yml" + tasks: +# - name: Gather facts (eos) +# eos_facts: +# when: +# - ansible_network_os == 'eos' +# - dryrun is not defined +# - name: Gather facts (junos) +# junos_facts: +# when: +# - ansible_network_os == 'junos' +# - dryrun is not defined + - name: create the directory for the configuration + file: path="{{ config_dir }}" state=directory + run_once: true + - name: Generate Configuration + template: src="{{ansible_network_os}}.j2" dest="{{ config_dir }}/{{inventory_hostname}}-config.txt" + + +- name: push the configuration to the devices + gather_facts: no + hosts: srlab + tags: [ deploy ] + vars_files: + - "files/nodes.yml" + tasks: + - name: Load config (junos) + junos_config: + src: "{{ config_dir }}/{{inventory_hostname}}-config.txt" + update: override + comment: Ansible config update + when: ansible_network_os == 'junos' + + - name: Load config (eos) + eos_config: + src: "{{ config_dir }}/{{inventory_hostname}}-config.txt" + when: ansible_network_os == 'eos' + diff --git a/roles/deploy-topo/tasks/lab_deploy.yml b/srlab-deploy.yml similarity index 88% rename from roles/deploy-topo/tasks/lab_deploy.yml rename to srlab-deploy.yml index bfd8da8..f6a364d 100644 --- a/roles/deploy-topo/tasks/lab_deploy.yml +++ b/srlab-deploy.yml @@ -37,7 +37,7 @@ gather_facts: no vars_files: group_vars/vmware tasks: - - include_vars: "./nodes.yml" + - include_vars: "files/nodes.yml" - name: Create the vswitch vmware_vswitch: hostname: "{{ vcenter_hostname }}" @@ -81,7 +81,7 @@ allow_duplicates: no name: "{{ inventory_hostname }}-vcp" datastore: datastore2 - ova: ova/vcp_17.3R3.10.ova + ova: files/ova/vcp_17.3R3.10.ova disk_provisioning: thin power_on: no networks: @@ -97,7 +97,7 @@ allow_duplicates: no name: "{{ inventory_hostname }}-vfpc" datastore: datastore2 - ova: ova/vfpc_17.3R3.10.ova + ova: files/ova/vfpc_17.3R3.10.ova disk_provisioning: thin power_on: no networks: @@ -111,7 +111,7 @@ gather_facts: no tasks: - name: Sort node switches - command: "{{ ansible_python_interpreter }} {{ playbook_dir }}/switch_sort.py {{ playbook_dir }}/nodes.yml" + command: "{{ ansible_python_interpreter }} {{ playbook_dir }}/files/switch_sort.py {{ playbook_dir }}/files/nodes.yml" args: chdir: "{{ playbook_dir }}" @@ -120,11 +120,14 @@ tags: generate_tasks gather_facts: no tasks: - - include_vars: "./nodes.yml" + - include_vars: "files/nodes.yml" + - name: Create tasks dir + file: path="{{ tasks_dir }}" state=directory + run_once: True - name: Generate update network task template: - src: "./task_update_network.j2" - dest: "./tasks/{{ inventory_hostname }}_task.yml" + src: "task_update_network.j2" + dest: "{{ tasks_dir }}/{{ inventory_hostname }}_task.yml" delegate_to: localhost - name: Update vmx networking @@ -134,4 +137,4 @@ vars_files: group_vars/vmware tasks: - name: Include task - include_tasks: "./tasks/{{ inventory_hostname }}_task.yml" + include_tasks: "{{ tasks_dir }}/{{ inventory_hostname }}_task.yml" diff --git a/roles/deploy-topo/templates/core-to-nodes.j2 b/templates/core-to-nodes.j2 similarity index 100% rename from roles/deploy-topo/templates/core-to-nodes.j2 rename to templates/core-to-nodes.j2 diff --git a/roles/deploy-topo/templates/eos.j2 b/templates/eos.j2 similarity index 100% rename from roles/deploy-topo/templates/eos.j2 rename to templates/eos.j2 diff --git a/roles/deploy-topo/templates/iosxr.j2 b/templates/iosxr.j2 similarity index 100% rename from roles/deploy-topo/templates/iosxr.j2 rename to templates/iosxr.j2 diff --git a/roles/deploy-topo/templates/junos.j2 b/templates/junos.j2 similarity index 100% rename from roles/deploy-topo/templates/junos.j2 rename to templates/junos.j2 diff --git a/roles/deploy-topo/templates/task_update_network.j2 b/templates/task_update_network.j2 similarity index 100% rename from roles/deploy-topo/templates/task_update_network.j2 rename to templates/task_update_network.j2 diff --git a/roles/deploy-topo/tasks/validate.yml b/validate.yml similarity index 100% rename from roles/deploy-topo/tasks/validate.yml rename to validate.yml diff --git a/roles/deploy-topo/defaults/core-model-sr.yml b/vars_files/core-model-sr.yml similarity index 100% rename from roles/deploy-topo/defaults/core-model-sr.yml rename to vars_files/core-model-sr.yml diff --git a/roles/deploy-topo/defaults/core-model-veos.yml b/vars_files/core-model-veos.yml similarity index 100% rename from roles/deploy-topo/defaults/core-model-veos.yml rename to vars_files/core-model-veos.yml diff --git a/roles/deploy-topo/defaults/core-model.yml b/vars_files/core-model.yml similarity index 100% rename from roles/deploy-topo/defaults/core-model.yml rename to vars_files/core-model.yml diff --git a/roles/deploy-dhcpd/defaults/vars-dhcpd.yml b/vars_files/vars-dhcpd.yml similarity index 100% rename from roles/deploy-dhcpd/defaults/vars-dhcpd.yml rename to vars_files/vars-dhcpd.yml