forked from eucalyptus/load-balancer-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eucalyptus-load-balancer-image-devel.ks.in
215 lines (191 loc) · 4.41 KB
/
eucalyptus-load-balancer-image-devel.ks.in
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Copyright 2009-2013 Eucalyptus Systems, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 3 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/.
#
# Please contact Eucalyptus Systems, Inc., 6755 Hollister Ave., Goleta
# CA 93117, USA or visit http://www.eucalyptus.com/licenses/ if you need
# additional information or have any questions.
#
# Eucalyptus Loadbalancer Development Image
#
# This image is meant solely for development purposes. Each time an instance
# is started the latest load-balancer-servo code will be pulled down from
# github.
#
lang en_US.UTF-8
keyboard us
skipx
timezone UTC
auth --useshadow --enablemd5
selinux --permissive
firewall --disabled
bootloader --timeout=1 --append xen_blkfront.sda_is_xvda=1
network --bootproto=dhcp --device=eth0 --onboot=on
services --enabled=network,ntpd,ntpdate
#
# Provide a default password for developer access
rootpw foobar
#
# Provide a little more room for development purposes
part / --size 1024 --fstype ext3
#
# Templated Repository Entries
{% for (name, urltype, url) in repos %}
repo --name={{ name }} --{{ urltype }}={{ url }}
{% endfor %}
#
#
# Add all the packages after the base packages
#
%packages --nobase --excludedocs --instLangs=en
@core
acpid
audit
bash
chkconfig
cloud-init
coreutils
curl
e2fsprogs
grub
kernel-xen
ntp
ntpdate
openssh-clients
openssh-server
passwd
pciutils
policycoreutils
rootfiles
sudo
system-config-firewall-base
system-config-securitylevel-tui
#
# servo packages
haproxy # Version 1.5 required
python-boto # Version 2.8.0 required
python-httplib2
#
# development tools
git
ipython
pylint
vim-enhanced
#
# Package exclusions
-atmel-firmware
-b43-openfwwf
-cyrus-sasl
-postfix
-sysstat
-xorg-x11-drv-ati-firmware
-yum-utils
-ipw2100-firmware
-ipw2200-firmware
-ivtv-firmware
-iwl1000-firmware
-iwl3945-firmware
-iwl4965-firmware
-iwl5000-firmware
-iwl5150-firmware
-iwl6000-firmware
-iwl6050-firmware
-libertas-usb8388-firmware
-rt61pci-firmware
-rt73usb-firmware
-mysql-libs
-zd1211-firmware
-ql2100-firmware
-ql2200-firmware
-ql23xx-firmware
-ql2400-firmware
-ql2500-firmware
-aic94xx-firmware
-iwl6000g2a-firmware
-iwl100-firmware
-bfa-firmware
%end
#
# Configure cloud-init
%post --erroronfail
cat > /etc/cloud/cloud.cfg << EOF
user: root
disable_root: 0
ssh_pwauth: 1
# Mounts for instance-store
mounts:
- [ ephemeral0, /mnt ]
- [ swap, none, swap, sw, 0, 0 ]
cc_ready_cmd: ['/bin/true']
locale_configfile: /etc/sysconfig/i18n
mount_default_fields: [~, ~, 'auto', 'defaults,nofail', '0', '2']
ssh_deletekeys: 0
ssh_genkeytypes: ~
ssh_svcname: sshd
syslog_fix_perms: ~
cloud_init_modules:
- bootcmd
- resizefs
- set_hostname
- rsyslog
- ssh
cloud_config_modules:
- mounts
- ssh-import-id
- locale
- set-passwords
- timezone
- disable-ec2-metadata
- runcmd
cloud_final_modules:
- scripts-per-once
- scripts-per-boot
- scripts-per-instance
- scripts-user
- keys-to-console
- phone-home
- final-message
# vim:syntax=yaml
EOF
%end
#
# Fix sudo settings so that servo is able to start haproxy without a tty
%post --erroronfail
sed -i '/requiretty/s/^/#/' /etc/sudoers
sed -i '/!visiblepw/s/^/#/' /etc/sudoers
%end
#
# Disable zeroconf
%post --erroronfail
echo "NOZEROCONF=yes" >> /etc/sysconfig/network
%end
#
# Add cloud-init script that will bootstrap the load-balancer-servo package for us
%post --erroronfail
mkdir -p /var/lib/cloud/scripts/per-boot
cat > /var/lib/cloud/scripts/per-boot/bootstrap-servo.sh << EOF
#!/bin/bash
BOTO_VERSION=\$(rpm -q --queryformat="%{version}" python-boto)
if [ \$? -ne 0 ] || [ "\$BOTO_VERSION" != "2.8.0" ]; then
# Install correct boto library since we don't have it
easy_install https://pypi.python.org/packages/source/b/boto/boto-2.8.0.tar.gz
fi
# Grab latest servo code
git clone git://github.com/eucalyptus/load-balancer-servo.git /opt/load-balancer-servo
cd /opt/load-balancer-servo
# Install and run
./install-servo.sh
service load-balancer-servo start
EOF
chmod 755 /var/lib/cloud/scripts/per-boot/bootstrap-servo.sh
%end