blob: 1cd565366415bcc1932dceffc1207a725391460d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
#!/bin/bash
set -e
BASE="/etc";
if [ "$1" != "" ]
then
BASE=$1
echo "Using base path ${BASE}"
fi
source include/tgmanage.cfg.sh
if [ -z ${PRIMARY} ]
then
echo "Not configured!";
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"
if [ "${BASE}" == "/etc" ]; then
ssh -l root ${PRIMARY} "cp -pR /etc/bind /etc/bind.dist"
ssh -l root ${PRIMARY} "cp -pR /etc/dhcp /etc/dhcp.dist"
ssh -l root ${SECONDARY} "cp -pR /etc/bind /etc/bind.dist"
set +e
ssh -l root ${PRIMARY} "rm /etc/bind/named.conf"
ssh -l root ${PRIMARY} "rm /etc/dhcp/dhcpd.conf"
ssh -l root ${SECONDARY} "rm /etc/bind/named.conf"
set -e
fi
ssh -l root ${PRIMARY} "mkdir -p ${BASE}/bind/conf-master/"
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-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 ${SECONDARY} "mkdir -p ${BASE}/bind/conf-slave/"
ssh -l root ${SECONDARY} "mkdir -p ${BASE}/bind/slave/"
ssh -l root ${SECONDARY} "~/tgmanage/tools/make-named.pl slave ${BASE}"
ssh -l root ${SECONDARY} "~/tgmanage/tools/make-reverse4-files.pl slave ${BASE}"
set +e
ssh -l root ${PRIMARY} "chown -R bind.bind ${BASE}/bind"
ssh -l root ${SECONDARY} "chown -R bind.bind ${BASE}/bind"
set -e
ssh -l root ${PRIMARY} "echo THIS COPY OF TGMANAGE IS MANAGED FROM BOOTSTRAP SERVER > ~/tgmanage/NOTICE"
ssh -l root ${SECONDARY} "echo THIS COPY OF TGMANAGE IS MANAGED FROM BOOTSTRAP SERVER > ~/tgmanage/NOTICE"
# No point in _not_ running update-baseservice at this point....
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"
# all done.
|