aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoachim Tingvold <joachim@tingvold.com>2015-03-21 18:40:28 +0100
committerJoachim Tingvold <joachim@tingvold.com>2015-03-21 18:40:28 +0100
commitd5c0e6ac02bd4bb1832434ef3fa502a21ac48432 (patch)
tree9f754351c81d4ee1ffd1526823842b52bbd0f054
parent6bf0be13c4ac46f612251eb13cf2b23f94441cc5 (diff)
Bootstrap-related files get it's own directory
-rw-r--r--bootstrap/README.md (renamed from tools/README.md)44
-rwxr-xr-xbootstrap/apply-baseupdate.sh (renamed from tools/apply-baseupdate.sh)0
-rwxr-xr-xbootstrap/create-hostsfile.sh (renamed from tools/create-hostsfile.sh)0
-rwxr-xr-xbootstrap/create-shellconf.pl (renamed from tools/create-shellconf.pl)0
-rwxr-xr-xbootstrap/init-sshkeys.sh (renamed from tools/init-sshkeys.sh)0
-rwxr-xr-xbootstrap/install-dependencies.sh (renamed from tools/install-dependencies.sh)0
-rwxr-xr-xbootstrap/make-base-requires.sh (renamed from tools/make-base-requires.sh)27
-rwxr-xr-xbootstrap/make-dhcp6-init.sh (renamed from tools/make-dhcp6-init.sh)0
-rwxr-xr-xbootstrap/make-dhcpd.pl (renamed from tools/make-dhcpd.pl)0
-rwxr-xr-xbootstrap/make-first-zones.pl (renamed from tools/make-first-zones.pl)0
-rwxr-xr-xbootstrap/make-named.pl (renamed from tools/make-named.pl)0
-rwxr-xr-xbootstrap/make-pxeboot.sh (renamed from tools/make-pxeboot.sh)2
-rwxr-xr-xbootstrap/make-reverse4-files.pl (renamed from tools/make-reverse4-files.pl)0
-rwxr-xr-xbootstrap/update-baseservice.sh (renamed from tools/update-baseservice.sh)0
-rwxr-xr-xbootstrap/update-tools.sh (renamed from tools/update-tools.sh)8
15 files changed, 42 insertions, 39 deletions
diff --git a/tools/README.md b/bootstrap/README.md
index 74e6977..8301d51 100644
--- a/tools/README.md
+++ b/bootstrap/README.md
@@ -35,18 +35,18 @@ The following three hosts/servers are normally used:
Start by placing the 'tgmanage' directory as '/root/tgmanage' on the bootstrap
box. Change into the 'tgmanage' directory. Next, run
-'tools/install-dependencies.sh boot'
+'bootstrap/install-dependencies.sh boot'
Edit 'include/config.local.pm' and update for this year's TG. Use
-'tools/create-shellconf.pl' to extract configuration from the perl module to
+'bootstrap/create-shellconf.pl' to extract configuration from the perl module to
create/update the 'include/tgmanage.cfg.sh' configuration script.
-Run 'tools/create-hostsfile.sh' to make sure the bootstrap-box can use
+Run 'bootstrap/create-hostsfile.sh' to make sure the bootstrap-box can use
hostnames to reach the pri/sec DNS even before DNS is set up.
The tools make extensive use of key-based SSH logins, to make this work
-seamlessly, run 'tools/init-sshkeys.sh' to create an RSA priv/pub keypair, and
+seamlessly, run 'bootstrap/init-sshkeys.sh' to create an RSA priv/pub keypair, and
push the pubkey to the Primary and Secondary boxes.
@@ -62,45 +62,45 @@ format of each net-line is:
176.110.124.0 24 noc
-Run 'tools/make-base-requires.sh'. This script will log in on the Primary and
+Run 'bootstrap/make-base-requires.sh'. This script will log in on the Primary and
Secondary boxes, install dependencies and the BIND/DHCP packages, create all
needed directories, create the initial configuration files.
A short listing of the tasks of scripts called by make-base-requires (NOTE: these
-scripts are run by tools/make-base-requires.sh, you should not need to run these individually):
- * tools/install-dependencies.sh
+scripts are run by bootstrap/make-base-requires.sh, you should not need to run these individually):
+ * bootstrap/install-dependencies.sh
* Installs needed base software to boot, primary and secondary
- * tools/make-named.pl
+ * bootstrap/make-named.pl
* Basic BIND setup (creates named.conf et.al)
- * tools/make-first-zones.pl
+ * bootstrap/make-first-zones.pl
* Creates static zone-files (tgname, infra, ipv6zone)
- * tools/make-reverse4-files.pl
+ * bootstrap/make-reverse4-files.pl
* Creates reverse-zones for IPv4
- * tools/make-dhcpd.pl
+ * bootstrap/make-dhcpd.pl
* Sets up the base setup for DHCP
3++: Update during the party using update-baseservice.sh from bootstrap
------------------------------------------------------------------
-After 'tools/make-base-requires.sh' has been run, further updating should be
+After 'bootstrap/make-base-requires.sh' has been run, further updating should be
managed by the following three files:
- * tools/update-baseservice.sh
+ * bootstrap/update-baseservice.sh
* Used to add/update bind and DHCP configuration
- * tools/apply-baseupdate.sh
+ * bootstrap/apply-baseupdate.sh
* Used to reload bind and restart DHCP
- * tools/update-tools.sh
+ * bootstrap/update-tools.sh
* Used to push changes to the tgmanage toolchain
This means, after the base setup is completed, updating and managing the
-configuration is done by updating netlist.txt and running tools/update-baseservice.sh
+configuration is done by updating netlist.txt and running bootstrap/update-baseservice.sh
from the bootstrap box, or from the NMS box if the toolchain gets moved there during
the party.
To create a new DHCP scope, add DNS forward and reverse zone for a new network:
* Add the network to netlist.txt
- * Run tools/update-baseservice.sh to generate new .conf and .zone files
- * Run tools/apply-baseupdate.sh to load new configuration
+ * Run bootstrap/update-baseservice.sh to generate new .conf and .zone files
+ * Run bootstrap/apply-baseupdate.sh to load new configuration
To do changes to DHCP config after the scope .conf file has been created
(read: later in the party), log in to the primary/dhcp server, and make
@@ -110,17 +110,17 @@ To do DNS changes to the main DNS zone or the infra-zone, make the changes
in the appropriate zone file on the primary DNS server.
To add DNS records to any other DNS zone (forward or reverse), you have
-to use 'nsupdate'. To simplify the process, use tools/generate-dnsrr.pl
+to use 'nsupdate'. To simplify the process, use bootstrap/generate-dnsrr.pl
Usage on this tool is documented in the "header" of the script...
The update prosess is handled by a bunch of "sub-tools", these should typically
not need to be run individually:
- * tools/make-bind-include.pl
+ * bootstrap/make-bind-include.pl
* Run via update-baseservice, adds new net's to DNS include
- * tools/make-dhcpd-include.pl
+ * bootstrap/make-dhcpd-include.pl
* Run via update-baseservice, adds new net's to DHCP include
- * tools/make-missing-conf.pl
+ * bootstrap/make-missing-conf.pl
* Run via update-baseservice, adds missing net-conf to BIND/DHCP
diff --git a/tools/apply-baseupdate.sh b/bootstrap/apply-baseupdate.sh
index 055320c..055320c 100755
--- a/tools/apply-baseupdate.sh
+++ b/bootstrap/apply-baseupdate.sh
diff --git a/tools/create-hostsfile.sh b/bootstrap/create-hostsfile.sh
index 2aaf9cb..2aaf9cb 100755
--- a/tools/create-hostsfile.sh
+++ b/bootstrap/create-hostsfile.sh
diff --git a/tools/create-shellconf.pl b/bootstrap/create-shellconf.pl
index 9c4b500..9c4b500 100755
--- a/tools/create-shellconf.pl
+++ b/bootstrap/create-shellconf.pl
diff --git a/tools/init-sshkeys.sh b/bootstrap/init-sshkeys.sh
index 9427bad..9427bad 100755
--- a/tools/init-sshkeys.sh
+++ b/bootstrap/init-sshkeys.sh
diff --git a/tools/install-dependencies.sh b/bootstrap/install-dependencies.sh
index 4edb01f..4edb01f 100755
--- a/tools/install-dependencies.sh
+++ b/bootstrap/install-dependencies.sh
diff --git a/tools/make-base-requires.sh b/bootstrap/make-base-requires.sh
index 1a957c1..ad40e73 100755
--- a/tools/make-base-requires.sh
+++ b/bootstrap/make-base-requires.sh
@@ -16,9 +16,10 @@ then
exit 1;
fi;
-tools/update-tools.sh
-ssh -l root ${PRIMARY} "~/tgmanage/tools/install-dependencies.sh master"
-ssh -l root ${SECONDARY} "~/tgmanage/tools/install-dependencies.sh slave"
+cd ~/tgmanage
+bootstrap/update-tools.sh
+ssh -l root ${PRIMARY} "~/tgmanage/bootstrap/install-dependencies.sh master"
+ssh -l root ${SECONDARY} "~/tgmanage/bootstrap/install-dependencies.sh slave"
if [ "${BASE}" == "/etc" ]; then
ssh -l root ${PRIMARY} "cp -pR /etc/bind /etc/bind.dist"
@@ -41,21 +42,21 @@ ssh -l root ${PRIMARY} "mkdir -p ${BASE}/bind/reverse/"
ssh -l root ${PRIMARY} "mkdir -p ${BASE}/bind/dynamic/"
ssh -l root ${PRIMARY} "mkdir -p ${BASE}/dhcp/conf.d/"
-ssh -l root ${PRIMARY} "~/tgmanage/tools/make-dhcp6-init.sh"
-ssh -l root ${PRIMARY} "~/tgmanage/tools/make-named.pl master ${BASE}"
-ssh -l root ${PRIMARY} "~/tgmanage/tools/make-dhcpd.pl ${BASE}"
-ssh -l root ${PRIMARY} "~/tgmanage/tools/make-first-zones.pl ${BASE}"
-ssh -l root ${PRIMARY} "~/tgmanage/tools/make-reverse4-files.pl master ${BASE}"
+ssh -l root ${PRIMARY} "~/tgmanage/bootstrap/make-dhcp6-init.sh"
+ssh -l root ${PRIMARY} "~/tgmanage/bootstrap/make-named.pl master ${BASE}"
+ssh -l root ${PRIMARY} "~/tgmanage/bootstrap/make-dhcpd.pl ${BASE}"
+ssh -l root ${PRIMARY} "~/tgmanage/bootstrap/make-first-zones.pl ${BASE}"
+ssh -l root ${PRIMARY} "~/tgmanage/bootstrap/make-reverse4-files.pl master ${BASE}"
ssh -l root ${SECONDARY} "mkdir -p ${BASE}/dhcp/conf.d/"
ssh -l root ${SECONDARY} "mkdir -p ${BASE}/bind/conf-slave/"
ssh -l root ${SECONDARY} "mkdir -p ${BASE}/bind/slave/"
-ssh -l root ${SECONDARY} "~/tgmanage/tools/make-dhcp6-init.sh"
+ssh -l root ${SECONDARY} "~/tgmanage/bootstrap/make-dhcp6-init.sh"
ssh -l root ${SECONDARY} "insserv -r isc-dhcp-server"
-ssh -l root ${SECONDARY} "~/tgmanage/tools/make-dhcpd.pl ${BASE}"
-ssh -l root ${SECONDARY} "~/tgmanage/tools/make-named.pl slave ${BASE}"
-ssh -l root ${SECONDARY} "~/tgmanage/tools/make-reverse4-files.pl slave ${BASE}"
+ssh -l root ${SECONDARY} "~/tgmanage/bootstrap/make-dhcpd.pl ${BASE}"
+ssh -l root ${SECONDARY} "~/tgmanage/bootstrap/make-named.pl slave ${BASE}"
+ssh -l root ${SECONDARY} "~/tgmanage/bootstrap/make-reverse4-files.pl slave ${BASE}"
set +e
ssh -l root ${PRIMARY} "chown -R bind.bind ${BASE}/bind"
@@ -69,6 +70,6 @@ ssh -l root ${SECONDARY} "echo THIS COPY OF TGMANAGE IS MANAGED FROM BOOTSTRAP S
tools/update-baseservice.sh ${BASE}
# Set up PXE environment. NOTE that we assume that TFTP-server is the ${SECONDARY} (changed from older behaviour)
-ssh -l root ${SECONDARY} "~/tgmanage/tools/make-pxeboot.sh"
+ssh -l root ${SECONDARY} "~/tgmanage/bootstrap/make-pxeboot.sh"
# all done.
diff --git a/tools/make-dhcp6-init.sh b/bootstrap/make-dhcp6-init.sh
index 468c973..468c973 100755
--- a/tools/make-dhcp6-init.sh
+++ b/bootstrap/make-dhcp6-init.sh
diff --git a/tools/make-dhcpd.pl b/bootstrap/make-dhcpd.pl
index d734c1d..d734c1d 100755
--- a/tools/make-dhcpd.pl
+++ b/bootstrap/make-dhcpd.pl
diff --git a/tools/make-first-zones.pl b/bootstrap/make-first-zones.pl
index 7d6d9f4..7d6d9f4 100755
--- a/tools/make-first-zones.pl
+++ b/bootstrap/make-first-zones.pl
diff --git a/tools/make-named.pl b/bootstrap/make-named.pl
index a9ea02d..a9ea02d 100755
--- a/tools/make-named.pl
+++ b/bootstrap/make-named.pl
diff --git a/tools/make-pxeboot.sh b/bootstrap/make-pxeboot.sh
index 86a2a4a..4a9e271 100755
--- a/tools/make-pxeboot.sh
+++ b/bootstrap/make-pxeboot.sh
@@ -22,7 +22,7 @@ END
mkdir -p /var/lib/tftpboot
# NOTE, this step depends on an SCP of basic content from the bootstrap...
-# This should be done by tools/update-tools ...
+# This should be done by bootstrap/update-tools ...
cp -R ~/tgmanage/pxe/* /var/lib/tftpboot
~/tgmanage/tools/fetch-debinstall.sh /var/lib/tftpboot/debian
diff --git a/tools/make-reverse4-files.pl b/bootstrap/make-reverse4-files.pl
index bbb2d7c..bbb2d7c 100755
--- a/tools/make-reverse4-files.pl
+++ b/bootstrap/make-reverse4-files.pl
diff --git a/tools/update-baseservice.sh b/bootstrap/update-baseservice.sh
index 94c3875..94c3875 100755
--- a/tools/update-baseservice.sh
+++ b/bootstrap/update-baseservice.sh
diff --git a/tools/update-tools.sh b/bootstrap/update-tools.sh
index 86f8125..9878f8f 100755
--- a/tools/update-tools.sh
+++ b/bootstrap/update-tools.sh
@@ -9,6 +9,8 @@ then
exit 1;
fi;
+cd ~/tgmanage
+
ssh -l root ${PRIMARY} "mkdir -p ~/tgmanage"
ssh -l root ${SECONDARY} "mkdir -p ~/tgmanage"
@@ -17,7 +19,7 @@ scp -r tools root@${PRIMARY}:tgmanage/
scp -r tools root@${SECONDARY}:tgmanage/
scp -r include root@${PRIMARY}:tgmanage/
scp -r include root@${SECONDARY}:tgmanage/
-scp -r clients root@${PRIMARY}:tgmanage/
-scp -r clients root@${SECONDARY}:tgmanage/
-scp -r pxe root@${SECONDARY}:tgmanage/
+export $TGNAME
+last_year=`perl -e '($y)=($ENV{TGNAME} =~ m/^tg(\d\d)$/); $y--; print "tg$y"'`
+scp -r examples/$last_year/pxe root@${SECONDARY}:tgmanage/