forked from sjqzhang/webtech
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_cobbler
98 lines (80 loc) · 3.65 KB
/
install_cobbler
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
## Copyright 2011 Armens Movsesjans [email protected]
# License: GNU General Public License, version 2 or later
# for AwaseConfigurations Project
# http://awaseconfigurations.wordpress.com/
# https://github.com/AwaseConfigurations/main
# This is a whole cobbler / fabric setup script for room 1
sudo echo 'bonjour!!'
#create a temp folder
mkdir ~/cobbler_wgets
cd ~/cobbler_wgets
#download preconfigured cobbler setup files and scripts from github:awaseconfigurations
#download ubuntu-11.04-alternate-i386.iso
wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/settings
wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/interfaces
wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/dhcp_all.template
wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/cobbler_add_systems_all.sh
#wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/cobbler_add_systems_server_1.sh
wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/ubuntu-nqa-ws.seed
#wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/ubuntu-nqa-server.seed
wget https://raw.github.com/AwaseConfigurations/main/master/cobbler/wakeup_all.sh
wget http://releases.ubuntu.com/natty/ubuntu-11.04-alternate-i386.iso
#wget http://releases.ubuntu.com/natty/ubuntu-11.04-server-i386.iso
#enable universe repo and install packages
sudo software-properties-gtk -e universe
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -y install dhcp3-server cobbler cobbler-common wakeonlan rcconf
#start cobbler and build its configuration
sudo service cobbler start
sleep 1
sudo cobbler check
#copy setup files to where they belong
sudo cp interfaces /etc/network/
sudo /etc/init.d/networking restart
sudo cp settings /etc/cobbler/
sudo cp dhcp_all.template /etc/cobbler/dhcp.template
sudo cp ubuntu-nqa-ws.seed /var/lib/cobbler/kickstarts/
#sudo cp ubuntu-nqa-server.seed /var/lib/cobbler/kickstarts/
#restart and rebuild cobbler
sudo service cobbler restart
sleep 1
sudo cobbler sync
#mount ubuntu images, ipport them with cobbler, and assign preconfigured preseeds
#sudo mkdir /mnt/server
sudo mkdir /mnt/ws
sudo mount -o loop ubuntu-11.04-alternate-i386.iso /mnt/ws
sudo cobbler import --name=ubuntu-alternate --path=/mnt/ws --breed=ubuntu
sudo cobbler profile edit --name=ubuntu-alternate-i386 --kickstart=/var/lib/cobbler/kickstarts/ubuntu-nqa-ws.seed --kopts="priority=critical locale=en_US"
#sudo mount -o loop ubuntu-11.04-server-i386.iso /mnt/server
#sudo cobbler import --name=ubuntu-server --path=/mnt/server --breed=ubuntu
#sudo cobbler profile edit --name=ubuntu-server-i386 --kickstart=/var/lib/cobbler/kickstarts/ubuntu-nqa-server.seed --kopts="priority=critical locale=en_US"
#restart and rebuild cobbler
sudo service cobbler restart
sleep 1
sudo cobbler sync
#run the script to add systems (machines) to same profile as preseed
#they will then pick this network install by default
chmod u+x cobbler_add_systems_all.sh
#chmod u+x cobbler_add_systems_server_1.sh
./cobbler_add_systems_all.sh
#./cobbler_add_systems_server_1.sh
#restart and rebuild cobbler
sudo service cobbler restart
sleep 1
sudo cobbler sync
#run the script to wake all up
chmod u+x wakeup_all.sh
./wakeup_all.sh
#make sure dhcp-server is off next time this machine is booted (our lab's requirements)
sudo rcconf --off isc-dhcp-server
#wait for all machines to complete installation
sleep 600
#setup fabric
wget https://raw.github.com/AwaseConfigurations/main/master/scripts/getfabric
chmod u+x getfabric
./getfabric
#generate pair of keys [if absent], put public key to workstations
fab pubkey_distribute
#run fabrics init and main tasks
fab init
fab main