From e53e9212363203883cdc0d4f1cce3ebfa6de658c Mon Sep 17 00:00:00 2001 From: Owen DeLong Date: Fri, 29 Jul 2022 10:43:36 -0700 Subject: [PATCH 1/2] Added missing dependency to Makefile Added skip for unused switches Added sign switches for outside Expo --- switch-configuration/config/scripts/override_switches | 9 +++++++-- switch-configuration/config/switchtypes | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/switch-configuration/config/scripts/override_switches b/switch-configuration/config/scripts/override_switches index 461db1b0..2d1196ff 100755 --- a/switch-configuration/config/scripts/override_switches +++ b/switch-configuration/config/scripts/override_switches @@ -109,9 +109,14 @@ if ($opt_i) my %errors=(); foreach my $switch (@list) { - my ($Name, $Num, $MgtVL, $IPv6Addr, $Type); + my ($Name, $Num, $MgtVL, $IPv6Addr, $Type, $hierarchy); print "Looking up switch $switch\n"; - ($Name, $Num, $MgtVL, $IPv6Addr, $Type) = (get_switchtype($switch)); + ($Name, $Num, $MgtVL, $IPv6Addr, $Type, $hierarchy) = (get_switchtype($switch)); + if ($hierarchy =~ /^Z/) + { + print STDERR "Skipping switch $Name in hierarchy $hierarchy.\n"; + next; + } die("Error: Couldn't get type for $switch (got $Name)\n") unless $Name eq $switch; print "Got Entry: $Name, $Num, $MgtVL, $IPv6Addr, $Type for $switch\n"; diff --git a/switch-configuration/config/switchtypes b/switch-configuration/config/switchtypes index e1ff6078..85b1e252 100644 --- a/switch-configuration/config/switchtypes +++ b/switch-configuration/config/switchtypes @@ -44,7 +44,7 @@ SanLorenzoC 27 103 2001:470:f0fb:103::200:27 hiRoom D.9 Normal ex4200-48p 2c: ExpoA2 28 103 2001:470:f0fb:103::200:28 hiBooth L.2 Loud ex4200-48p 00:26:88:6e:c6:ff ExpoB2 29 103 2001:470:f0fb:103::200:29 hiBooth L.2 Loud ex4200-48p 28:c0:da:33:38:7f SanLorenzoD 30 103 2001:470:f0fb:103::200:30 hiRoom D.9 Normal ex4200-48p 00:26:88:7e:36:7f -SpareG 31 103 2001:470:f0fb:103::200:31 hiRoom Z.9 Quiet ex4200-48p 00:26:88:7d:f5:ff +ExpoSignFront 31 103 2001:470:f0fb:103::200:31 hiRoom Z.9 Quiet ex4200-48p 00:26:88:7d:f5:ff RegDesk 32 103 2001:470:f0fb:103::200:32 hiRegistration D.9 Normal ex4200-48p 00:26:88:7a:76:ff ExpoC2 33 103 2001:470:f0fb:103::200:33 hiBooth L.2 Normal ex4200-48p 00:26:88:7d:f8:7f ExpoD1 34 103 2001:470:f0fb:103::200:34 hiBooth L.2 Loud ex4200-48p 00:26:88:6f:1e:7f @@ -54,7 +54,7 @@ SantaMonicaB 37 103 2001:470:f0fb:103::200:37 hiRoom D.9 Quiet ex4200-48p 2c: ExpoE2 38 103 2001:470:f0fb:103::200:38 hiBooth L.2 Normal ex4200-48p 00:26:88:7e:1b:ff ExpoB4 39 103 2001:470:f0fb:103::200:39 hiBooth L.2 Normal ex4200-48p 00:26:88:70:d6:7f SantaMonicaC 40 103 2001:470:f0fb:103::200:40 hiRoom D.9 Quiet ex4200-48p b0:c6:9a:64:85:ff -ExpoC4 41 103 2001:470:f0fb:103::200:41 hiBooth L.2 Normal ex4200-48p 00:26:88:70:bb:7f +ExpoSignRear 41 103 2001:470:f0fb:103::200:41 hiRoom L.2 Normal ex4200-48p 00:26:88:70:bb:7f ExpoA5 42 103 2001:470:f0fb:103::200:42 hiBooth L.2 Normal ex4200-48p 00:26:88:60:40:7f ExpoB5 43 103 2001:470:f0fb:103::200:43 hiBooth L.2 Normal ex4200-48p 00:26:88:7d:1b:ff BelAir 44 103 2001:470:f0fb:103::200:44 hiRoom E.9 Loud ex4200-48p 00:26:88:7c:41:7f From 3c117437ceb4c36bc8f422fae7dac5ec334a7c06 Mon Sep 17 00:00:00 2001 From: Owen DeLong Date: Fri, 29 Jul 2022 16:02:59 -0700 Subject: [PATCH 2/2] Fixed Key dependency in Makefile Fix for show floor wired networks and vendor backbone --- switch-configuration/Makefile | 2 +- .../config/scripts/build_switch_configs.pl | 4 ++ .../config/scripts/bulk_local_load_switches | 8 +-- .../config/scripts/switch_template.pl | 71 +++++++++++++------ switch-configuration/config/switchtypes | 8 +-- switch-configuration/config/types/Booth | 1 + switch-configuration/config/types/hiAV | 16 ++--- switch-configuration/config/types/hiBooth | 25 +++---- switch-configuration/config/types/hiIDF | 38 +++++----- switch-configuration/config/types/hiMDF | 44 ++++++------ switch-configuration/config/types/hiNOC | 36 +++++----- .../config/types/hiRegistration | 20 +++--- switch-configuration/config/types/hiRoom | 24 +++---- switch-configuration/config/vlans.d/Expo | 23 +++--- switch-configuration/config/vlans.d/Hilton | 1 + 15 files changed, 180 insertions(+), 141 deletions(-) diff --git a/switch-configuration/Makefile b/switch-configuration/Makefile index 81c39030..f41bf085 100644 --- a/switch-configuration/Makefile +++ b/switch-configuration/Makefile @@ -18,7 +18,7 @@ lint: .lint ../facts/secrets/jroot_pw: echo "$(JROOT_SECRET)" > ../facts/secrets/jroot_pw -.secrets: .lint ../facts/secrets/jroot_pw +.secrets: .lint ../facts/secrets/jroot_pw ../facts/keys/* echo "Using $JROOT_SECRET as secret" touch .secrets diff --git a/switch-configuration/config/scripts/build_switch_configs.pl b/switch-configuration/config/scripts/build_switch_configs.pl index f679337d..38c46601 100755 --- a/switch-configuration/config/scripts/build_switch_configs.pl +++ b/switch-configuration/config/scripts/build_switch_configs.pl @@ -40,11 +40,15 @@ } foreach $file (@outputs) { + open TMP, ">>$file"; + close TMP; unlink($file) || die "Failed to delete $file: $!\n"; debug(3, "Deleted $file from output directory\n"); } foreach $file (@maps) { + open TMP, ">>$file"; + close TMP; unlink($file) || die "Failed to delete $file: $!\n"; debug(3, "Deleted $file from output directory\n"); } diff --git a/switch-configuration/config/scripts/bulk_local_load_switches b/switch-configuration/config/scripts/bulk_local_load_switches index 4b4e6a2d..d2028a9b 100755 --- a/switch-configuration/config/scripts/bulk_local_load_switches +++ b/switch-configuration/config/scripts/bulk_local_load_switches @@ -157,14 +157,14 @@ EOF if ($opt_l) # If -l is specified, install configuration via directly attached management port { my $result; - if($result = system("scp \"output/$Name.conf\" admin\@$IP".":/tmp/new_config.conf")) + if($result = system("scp \"output/$Name.conf\" owen\@$IP".":/tmp/new_config.conf")) { while ($result == 1 || $result == 256) { # Connection error, probably switch isn't fully online print STDERR "Switch didn't accept SCP, retrying in 5 seconds.\n"; sleep 5; - $result = system("scp \"output/$Name.conf\" admin\@$IP".":/tmp/new_config.conf"); + $result = system("scp \"output/$Name.conf\" owen\@$IP".":/tmp/new_config.conf"); } if ($result) { @@ -182,11 +182,11 @@ EOF print STDERR "Activating...\n"; if ($opt_l) # If -l is specified, activate configuration via directly attached management port { - open(JUNIPER, "| ssh admin\@$IP"); + open(JUNIPER, "| ssh owen\@$IP"); } else { - open(JUNIPER, "| ssh admin\@$Name"); + open(JUNIPER, "| ssh owen\@$Name"); } print JUNIPER $SWITCH_COMMANDS; print STDERR "Finished sending commands to switch...\n"; diff --git a/switch-configuration/config/scripts/switch_template.pl b/switch-configuration/config/scripts/switch_template.pl index 77449fc4..1a1543e8 100755 --- a/switch-configuration/config/scripts/switch_template.pl +++ b/switch-configuration/config/scripts/switch_template.pl @@ -841,6 +841,17 @@ sub VV_init_firewall my $VV_firewall = < internet only) -VVRNG vendor_vlan_ 200-498 2001:470:f325:200::/54 10.2.0.0/15 Dynamically allocated and named booth VLANs +VVRNG vendor_vlan_ 200-498 2001:470:f0fb:200::/54 10.2.0.0/15 Dynamically allocated and named booth VLANs //499 is reserved for the Vendor backbone VLAN between the Expo switches and the routers. +VLAN vendor_backbone 499 2001:470:f0fb:499::/64 10.1.0.0/24 Vendor Backbone diff --git a/switch-configuration/config/vlans.d/Hilton b/switch-configuration/config/vlans.d/Hilton index f7aff13e..c22b7842 100644 --- a/switch-configuration/config/vlans.d/Hilton +++ b/switch-configuration/config/vlans.d/Hilton @@ -17,3 +17,4 @@ VLAN hiInstall 111 2001:470:f0fb:111::/64 10.0.11.0/24 Install Fests and Worksh //VLANs (vendor_vlan <-> internet only) VVRNG vendor_vlan_ 200-498 2001:470:f0fb:200::/54 10.2.0.0/15 Dynamically allocated and named booth VLANs //499 is reserved for the Vendor backbone VLAN between the Expo switches and the routers. +VLAN vendor_backbone 499 2001:470:f0fb:499::/64 10.1.0.0/24 Vendor Backbone