Merge lp:~thomnico/orange-box/mirror-dev into lp:orange-box

Proposed by Nicolas Thomas
Status: Needs review
Proposed branch: lp:~thomnico/orange-box/mirror-dev
Merge into: lp:orange-box
Diff against target: 2555 lines (+747/-727)
42 files modified
debian/changelog (+73/-11)
debian/control (+13/-8)
debian/install (+3/-0)
debian/links (+1/-1)
debian/postinst (+0/-310)
debian/postrm (+0/-23)
debian/preinst (+0/-136)
debian/source/format (+1/-1)
etc/apache2/sites-available/archive.conf (+0/-13)
etc/apache2/sites-available/archive.ubuntu.com.conf (+14/-0)
etc/apache2/sites-available/cdimage.ubuntu.com.conf (+14/-0)
etc/apache2/sites-available/cloud-images.ubuntu.com.conf (+14/-0)
etc/apache2/sites-available/ports.ubuntu.com.conf (+14/-0)
etc/apache2/sites-available/releases.ubuntu.com.conf (+14/-0)
etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf (+12/-0)
etc/apache2/sites-available/ubuntu-cloud.conf (+0/-12)
etc/apt/orange-box-mirror.list (+43/-20)
etc/bind/named.conf.wildcard-archive (+6/-0)
etc/bind/zones.wildcard-archive (+20/-0)
etc/cron.d/charmstore-mirror (+0/-4)
etc/cron.d/orange-box-mirror (+0/-1)
etc/debconf-selections (+0/-2)
etc/orangebox-mirror.state (+1/-0)
etc/ucloudexclude.list (+26/-0)
usr/bin/orange-box-add-node (+7/-4)
usr/bin/orange-box-add-physical-nodes (+7/-2)
usr/bin/orange-box-add-virtual-nodes (+24/-12)
usr/bin/orange-box-amt-monitor (+3/-1)
usr/bin/orange-box-apm-power-fix (+0/-38)
usr/bin/orange-box-bootstrap-juju (+5/-1)
usr/bin/orange-box-create-package-mirror (+14/-1)
usr/bin/orange-box-demo-cleanup (+3/-1)
usr/bin/orange-box-hacks (+32/-0)
usr/bin/orange-box-mirror (+235/-0)
usr/bin/orange-box-purge-everything (+1/-0)
usr/bin/orange-box-resetproxy (+34/-0)
usr/bin/orange-box-run (+21/-18)
usr/bin/orange-box-setup-nat (+0/-99)
usr/bin/orange-box-status-all-nodes (+11/-8)
usr/lib/orange-box/templates/mirror-bind/named.conf.template (+6/-0)
usr/lib/orange-box/templates/mirror-bind/zones.template (+17/-0)
usr/lib/orange-box/templates/ubumirror.conf (+58/-0)
To merge this branch: bzr merge lp:~thomnico/orange-box/mirror-dev
Reviewer Review Type Date Requested Status
Orange Box Pending
Review via email: mp+264038@code.launchpad.net

Description of the change

This branch (include 2.9 modif new net as not accepted yet) ..

It add orange-box-mirror cli to sync/enable etc mirroring most of the software used.

To post a comment you must log in.
lp:~thomnico/orange-box/mirror-dev updated
546. By Nicolas Thomas

Fix zone issue
Fix ssh-keyscan for maas asking user intervention

547. By Nicolas Thomas

fix default to em1 for internal_interface

548. By Nicolas Thomas

Rebase on ~cpe-sa/orange-box/staging for collaborating with other SAs

* Enable local mirroring
* Reduce the number of dns redirects
* remove dep on ubumirror and do a faster sync to cloud-images
* use lftp instead of apt-mirror for cloud-archive
[ Nicolas Thomas ]
* Adding support for mirror

Unmerged revisions

548. By Nicolas Thomas

Rebase on ~cpe-sa/orange-box/staging for collaborating with other SAs

* Enable local mirroring
* Reduce the number of dns redirects
* remove dep on ubumirror and do a faster sync to cloud-images
* use lftp instead of apt-mirror for cloud-archive
[ Nicolas Thomas ]
* Adding support for mirror

547. By Nicolas Thomas

fix default to em1 for internal_interface

546. By Nicolas Thomas

Fix zone issue
Fix ssh-keyscan for maas asking user intervention

545. By Nicolas Thomas

updates on ssh maas to ubuntu automation

modified:
  debian/changelog
  usr/bin/orange-box-add-virtual-nodes

544. By Nicolas Thomas

releasing 2.9~ppa2

543. By Nicolas Thomas

Update source/format so zbr-buildpackages works
make ssh works correctly in add-virutal-nodes

modified:
  debian/source/format
  usr/bin/orange-box-add-virtual-nodes

542. By Nicolas Thomas

releasing 2.9~ppa1

541. By Nicolas Thomas

releasing 2.8~ppa1

540. By Nicolas Thomas

* Add biosdevname cmd in scripts
* Add a check/heal for VMs powermanagement ssh keys
*

539. By Nicolas Thomas

releasing 2.8ubuntu1~trusty

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/changelog'
--- debian/changelog 2015-01-21 22:04:42 +0000
+++ debian/changelog 2015-07-17 17:14:52 +0000
@@ -1,20 +1,82 @@
1orange-box (1.90) unreleased; urgency=medium1orange-box (2.10~ppa6) UNRELEASED; urgency=medium
22
3 * etc/apt/orange-box-mirror.list, usr/bin/orange-box-create-package-3 * Enable local mirroring
4 mirror:4 * Reduce the number of dns redirects
5 - we're not currently using postmirror.sh, so set to /bin/true5 * remove dep on ubumirror and do a faster sync to cloud-images
66 * use lftp instead of apt-mirror for cloud-archive
7 -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 09 Jan 2015 11:13:51 -06007
88 -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 23:24:05 +0200
9orange-box (1.89-0ubuntu1) vivid; urgency=medium9
1010orange-box (2.9ubuntu1~trusty) trusty; urgency=medium
11
12 * Change source/format for bzr-buildpackage to work
13 * Fix issue with the ssh checking for power management of VMs
14 *
15 *
16
17 -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 13:32:06 +0200
18
19orange-box (2.9-0ubuntu1) trusty; urgency=medium
20
21 * Add biosdevname cmd in scripts
22 * Add a check/heal for VMs powermanagement ssh keys
23 *
24
25 -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 10:40:23 +0200
26
27orange-box (2.8ubuntu1~trusty-0ubuntu1) trusty; urgency=medium
28
29 [ Nicolas Thomas ]
30 * Remove synccharmstore etc..
31 * Adapt a number of changes to network setup etc..
32 * Assume ob number in preinst and check in postinst in case network is not up
33 * preinst bridgeutils
34
35 -- Nicolas Thomas <nicolas.thomas@canonical.com> Thu, 11 Jun 2015 20:59:08 +0200
36
37orange-box (2.7) trusty; urgency=medium
38
39 [ Takenori Matsumoto ]
40 * usr/bin/orange-box-setup-nat:
41 - Fix net.ipv4.conf.all.accept_redirects
42 * usr/bin/orange-box-add-virtual-node
43 - Fix Add maas's ssh key into /home/ubuntu/.ssh/authorized_keys so that MAAS can control power via virsh
44
45 -- Takenori Matsumoto <takenori.matsumoto@canonical.com> Fri, 02 May 2015 14:13:51 -0600
46
47orange-box (2.6) trusty; urgency=medium
48
49 [ Takenori Matsumoto ]
50 * Re-write pachtes based on PPA (orange-box_1.89-0ubuntu1~trusty.debian.tar.xz, orange-box_1.89.orig.tar.gz) rather than trunk codes
51
52 [ takenori ]
53 * usr/bin/orange-box-add-virtual-nodes:
54 * usr/bin/orange-box-add-virtual-nodes:
55 * usr/bin/orange-box-add-virtual-nodes:
56 * :
57
58 -- Takenori Matsumoto <takenori.matsumoto@canonical.com> Fri, 02 May 2015 01:13:51 -0600
59
60orange-box (1.90-0mirror-0ubuntu1) utopic; urgency=medium
61
62 [ Nicolas Thomas ]
63 * Adding support for mirror
64
65 -- thomas <nicolas.thomas@canonical.com> Sat, 17 Jan 2015 00:31:37 +0100
66
67orange-box (1.89-0ubuntu1~trusty) trusty; urgency=medium
68
69 [ Dustin Kirkland ]
11 * usr/bin/orange-box-bootstrap-juju:70 * usr/bin/orange-box-bootstrap-juju:
12 - go back to --upload-tools, please keep this!71 - go back to --upload-tools, please keep this!
13 * usr/bin/orange-box-add-virtual-nodes:72 * usr/bin/orange-box-add-virtual-nodes:
14 - use ~maas rather than hard coding to /home/maas73 - use ~maas rather than hard coding to /home/maas
15 + note that maas 1.7 has created a home directory in /var/lib/maas74 + note that maas 1.7 has created a home directory in /var/lib/maas
1675
17 -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 09 Jan 2015 11:13:49 -060076 [ takenori ]
77 * :
78
79 -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 29 Oct 2014 09:58:53 -0500
1880
19orange-box (1.88-0ubuntu1) unstable; urgency=medium81orange-box (1.88-0ubuntu1) unstable; urgency=medium
2082
2183
=== modified file 'debian/control'
--- debian/control 2014-09-24 12:15:15 +0000
+++ debian/control 2015-07-17 17:14:52 +0000
@@ -3,13 +3,17 @@
3Priority: optional3Priority: optional
4Maintainer: Dustin Kirkland <kirkland@ubuntu.com>4Maintainer: Dustin Kirkland <kirkland@ubuntu.com>
5Build-Depends: debhelper (>= 7.0.50~),5Build-Depends: debhelper (>= 7.0.50~),
6Standards-Version: 3.9.46Standards-Version: 3.9.5
7Homepage: http://launchpad.net/orange-box7Homepage: http://launchpad.net/orange-box
88
9Package: orange-box9Package: orange-box
10Architecture: all10Architecture: all
11Pre-Depends:11Pre-Depends:
12 run-one,12 run-one,
13 maas,
14 maas-cluster-controller,
15 nmap,
16 bridge-utils,
13Depends: ${misc:Depends},17Depends: ${misc:Depends},
14 amtterm,18 amtterm,
15 apache2,19 apache2,
@@ -27,10 +31,7 @@
27 libglib2.0-bin,31 libglib2.0-bin,
28 libvirt-bin,32 libvirt-bin,
29 openssh-server,33 openssh-server,
30 maas,
31 maas-cluster-controller,
32 network-manager,34 network-manager,
33 nmap,
34 pastebinit,35 pastebinit,
35 qemu-kvm,36 qemu-kvm,
36 remmina,37 remmina,
@@ -43,12 +44,16 @@
43 vlan,44 vlan,
44 wsmancli,45 wsmancli,
45 x11vnc,46 x11vnc,
46Recommends:47 biosdevname,
47 landscape-client,48 lftp,
49 rsync,
50 simplestreams,
48 python-keystone,51 python-keystone,
49 python-neutronclient,52 python-neutronclient,
50 python-novaclient,53 python-novaclient,
51 python-glanceclient54 python-glanceclient,
55Recommends:
56 landscape-client,
52Description: Orange Box master node easy installation57Description: Orange Box master node easy installation
53 This package can be installed on an Ubuntu Orange Box's master node58 This package can be installed on an Ubuntu Orange Box's master node
54 to automatically configure MAAS and Juju.59 to automatically configure MAAS and Juju.
5560
=== added file 'debian/install'
--- debian/install 1970-01-01 00:00:00 +0000
+++ debian/install 2015-07-17 17:14:52 +0000
@@ -0,0 +1,3 @@
1etc/
2home/
3usr/
04
=== modified file 'debian/links'
--- debian/links 2014-05-08 23:10:25 +0000
+++ debian/links 2015-07-17 17:14:52 +0000
@@ -1,1 +1,1 @@
1/usr/bin/orange-box-setup-nat /etc/network/if-up.d/orange-box-setup-nat1
22
=== added file 'debian/postinst'
--- debian/postinst 1970-01-01 00:00:00 +0000
+++ debian/postinst 2015-07-17 17:14:52 +0000
@@ -0,0 +1,332 @@
1#!/bin/bash
2
3set -e
4set -x
5
6PKG="orange-box"
7RETRY=120
8
9. /usr/lib/orange-box/inc/common
10. /etc/orange-box.conf
11
12check_orangebox_number() {
13## be sure to wake AMT first give some time and ping again.
14nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 > /dev/null
15sleep 12
16nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 > /dev/null
17NUMAMTS=`nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 |grep open |wc -l`
18[[ $NUMAMTS < 3 ]] && (echo "AMT or hostname not set correctly"; rm -f /etc/orange-box.conf;exit 2)
19true
20}
21
22
23router_ip=172.27.${orangebox_number}.1
24static_low=172.27.`expr ${orangebox_number} + 2`.1
25static_high=172.27.`expr ${orangebox_number} + 2`.254
26dhcp_low=172.27.`expr ${orangebox_number} + 1`.1
27dhcp_high=172.27.`expr ${orangebox_number} + 1`.254
28br0_broadcast=172.27.`expr ${orangebox_number} + 3`.255
29
30setup_maas_admin() {
31 # Configure the MAAS admin user
32 # Sadly, there's no way to test if the user has been created already,
33 # so ignore errors for idempotence
34 maas-region-admin createadmin --username admin --email maas-admin@example.com --password="admin" 2>/dev/null || true
35 . /etc/maas/maas_cluster.conf
36 APIKEY=$(maas-region-admin apikey --username admin | tail -n1)
37 maas login admin $MAAS_URL $APIKEY
38}
39
40setup_maas_networking() {
41 count=0
42 while ! maas admin node-group-interfaces list $CLUSTER_UUID >/dev/null 2>&1; do
43 count=$((count+1))
44 sleep 1
45 if [ $count -gt $RETRY ]; then
46 error "[maas admin node-group-interfaces list] failed [$RETRY] times"
47 fi
48 done
49 internal_interface=$(route -n | grep "^172\.27\.${orangebox_number}\." | sed -e "s/.* //")
50 # Support MAAS 1.5, and 1.6
51 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
52 if dpkg --compare-versions $maas_ver lt 1.6; then
53 maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=$static_low ip_range_high=$static_high management=2 broadcast_ip=$br0_broadcast router_ip=$router_ip
54
55 else
56 sh -x /var/lib/dpkg/info/maas-dns.postinst configure
57 run-one-until-success maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=$dhcp_low ip_range_high=$dhcp_high static_ip_range_low=$static_low static_ip_range_high=$static_high management=2 broadcast_ip=$br0_broadcast router_ip=$router_ip
58
59 fi
60 # Setup nat
61 # Ensure we have an external connection
62 orange-box-test-uplink
63 orange-box-setup-nat
64 # Redirect to MAAS web interface
65 cat >/var/www/html/index.html <<EOF
66<meta http-equiv="refresh" content="0; url=/MAAS">
67EOF
68}
69
70setup_dns() {
71 # Set MAAS upstream DNS
72 maas admin maas set-config name=upstream_dns value=172.27.252.1
73 sed -i -e "/^nameserver ${router_ip}$/d" /etc/resolvconf/resolv.conf.d/head
74 echo "nameserver ${router_ip}" >> /etc/resolvconf/resolv.conf.d/head
75 resolvconf -u
76 sed -e 's/dnssec-validation auto;/dnssec-enable no;dnssec-validation no;/g' -i /etc/bind/named.conf.options
77}
78
79setup_squid() {
80 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
81 if dpkg --compare-versions $maas_ver lt 1.6; then
82 # This is now a transparent proxy
83 if [ -d "/etc/squid-deb-proxy" ]; then
84 echo > /etc/squid-deb-proxy/squid-deb-proxy.conf
85 fi
86 cat /usr/lib/orange-box/inc/squid.conf > /etc/squid3/squid.conf
87 # Enable squid3, disable squid-deb-proxy
88 update-rc.d -f squid-deb-proxy remove || true
89 invoke-rc.d squid-deb-proxy stop || true
90 # Create directories, if necessary
91 squid3 -z -N || true
92 ensure_running squid3
93 fi
94 true
95}
96
97setup_local_mirror() {
98 # Set up the local mirror
99# a2ensite archive
100# a2ensite ubuntu-cloud
101# Must enable this to make sstream and others works
102 a2ensite 000-default
103 mkdir -p /srv/mirrors/archive.ubuntu.com
104 echo '<meta http-equiv="refresh" content="0; url=MAAS/">' > /srv/mirrors/archive.ubuntu.com/index.html
105 invoke-rc.d apache2 stop || true
106 invoke-rc.d apache2 start
107}
108
109setup_boot_resources() {
110 # Importing boot resources
111 # This might take a long time.
112 # MAAS won't work very well until this is done, so we're going to block
113 # until this completes.
114 orange-box-test-uplink
115 # Support MAAS 1.5, and newer
116 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
117 if dpkg --compare-versions $maas_ver lt 1.6; then
118 cat /usr/lib/orange-box/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
119 run-this-one maas-import-pxe-files --config-file /etc/maas/bootresources.yaml
120 else
121 maas admin boot-resources import
122 while [ $(maas admin boot-images read $CLUSTER_UUID | wc -l) -lt 10 ]; do
123 # Waiting for images to download
124 sleep 10
125 done
126 # add precise to the list but don't wait it is not necessary now.
127 # usual failure is already there..
128 maas admin boot-source-selections create 1 os="ubuntu" release="precise" arches="amd64" subarches="*" labels="*" || true
129 maas admin boot-resources import
130 fi
131}
132
133setup_desktop() {
134 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.background picture-uri file:///usr/share/orange-box/orange-box-background.png
135 sudo -u ubuntu dbus-launch gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop', 'byobu.desktop', 'remmina.desktop']"
136 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.session idle-delay 999999
137 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
138 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
139 if [ -e /etc/lightdm/lightdm.conf ]; then
140 sed -i -e "/autologin-user=/d" /etc/lightdm/users.conf
141 echo "autologin-user=ubuntu" >> /etc/lightdm/users.conf
142 fi
143 echo "enabled=0" > /etc/default/apport
144 invoke-rc.d apport stop || true
145}
146
147setup_ssh_keys() {
148 # Disable remote password authentication, since our username/password
149 # combo is very well known
150 if ! grep -qs "^PasswordAuthentication no" /etc/ssh/sshd_config 2>/dev/null; then
151 echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
152 invoke-rc.d ssh stop || true
153 invoke-rc.d ssh start
154 fi
155 if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then
156 su -l ubuntu -c "ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa"
157 fi
158 maas admin sshkeys new key="$(cat /home/ubuntu/.ssh/id_rsa.pub)" || true
159 if ! grep -qs "^Host.*maas$" /home/ubuntu/.ssh/config; then
160 cat <<EOF >>/home/ubuntu/.ssh/config
161
162Host *.maas
163UserKnownHostsFile /dev/null
164StrictHostKeyChecking no
165CheckHostIP no
166
167EOF
168 fi
169 chmod 600 /home/ubuntu/.ssh/config
170 chown -R ubuntu:ubuntu /home/ubuntu/.ssh/config
171
172}
173
174setup_juju() {
175 mkdir -p /home/ubuntu/.juju
176 cat >/home/ubuntu/.juju/environments.yaml <<EOF
177default: maas
178environments:
179 maas:
180 type: maas
181 maas-server: 'http://${router_ip}/MAAS/'
182 maas-oauth: '$APIKEY'
183 default-series: trusty
184 #enable-os-upgrade: false
185 authorized-keys-path: /home/ubuntu/.ssh/id_rsa.pub
186 admin-secret: 'admin'
187 logging-config: '<root>=DEBUG'
188 lxc-clone: true
189EOF
190 rm -rf /home/ubuntu/.juju-plugins
191 git clone https://github.com/juju/plugins /home/ubuntu/.juju-plugins
192 sudo chown -R ubuntu:ubuntu /home/ubuntu/
193 echo "PATH=\$PATH:/home/ubuntu/.juju-plugins:/home/ubuntu/Examples/bin" >> /home/ubuntu/.bashrc
194 #Required for local charm deployments to work.
195 sed -i -e '/^export JUJU_REPOSITORY=/d' /home/ubuntu/.bashrc
196}
197
198ensure_running() {
199 job="$1"
200 count=1
201 while true; do
202 if (service $job status | grep -qs "running"); then
203 break
204 fi
205 invoke-rc.d $job start
206 sleep 1
207 count=$((count+1))
208 if [ $count -gt $RETRY ]; then
209 error "[$job] refused to start [$RETRY] times"
210 fi
211 done
212}
213
214ensure_running_maas() {
215 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
216 if dpkg --compare-versions $maas_ver lt 1.6; then
217 ensure_running maas-region-celery
218 ensure_running maas-cluster-celery
219 ensure_running maas-txlongpoll
220 ensure_running maas-pserv
221 ensure_running maas-dhcp-server
222 ensure_running squid3
223 else
224 ensure_running apache2
225 ensure_running maas-clusterd
226 ensure_running maas-dhcpd
227 ensure_running maas-proxy
228 fi
229 invoke-rc.d tgt stop || true
230 invoke-rc.d tgt start
231 ensure_running tgt
232}
233
234setup_all_nodes() {
235 # Ensure that pxe and dhcp are running
236 ensure_running_maas
237 maas admin node-groups import-boot-images
238 orange-box-add-physical-nodes
239 orange-box-add-virtual-nodes
240}
241
242apply_patches() {
243 # This is a DISGUSTING HACK that needs to go away
244 # as soon as MAAS ships these fixes
245 cd /
246 cat /usr/lib/orange-box/patches/acquire_languages_none.patch | patch -p0 -N || true
247 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
248 if dpkg --compare-versions $maas_ver lt 1.6; then
249 cat /usr/lib/orange-box/patches/arp_ip_order.patch | patch -p0 -N || true
250 cat /usr/lib/orange-box/patches/try_amt_harder.patch | patch -p0 -N || true
251 rm -f /usr/lib/python2.7/dist-packages/provisioningserver/utils/__init__.pyc
252 invoke-rc.d maas-cluster-celery stop || true
253 invoke-rc.d maas-cluster-celery start
254 fi
255 cd -
256}
257
258setup_landscape() {
259 # The master node will be managed by Landscape
260 # TODO: this is currently hardcoded to our own landscape account
261 if which landscape-config; then
262 case "$(hostname)" in
263 OrangeBox*|orangebox*)
264 landscape-config -a canonical-orange -t "$(hostname)__$(dmidecode -s baseboard-serial-number)" -p ubuntu-aubergine --script-users=ALL --silent --include-manager-plugins=ScriptExecution || true
265 ;;
266 esac
267 fi
268}
269
270setup_examples() {
271 mkdir -p /home/ubuntu
272 if [ -d /home/ubuntu/Examples/.bzr ]; then
273 bzr pull >/dev/null 2>&1 || true
274 elif [ -d /home/ubuntu/Examples ]; then
275 mv -f /home/ubuntu/Examples /home/ubuntu/.Examples
276 bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
277 else
278 bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
279 fi
280 chown -R ubuntu:ubuntu /home/ubuntu
281}
282
283case "$1" in
284 configure)
285 check_orangebox_number
286 setup_desktop
287 ###apply_patches
288 setup_maas_admin
289 setup_dns
290 if [ -n "$2" ]; then
291 echo
292 echo "INFO: Skipping importing boot resources, since this is a package upgrade"
293 echo "INFO: If you want to update boot resources, run:"
294 echo "INFO: sudo maas-import-pxe-files"
295 echo "INFO: sudo maas admin node-groups import-boot-images"
296 echo
297 else
298 setup_boot_resources
299 fi
300 setup_maas_networking
301 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
302 if dpkg --compare-versions $maas_ver lt 1.6; then
303 setup_squid
304 fi
305 setup_local_mirror
306 setup_ssh_keys
307 setup_juju
308 if [ -n "$2" ]; then
309 echo
310 echo "INFO: Skipping adding all nodes, since this is a package upgrade"
311 echo "INFO: If you want to delete and add all nodes again, run:"
312 echo "INFO: sudo orange-box-add-physical-nodes"
313 echo "INFO: sudo orange-box-add-virtual-nodes"
314 echo
315 else
316 # Only add all nodes and configure landscape on initial install, not upgrades
317 setup_landscape
318 setup_all_nodes
319 fi
320# setup_examples
321 ;;
322 abort-upgrade|abort-remove|abort-deconfigure)
323 ;;
324 *)
325 echo "postinst called with unknown argument \`$1'" >&2
326 exit 1
327 ;;
328esac
329
330#DEBHELPER#
331
332exit 0
0333
=== removed file 'debian/postinst'
--- debian/postinst 2014-11-27 23:56:37 +0000
+++ debian/postinst 1970-01-01 00:00:00 +0000
@@ -1,310 +0,0 @@
1#!/bin/sh
2
3set -e
4set -x
5
6PKG="orange-box"
7RETRY=120
8
9. /usr/lib/orange-box/inc/common
10
11setup_maas_admin() {
12 # Configure the MAAS admin user
13 # Sadly, there's no way to test if the user has been created already,
14 # so ignore errors for idempotence
15 maas-region-admin createadmin --username admin --email maas-admin@example.com --password="admin" 2>/dev/null || true
16 . /etc/maas/maas_cluster.conf
17 APIKEY=$(maas-region-admin apikey --username admin | tail -n1)
18 maas login admin $MAAS_URL $APIKEY
19}
20
21setup_maas_networking() {
22 count=0
23 while ! maas admin node-group-interfaces list $CLUSTER_UUID >/dev/null 2>&1; do
24 count=$((count+1))
25 sleep 1
26 if [ $count -gt $RETRY ]; then
27 error "[maas admin node-group-interfaces list] failed [$RETRY] times"
28 fi
29 done
30 internal_interface=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
31 # Support MAAS 1.5, and 1.6
32 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
33 if dpkg --compare-versions $maas_ver lt 1.6; then
34 maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=10.14.100.1 ip_range_high=10.14.199.254 management=2 broadcast_ip=10.14.255.255 router_ip=10.14.4.1
35 else
36 sh -x /var/lib/dpkg/info/maas-dns.postinst configure
37 run-one-until-success maas admin node-group-interface update $CLUSTER_UUID $internal_interface ip_range_low=10.14.50.1 ip_range_high=10.14.99.254 static_ip_range_low=10.14.100.1 static_ip_range_high=10.14.199.254 management=2 broadcast_ip=10.14.255.255 router_ip=10.14.4.1
38 fi
39 # Setup nat
40 # Ensure we have an external connection
41 orange-box-test-uplink
42 orange-box-setup-nat
43 # Redirect to MAAS web interface
44 cat >/var/www/html/index.html <<EOF
45<meta http-equiv="refresh" content="0; url=/MAAS">
46EOF
47}
48
49setup_dns() {
50 # Set MAAS upstream DNS
51 external_interface=$(ip route ls | grep ^default | awk '{print $5}')
52 dns=$(nmcli d list iface $external_interface | grep -m 1 "^IP4.DNS" | awk '{ print $2 }')
53 maas admin maas set-config name=upstream_dns value=$dns
54 sed -i -e "/^nameserver 10.14.4.1$/d" /etc/resolvconf/resolv.conf.d/head
55 echo "nameserver 10.14.4.1" >> /etc/resolvconf/resolv.conf.d/head
56 resolvconf -u
57 sed -e 's/dnssec-validation auto;/dnssec-enable no;dnssec-validation no;/g' -i /etc/bind/named.conf.options
58}
59
60setup_squid() {
61 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
62 if dpkg --compare-versions $maas_ver lt 1.6; then
63 # This is now a transparent proxy
64 if [ -d "/etc/squid-deb-proxy" ]; then
65 echo > /etc/squid-deb-proxy/squid-deb-proxy.conf
66 fi
67 cat /usr/lib/orange-box/inc/squid.conf > /etc/squid3/squid.conf
68 # Disable squid3, enable squid-deb-proxy
69 update-rc.d -f squid-deb-proxy remove || true
70 invoke-rc.d squid-deb-proxy stop || true
71 # Create directories, if necessary
72 squid3 -z -N || true
73 ensure_running squid3
74 fi
75 true
76}
77
78setup_local_mirror() {
79 # Set up the local mirror
80 a2ensite archive
81 a2ensite ubuntu-cloud
82 a2dissite 000-default
83 mkdir -p /srv/mirrors/archive.ubuntu.com
84 echo '<meta http-equiv="refresh" content="0; url=MAAS/">' > /srv/mirrors/archive.ubuntu.com/index.html
85 invoke-rc.d apache2 stop || true
86 invoke-rc.d apache2 start
87 # Sync the charm store to /srv/charmstore
88 # Note: This is going to take a LONG time
89 orange-box-sync-charmstore &
90}
91
92setup_boot_resources() {
93 # Importing boot resources
94 # This might take a long time.
95 # MAAS won't work very well until this is done, so we're going to block
96 # until this completes.
97 orange-box-test-uplink
98 # Support MAAS 1.5, and newer
99 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
100 if dpkg --compare-versions $maas_ver lt 1.6; then
101 cat /usr/lib/orange-box/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
102 run-this-one maas-import-pxe-files --config-file /etc/maas/bootresources.yaml
103 else
104 maas admin boot-resources import
105 while [ $(maas admin boot-images read $CLUSTER_UUID | wc -l) -lt 10 ]; do
106 # Waiting for images to download
107 sleep 10
108 done
109 fi
110}
111
112setup_desktop() {
113 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.background picture-uri file:///usr/share/orange-box/orange-box-background.png
114 sudo -u ubuntu dbus-launch gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop', 'byobu.desktop', 'remmina.desktop']"
115 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.session idle-delay 999999
116 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
117 sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
118 if [ -e /etc/lightdm/lightdm.conf ]; then
119 sed -i -e "/autologin-user=/d" /etc/lightdm/users.conf
120 echo "autologin-user=ubuntu" >> /etc/lightdm/users.conf
121 fi
122 echo "enabled=0" > /etc/default/apport
123 invoke-rc.d apport stop || true
124}
125
126setup_ssh_keys() {
127 # Disable remote password authentication, since our username/password
128 # combo is very well known
129 if ! grep -qs "^PasswordAuthentication no" /etc/ssh/sshd_config 2>/dev/null; then
130 echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
131 invoke-rc.d ssh stop || true
132 invoke-rc.d ssh start
133 fi
134 if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then
135 su -l ubuntu -c "ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa"
136 fi
137 maas admin sshkeys new key="$(cat /home/ubuntu/.ssh/id_rsa.pub)" || true
138 if ! grep -qs "^Host.*maas$" /home/ubuntu/.ssh/config; then
139 cat <<EOF >>/home/ubuntu/.ssh/config
140
141Host *.maas
142UserKnownHostsFile /dev/null
143StrictHostKeyChecking no
144CheckHostIP no
145
146EOF
147 fi
148 chmod 600 /home/ubuntu/.ssh/config
149 chown -R ubuntu:ubuntu /home/ubuntu/.ssh/config
150}
151
152setup_juju() {
153 mkdir -p /home/ubuntu/.juju
154 cat >/home/ubuntu/.juju/environments.yaml <<EOF
155default: maas
156environments:
157 maas:
158 type: maas
159 maas-server: 'http://10.14.4.1/MAAS/'
160 maas-oauth: '$APIKEY'
161 default-series: trusty
162 #enable-os-upgrade: false
163 authorized-keys-path: /home/ubuntu/.ssh/id_rsa.pub
164 admin-secret: 'admin'
165 logging-config: '<root>=DEBUG'
166 lxc-clone: true
167EOF
168 rm -rf /home/ubuntu/.juju-plugins
169 git clone https://github.com/juju/plugins /home/ubuntu/.juju-plugins
170 sudo chown -R ubuntu:ubuntu /home/ubuntu/
171 echo "PATH=\$PATH:/home/ubuntu/.juju-plugins:/home/ubuntu/Examples/bin" >> /home/ubuntu/.bashrc
172 #Required for local charm deployments to work.
173 sed -i -e '/^export JUJU_REPOSITORY=/d' /home/ubuntu/.bashrc
174 echo "export JUJU_REPOSITORY=/srv/charmstore" >> /home/ubuntu/.bashrc
175}
176
177ensure_running() {
178 job="$1"
179 count=1
180 while true; do
181 if (service $job status | grep -qs "running"); then
182 break
183 fi
184 invoke-rc.d $job start
185 sleep 1
186 count=$((count+1))
187 if [ $count -gt $RETRY ]; then
188 error "[$job] refused to start [$RETRY] times"
189 fi
190 done
191}
192
193ensure_running_maas() {
194 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
195 if dpkg --compare-versions $maas_ver lt 1.6; then
196 ensure_running maas-region-celery
197 ensure_running maas-cluster-celery
198 ensure_running maas-txlongpoll
199 ensure_running maas-pserv
200 ensure_running maas-dhcp-server
201 ensure_running squid3
202 else
203 ensure_running apache2
204 ensure_running maas-clusterd
205 ensure_running maas-dhcpd
206 ensure_running maas-proxy
207 fi
208 invoke-rc.d tgt stop || true
209 invoke-rc.d tgt start
210 ensure_running tgt
211}
212
213setup_all_nodes() {
214 # Ensure that pxe and dhcp are running
215 ensure_running_maas
216 maas admin node-groups import-boot-images
217 orange-box-add-physical-nodes
218 orange-box-add-virtual-nodes
219}
220
221apply_patches() {
222 # This is a DISGUSTING HACK that needs to go away
223 # as soon as MAAS ships these fixes
224 cd /
225 cat /usr/lib/orange-box/patches/acquire_languages_none.patch | patch -p0 -N || true
226 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
227 if dpkg --compare-versions $maas_ver lt 1.6; then
228 cat /usr/lib/orange-box/patches/arp_ip_order.patch | patch -p0 -N || true
229 cat /usr/lib/orange-box/patches/try_amt_harder.patch | patch -p0 -N || true
230 rm -f /usr/lib/python2.7/dist-packages/provisioningserver/utils/__init__.pyc
231 invoke-rc.d maas-cluster-celery stop || true
232 invoke-rc.d maas-cluster-celery start
233 fi
234 cd -
235}
236
237setup_landscape() {
238 # The master node will be managed by Landscape
239 # TODO: this is currently hardcoded to our own landscape account
240 if which landscape-config; then
241 case "$(hostname)" in
242 OrangeBox*|orangebox*)
243 landscape-config -a canonical-orange -t "$(hostname)__$(dmidecode -s baseboard-serial-number)" -p ubuntu-aubergine --script-users=ALL --silent --include-manager-plugins=ScriptExecution || true
244 ;;
245 esac
246 fi
247}
248
249setup_examples() {
250 mkdir -p /home/ubuntu
251 if [ -d /home/ubuntu/Examples/.bzr ]; then
252 bzr pull >/dev/null 2>&1 || true
253 elif [ -d /home/ubuntu/Examples ]; then
254 mv -f /home/ubuntu/Examples /home/ubuntu/.Examples
255 bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
256 else
257 bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
258 fi
259 chown -R ubuntu:ubuntu /home/ubuntu
260}
261
262case "$1" in
263 configure)
264 setup_desktop
265 apply_patches
266 setup_maas_admin
267 setup_dns
268 if [ -n "$2" ]; then
269 echo
270 echo "INFO: Skipping importing boot resources, since this is a package upgrade"
271 echo "INFO: If you want to update boot resources, run:"
272 echo "INFO: sudo maas-import-pxe-files"
273 echo "INFO: sudo maas admin node-groups import-boot-images"
274 echo
275 else
276 setup_boot_resources
277 fi
278 setup_maas_networking
279 maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
280 if dpkg --compare-versions $maas_ver lt 1.6; then
281 setup_squid
282 fi
283 setup_local_mirror
284 setup_ssh_keys
285 setup_juju
286 if [ -n "$2" ]; then
287 echo
288 echo "INFO: Skipping adding all nodes, since this is a package upgrade"
289 echo "INFO: If you want to delete and add all nodes again, run:"
290 echo "INFO: sudo orange-box-add-physical-nodes"
291 echo "INFO: sudo orange-box-add-virtual-nodes"
292 echo
293 else
294 # Only add all nodes and configure landscape on initial install, not upgrades
295 setup_landscape
296 setup_all_nodes
297 fi
298 setup_examples
299 ;;
300 abort-upgrade|abort-remove|abort-deconfigure)
301 ;;
302 *)
303 echo "postinst called with unknown argument \`$1'" >&2
304 exit 1
305 ;;
306esac
307
308#DEBHELPER#
309
310exit 0
3110
=== added file 'debian/postrm'
--- debian/postrm 1970-01-01 00:00:00 +0000
+++ debian/postrm 2015-07-17 17:14:52 +0000
@@ -0,0 +1,23 @@
1#!/bin/sh
2
3set -e
4
5webserver="apache2"
6
7case "$1" in
8 remove)
9 for i in archive ubuntu-cloud archive.ubuntu.com cdimage.ubuntu.com cloud-images.ubuntu.com ports.ubuntu.com releases.ubuntu.com ubuntu-cloud.archive.canonical.com; do
10 if [ -e "/etc/apache2/sites-enabled/${i}.conf" ]; then
11 a2dissite $i
12 fi
13 done
14 invoke-rc.d $webserver reload
15 rm -f /var/log/orange-box-mirror.log
16# rm -rf /etc/maas
17 rm -rf /var/lib/orange-box
18 ;;
19esac
20
21#DEBHELPER#
22
23exit 0
024
=== removed file 'debian/postrm'
--- debian/postrm 2014-07-17 04:12:46 +0000
+++ debian/postrm 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
1#!/bin/sh
2
3set -e
4
5webserver="apache2"
6
7case "$1" in
8 remove)
9 for i in archive ubuntu-cloud; do
10 if [ -e "/etc/apache2/sites-enabled/${i}.conf" ]; then
11 a2dissite $i
12 fi
13 done
14 invoke-rc.d $webserver reload
15 rm -f /var/log/orange-box-mirror.log
16 rm -rf /etc/maas
17 rm -rf /var/lib/orange-box
18 ;;
19esac
20
21#DEBHELPER#
22
23exit 0
240
=== added file 'debian/preinst'
--- debian/preinst 1970-01-01 00:00:00 +0000
+++ debian/preinst 2015-07-17 17:14:52 +0000
@@ -0,0 +1,168 @@
1#!/bin/sh
2set -e
3set -x
4
5get_orangebox_number() {
6## assume hostname as been set correctly .. will be checked in postinst
7OBNum=`hostname | cut -c 10- -`
8echo $OBNum
9echo "## Script generated file, others rely, know what your doing if tempering" > /etc/orange-box.conf
10echo "orangebox_number=$OBNum" >> /etc/orange-box.conf
11echo "orangebox_mirror=INIT">> /etc/orange-box.conf
12}
13
14### According to OB networking re-design
15orangebox_number=`get_orangebox_number`
16default_maas_ip=172.27.${orangebox_number}.1
17gateway_ip=172.27.252.1
18external_ip=172.27.252.${orangebox_number}
19internal_ip=172.27.${orangebox_number}.1
20br0_broadcast=172.27.`expr ${orangebox_number} + 3`.255
21
22#unnecessary comment
23
24preflight_checks() {
25 if [ "$(id -u ubuntu)" != "1000" ]; then
26 echo "ERROR: Read the docs; a proper OrangeBox setup requires the default user to be [ubuntu]" 1>&2
27 exit 1
28 fi
29 #ensure em1 is the correct name
30 biosdevname -i eth1 || (echo "biosdevname should have been run already assume it does"; true)
31 # TODO: Check that the AMTs are on static IPs
32 # TODO: Check dual hard drives, which one is which
33 # TODO: Ensure we have two interfaces, one internal, one external
34}
35
36setup_debconf() {
37 echo "debconf maas/default-maas-url string $default_maas_ip" | debconf-set-selections -
38 echo "debconf maas-cluster-controller/maas-url string http://${default_maas_ip}/MAAS" | debconf-set-selections -
39 echo "debconf maas/installation-note boolean true" | debconf-set-selections -
40 echo "debconf iptables-persistent/autosave_done boolean true" | debconf-set-selections -
41 echo "debconf iptables-persistent/autosave_v4 boolean true" | debconf-set-selections -
42 echo "debconf iptables-persistent/autosave_v6 boolean true" | debconf-set-selections -
43}
44
45setup_networking() {
46 modprobe 8021q || true
47 sed -i -e "/8021q/d" /etc/modules || true
48 echo "8021q" >> /etc/modules
49 # Set up the two network interfaces
50 external_interface=$(ip route ls | grep ^default | awk '{print $5}')
51 # TODO: ip addr ls
52 for interface in $(ifconfig -a -s | grep -v ^Iface | awk '{print $1}'); do
53 case "$interface" in
54 lo|br*|wlan*|vnet*)
55 continue
56 ;;
57 $external_interface)
58 continue
59 ;;
60 *)
61 internal_interface="$interface"
62 break
63 ;;
64 esac
65 done
66 # Set a sane default as em1 because the biosdevname should have been installed and run
67 [ -z "$internal_interface" ] && internal_interface=em1
68 # TODO: use ip
69 default_mac=$(ifconfig "$internal_interface" | grep "^$internal_interface" | sed -e "s/.*HWaddr //")
70 # Tell NetworkManager to piss off
71 sed -i -e "/^unmanaged-devices=mac:$default_mac$/d" /etc/NetworkManager/NetworkManager.conf
72 cat >>/etc/NetworkManager/NetworkManager.conf <<EOF
73[keyfile]
74unmanaged-devices=mac:$default_mac
75EOF
76 invoke-rc.d network-manager stop || true
77 invoke-rc.d network-manager start
78 cat >/etc/network/interfaces <<EOF
79auto lo
80iface lo inet loopback
81
82auto $external_interface
83iface $external_interface inet static
84 address ${external_ip}
85 netmask 255.255.252.0
86 broadcast 172.27.255.255
87 gateway ${gateway_ip}
88 dns-nameservers ${gateway_ip}
89
90auto $internal_interface
91iface $internal_interface inet manual
92
93
94auto br0
95iface br0 inet static
96 address ${internal_ip}
97 netmask 255.255.252.0
98 broadcast $br0_broadcast
99 bridge_ports $internal_interface
100 bridge_stp off
101 bridge_fd 0
102 bridge_maxwait 0
103
104# VLAN 2, Uplink network
105iface ${internal_interface}.2 inet dhcp
106vlan-raw-device $internal_interface
107
108# Network management alias
109iface br0:1 inet static
110address 10.90.90.91
111netmask 255.255.255.0
112broadcast 10.90.90.255
113
114EOF
115 ifdown --force $internal_interface || true
116 ifdown --force br0 || true
117 ifup $internal_interface
118 ifup br0
119 ### Same for $external_interface
120 ifdown --force $external_interface || true
121 ifup $external_interface
122
123 # Wait a moment for the network to normalize
124 echo "INFO: Ensure networking has settled"
125 run-one-until-success ping -c 10 maas.ubuntu.com
126}
127
128setup_external_drive() {
129 # External drive must be:
130 # a) partitioned into 1 big partition
131 # b) ext4 formatted
132 # Find root disk
133 root_disk=$(mount | grep " on / " | awk '{print $1}' | sed -e "s/[0-9]\+$//")
134 # Find biggest non-root disk
135 ext_disk=$(fdisk -l | grep "^Disk /" | grep -v $root_disk | sort -k4 -n -r | awk '{print $2}' | awk -F: '{print $1}')
136 partition="${ext_disk}1"
137 if [ -b "$ext_disk" ]; then
138 if [ ! -b "$partition" ]; then
139 # Create the partition, if it doesn't exist already
140 echo "n
141p
1421
143
144
145w
146"|fdisk "$ext_disk"
147 mkfs.ext4 "$partition"
148 fi
149 sed -i -e "/ \/srv/d" /etc/fstab
150 # Add the fstab entry
151 uuid=$(blkid -s UUID -o value "$partition")
152 echo "UUID=$uuid /srv ext4 defaults 1 1" >> /etc/fstab
153 fi
154 umount $partition || true
155 mount -a
156 chown root:root /srv
157 chmod 755 /srv
158}
159
160
161preflight_checks
162setup_external_drive
163setup_debconf
164setup_networking
165
166#DEBHELPER#
167
168exit 0
0169
=== removed file 'debian/preinst'
--- debian/preinst 2014-08-25 14:32:16 +0000
+++ debian/preinst 1970-01-01 00:00:00 +0000
@@ -1,136 +0,0 @@
1#!/bin/sh
2set -e
3set -x
4
5#unnecessary comment
6
7preflight_checks() {
8 if [ "$(id -u ubuntu)" != "1000" ]; then
9 echo "ERROR: Read the docs; a proper OrangeBox setup requires the default user to be [ubuntu]" 1>&2
10 exit 1
11 fi
12 # TODO: Check that the AMTs are on static IPs
13 # TODO: Check dual hard drives, which one is which
14 # TODO: Ensure we have two interfaces, one internal, one external
15}
16
17setup_debconf() {
18 echo "debconf maas/default-maas-url string 10.14.4.1" | debconf-set-selections -
19 echo "debconf maas-cluster-controller/maas-url string http://10.14.4.1/MAAS" | debconf-set-selections -
20 echo "debconf maas/installation-note boolean true" | debconf-set-selections -
21 echo "debconf iptables-persistent/autosave_done boolean true" | debconf-set-selections -
22 echo "debconf iptables-persistent/autosave_v4 boolean true" | debconf-set-selections -
23 echo "debconf iptables-persistent/autosave_v6 boolean true" | debconf-set-selections -
24}
25
26setup_networking() {
27 modprobe 8021q || true
28 sed -i -e "/8021q/d" /etc/modules || true
29 echo "8021q" >> /etc/modules
30 # Set up the two network interfaces
31 external_interface=$(ip route ls | grep ^default | awk '{print $5}')
32 # TODO: ip addr ls
33 for interface in $(ifconfig -a -s | grep -v ^Iface | awk '{print $1}'); do
34 case "$interface" in
35 lo|br*|wlan*)
36 continue
37 ;;
38 $external_interface)
39 continue
40 ;;
41 *)
42 internal_interface="$interface"
43 break
44 ;;
45 esac
46 done
47 # Set a sane default
48 [ -z "$internal_interface" ] && internal_interface=eth0
49 # TODO: use ip
50 default_mac=$(ifconfig "$internal_interface" | grep "^$internal_interface" | sed -e "s/.*HWaddr //")
51 # Tell NetworkManager to piss off
52 sed -i -e "/^unmanaged-devices=mac:$default_mac$/d" /etc/NetworkManager/NetworkManager.conf
53 cat >>/etc/NetworkManager/NetworkManager.conf <<EOF
54[keyfile]
55unmanaged-devices=mac:$default_mac
56EOF
57 invoke-rc.d network-manager stop || true
58 invoke-rc.d network-manager start
59 cat >/etc/network/interfaces <<EOF
60auto lo
61iface lo inet loopback
62
63auto $internal_interface
64iface $internal_interface inet manual
65
66auto br0
67iface br0 inet static
68 address 10.14.4.1
69 netmask 255.255.0.0
70 broadcast 10.14.255.255
71 bridge_ports $internal_interface
72 bridge_stp off
73 bridge_fd 0
74 bridge_maxwait 0
75
76# VLAN 2, Uplink network
77iface eth0.2 inet dhcp
78vlan-raw-device eth0
79
80# Network management alias
81iface br0:1 inet static
82address 10.90.90.91
83netmask 255.255.255.0
84broadcast 10.90.90.255
85
86EOF
87 ifdown --force $internal_interface || true
88 ifdown --force br0 || true
89 ifup $internal_interface
90 ifup br0
91 # Wait a moment for the network to normalize
92 echo "INFO: Ensure networking has settled"
93 run-one-until-success ping -c 10 maas.ubuntu.com
94}
95
96setup_external_drive() {
97 # External drive must be:
98 # a) partitioned into 1 big partition
99 # b) ext4 formatted
100 # Find root disk
101 root_disk=$(mount | grep " on / " | awk '{print $1}' | sed -e "s/[0-9]\+$//")
102 # Find biggest non-root disk
103 ext_disk=$(fdisk -l | grep "^Disk /" | grep -v $root_disk | sort -k4 -n -r | awk '{print $2}' | awk -F: '{print $1}')
104 partition="${ext_disk}1"
105 if [ -b "$ext_disk" ]; then
106 if [ ! -b "$partition" ]; then
107 # Create the partition, if it doesn't exist already
108 echo "n
109p
1101
111
112
113w
114"|fdisk "$ext_disk"
115 mkfs.ext4 "$partition"
116 fi
117 sed -i -e "/ \/srv/d" /etc/fstab
118 # Add the fstab entry
119 uuid=$(blkid -s UUID -o value "$partition")
120 echo "UUID=$uuid /srv ext4 defaults 1 1" >> /etc/fstab
121 fi
122 umount $partition || true
123 mount -a
124 chown root:root /srv
125 chmod 755 /srv
126}
127
128
129preflight_checks
130setup_external_drive
131setup_debconf
132setup_networking
133
134#DEBHELPER#
135
136exit 0
1370
=== modified file 'debian/source/format'
--- debian/source/format 2014-04-04 19:40:10 +0000
+++ debian/source/format 2015-07-17 17:14:52 +0000
@@ -1,1 +1,1 @@
13.0 (quilt)13.0 (native)
22
=== removed file 'etc/apache2/sites-available/archive.conf'
--- etc/apache2/sites-available/archive.conf 2014-04-11 05:16:52 +0000
+++ etc/apache2/sites-available/archive.conf 1970-01-01 00:00:00 +0000
@@ -1,13 +0,0 @@
1<VirtualHost *:80>
2 ServerName archive.ubuntu.com
3 ServerAdmin webmaster@localhost
4 DocumentRoot /srv/mirrors/archive.ubuntu.com/
5 ErrorLog ${APACHE_LOG_DIR}/error.log
6 CustomLog ${APACHE_LOG_DIR}/access.log combined
7 <Directory /srv/mirrors/archive.ubuntu.com/>
8 Options Indexes FollowSymLinks Multiviews
9 Require all granted
10 </Directory>
11</VirtualHost>
12
13# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
140
=== added file 'etc/apache2/sites-available/archive.ubuntu.com.conf'
--- etc/apache2/sites-available/archive.ubuntu.com.conf 1970-01-01 00:00:00 +0000
+++ etc/apache2/sites-available/archive.ubuntu.com.conf 2015-07-17 17:14:52 +0000
@@ -0,0 +1,14 @@
1<VirtualHost *:80>
2 ServerName archive.ubuntu.com
3 ServerAlias *.archive.ubuntu.com
4 ServerAdmin webmaster@localhost
5 DocumentRoot /srv/mirrors/archive.ubuntu.com/
6 ErrorLog ${APACHE_LOG_DIR}/error.log
7 CustomLog ${APACHE_LOG_DIR}/access.log combined
8 <Directory /srv/mirrors/archive.ubuntu.com/>
9 Options Indexes FollowSymLinks Multiviews
10 Require all granted
11 </Directory>
12</VirtualHost>
13
14# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
015
=== added file 'etc/apache2/sites-available/cdimage.ubuntu.com.conf'
--- etc/apache2/sites-available/cdimage.ubuntu.com.conf 1970-01-01 00:00:00 +0000
+++ etc/apache2/sites-available/cdimage.ubuntu.com.conf 2015-07-17 17:14:52 +0000
@@ -0,0 +1,14 @@
1<VirtualHost *:80>
2 ServerName cdimage.ubuntu.com
3 ServerAlias *.cdimage.ubuntu.com
4 ServerAdmin root@localhost
5 DocumentRoot /srv/mirrors/cdimage.ubuntu.com/
6 ErrorLog ${APACHE_LOG_DIR}/cdimage.ubuntu.com-error.log
7 CustomLog ${APACHE_LOG_DIR}/cdimage.ubuntu.com-access.log combined
8 <Directory /srv/mirrors/cdimage.ubuntu.com/>
9 Options Indexes FollowSymLinks Multiviews
10 Require all granted
11 </Directory>
12</VirtualHost>
13
14# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
015
=== added file 'etc/apache2/sites-available/cloud-images.ubuntu.com.conf'
--- etc/apache2/sites-available/cloud-images.ubuntu.com.conf 1970-01-01 00:00:00 +0000
+++ etc/apache2/sites-available/cloud-images.ubuntu.com.conf 2015-07-17 17:14:52 +0000
@@ -0,0 +1,14 @@
1<VirtualHost *:80>
2 ServerName cloud-images.ubuntu.com
3 ServerAlias *.cloud-images.ubuntu.com
4 ServerAdmin root@localhost
5 DocumentRoot /srv/mirrors/cloud-images.ubuntu.com/
6 ErrorLog ${APACHE_LOG_DIR}/cloud-images.ubuntu.com-error.log
7 CustomLog ${APACHE_LOG_DIR}/cloud-images.ubuntu.com-access.log combined
8 <Directory /srv/mirrors/cloud-images.ubuntu.com/>
9 Options Indexes FollowSymLinks Multiviews
10 Require all granted
11 </Directory>
12</VirtualHost>
13
14# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
015
=== added file 'etc/apache2/sites-available/ports.ubuntu.com.conf'
--- etc/apache2/sites-available/ports.ubuntu.com.conf 1970-01-01 00:00:00 +0000
+++ etc/apache2/sites-available/ports.ubuntu.com.conf 2015-07-17 17:14:52 +0000
@@ -0,0 +1,14 @@
1<VirtualHost *:80>
2 ServerName ports.ubuntu.com
3 ServerAlias *.ports.ubuntu.com
4 ServerAdmin root@localhost
5 DocumentRoot /srv/mirrors/ports.ubuntu.com/
6 ErrorLog ${APACHE_LOG_DIR}/ports.ubuntu.com-error.log
7 CustomLog ${APACHE_LOG_DIR}/ports.ubuntu.com-access.log combined
8 <Directory /srv/mirrors/ports.ubuntu.com/>
9 Options Indexes FollowSymLinks Multiviews
10 Require all granted
11 </Directory>
12</VirtualHost>
13
14# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
015
=== added file 'etc/apache2/sites-available/releases.ubuntu.com.conf'
--- etc/apache2/sites-available/releases.ubuntu.com.conf 1970-01-01 00:00:00 +0000
+++ etc/apache2/sites-available/releases.ubuntu.com.conf 2015-07-17 17:14:52 +0000
@@ -0,0 +1,14 @@
1<VirtualHost *:80>
2 ServerName releases.ubuntu.com
3 ServerAlias *.releases.ubuntu.com
4 ServerAdmin root@localhost
5 DocumentRoot /srv/mirrors/releases.ubuntu.com/
6 ErrorLog ${APACHE_LOG_DIR}/releases.ubuntu.com-error.log
7 CustomLog ${APACHE_LOG_DIR}/releases.ubuntu.com-access.log combined
8 <Directory /srv/mirrors/releases.ubuntu.com/>
9 Options Indexes FollowSymLinks Multiviews
10 Require all granted
11 </Directory>
12</VirtualHost>
13
14# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
015
=== added file 'etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf'
--- etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf 1970-01-01 00:00:00 +0000
+++ etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf 2015-07-17 17:14:52 +0000
@@ -0,0 +1,12 @@
1<VirtualHost *:80>
2 ServerName ubuntu-cloud.archive.canonical.com
3 ServerAdmin webmaster@localhost
4 DocumentRoot /srv/mirrors/ubuntu-cloud.archive.canonical.com/
5 ErrorLog ${APACHE_LOG_DIR}/error.log
6 CustomLog ${APACHE_LOG_DIR}/access.log combined
7 <Directory /srv/mirrors/ubuntu-cloud.archive.canonical.com/>
8 Options Indexes FollowSymLinks Multiviews
9 Require all granted
10 </Directory>
11</VirtualHost>
12# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
013
=== removed file 'etc/apache2/sites-available/ubuntu-cloud.conf'
--- etc/apache2/sites-available/ubuntu-cloud.conf 2014-04-11 05:16:52 +0000
+++ etc/apache2/sites-available/ubuntu-cloud.conf 1970-01-01 00:00:00 +0000
@@ -1,12 +0,0 @@
1<VirtualHost *:80>
2 ServerName ubuntu-cloud.archive.canonical.com
3 ServerAdmin webmaster@localhost
4 DocumentRoot /srv/mirrors/ubuntu-cloud.archive.canonical.com/
5 ErrorLog ${APACHE_LOG_DIR}/error.log
6 CustomLog ${APACHE_LOG_DIR}/access.log combined
7 <Directory /srv/mirrors/ubuntu-cloud.archive.canonical.com/>
8 Options Indexes FollowSymLinks Multiviews
9 Require all granted
10 </Directory>
11</VirtualHost>
12# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
130
=== modified file 'etc/apt/orange-box-mirror.list'
--- etc/apt/orange-box-mirror.list 2015-01-21 22:04:42 +0000
+++ etc/apt/orange-box-mirror.list 2015-07-17 17:14:52 +0000
@@ -8,7 +8,7 @@
8set var_path $base_path/var8set var_path $base_path/var
9set cleanscript /bin/true9set cleanscript /bin/true
10set defaultarch amd6410set defaultarch amd64
11set postmirror_script /bin/true11set postmirror_script /srv/var/postmirror.sh
12# set run_postmirror 012# set run_postmirror 0
13set nthreads 2013set nthreads 20
14set _tilde 014set _tilde 0
@@ -16,28 +16,51 @@
16############# end config ##############16############# end config ##############
1717
18## Trusty18## Trusty
19deb http://orange-box.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse19deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
20deb http://orange-box.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse20deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
21deb http://orange-box.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse21deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
22deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse22deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
23deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse23deb-i386 http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
24deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse24deb-i386 http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
25deb-i386 http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
26deb-i386 http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
27
28
29deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
30deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
31deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
32deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
33
2534
26## precise35## precise
27deb http://orange-box.archive.ubuntu.com/ubuntu precise main restricted universe multiverse36deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
28deb http://orange-box.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse37deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
29deb http://orange-box.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse38deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
30deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise main restricted universe multiverse39deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
31deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse40
32deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse41deb-i386 http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
42deb-i386 http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
43deb-i386 http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
44deb-src http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
45deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
46deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
47
48##http://ubuntu-cloud.archive.canonical.com precise-updates/cloud-tools/main Sources
3349
34## Cloud-archive50## Cloud-archive
35deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main51#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
36deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main52#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
37deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main53#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
38deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main54#deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
39deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main55#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
40deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main56#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
57#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
58#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
59#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
60#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
61#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
62#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
63
4164
42clean http://archive.ubuntu.com/ubuntu65clean http://archive.ubuntu.com/ubuntu
43clean http://ubuntu-cloud.archive.canonical.com/ubuntu66#clean http://ubuntu-cloud.archive.canonical.com/ubuntu
4467
=== added directory 'etc/bind'
=== added file 'etc/bind/named.conf.wildcard-archive'
--- etc/bind/named.conf.wildcard-archive 1970-01-01 00:00:00 +0000
+++ etc/bind/named.conf.wildcard-archive 2015-07-17 17:14:52 +0000
@@ -0,0 +1,6 @@
1# Zone declarations.
2zone "archive.ubuntu.com" {
3 type master;
4 file "/etc/bind/zones.wildcard-archive";
5};
6
07
=== added file 'etc/bind/zones.wildcard-archive'
--- etc/bind/zones.wildcard-archive 1970-01-01 00:00:00 +0000
+++ etc/bind/zones.wildcard-archive 2015-07-17 17:14:52 +0000
@@ -0,0 +1,20 @@
1$TTL 300
2@ IN SOA archive.ubuntu.com ubuntu.com (
3 999 ; serial
4 600 ; Refresh
5 1800 ; Retry
6 604800 ; Expire
7 300 ; TTL
8 )
9
10 IN NS archive.ubuntu.com
11
12
13
14
15ns IN CNAME archive.ubuntu.com
16archive.ubuntu.com. IN A 10.14.4.1
17archive.ubuntu.com IN A 10.14.4.1
18ubuntu-cloud.archive.canonical.com. IN A 10.14.4.1
19* IN A 10.14.4.1
20
021
=== removed directory 'etc/cron.d'
=== removed file 'etc/cron.d/charmstore-mirror'
--- etc/cron.d/charmstore-mirror 2014-07-30 20:05:45 +0000
+++ etc/cron.d/charmstore-mirror 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1#Run every Staurday at 03:23 in the morning, if plugged in and internet is accessible the charmstore will be updated.
2#Remove any charmstore directories inot modified in the last 90 days to save space.
323 3 * * 6 root run-one orange-box-sync-charmstore >>/var/log/orange-box-sync-charmstore.log 2>&1
438 4 1 * * root run-one find /srv/charmstore/ -maxdepth 1 -mindepth 1 -type d -mtime +90 -exec rm -rf {} \;
50
=== removed file 'etc/cron.d/orange-box-mirror'
--- etc/cron.d/orange-box-mirror 2014-06-02 15:43:19 +0000
+++ etc/cron.d/orange-box-mirror 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
142 * * * * root run-one apt-mirror /etc/apt/orange-box-mirror.list >>/var/log/orange-box-mirror.log 2>&1
20
=== modified file 'etc/debconf-selections'
--- etc/debconf-selections 2014-04-04 19:42:22 +0000
+++ etc/debconf-selections 2015-07-17 17:14:52 +0000
@@ -1,5 +1,3 @@
1maas-cluster-controller maas-cluster-controller/maas-url string http://10.14.4.1/MAAS
2maas-region-controller-min maas/default-maas-url string 10.14.4.1
3maas-region-controller-min maas/installation-note boolean true1maas-region-controller-min maas/installation-note boolean true
4iptables-persistent iptables-persistent/autosave_v6 boolean true2iptables-persistent iptables-persistent/autosave_v6 boolean true
5iptables-persistent iptables-persistent/autosave_v4 boolean true3iptables-persistent iptables-persistent/autosave_v4 boolean true
64
=== added file 'etc/orangebox-mirror.state'
--- etc/orangebox-mirror.state 1970-01-01 00:00:00 +0000
+++ etc/orangebox-mirror.state 2015-07-17 17:14:52 +0000
@@ -0,0 +1,1 @@
1INIT
0\ No newline at end of file2\ No newline at end of file
13
=== added file 'etc/ucloudexclude.list'
--- etc/ucloudexclude.list 1970-01-01 00:00:00 +0000
+++ etc/ucloudexclude.list 2015-07-17 17:14:52 +0000
@@ -0,0 +1,26 @@
1lost+found/
2desktop/
3lucid/
4full/
5*jaunty*
6*hardy*
7*karmic*
8*lucid*
9*maverick*
10*natty*
11*oneiric*
12*quantal*
13*vagrant*
14*proposed*
15*raring*
16*saucy*
17*utopic*
18*vivid*
19*wily*
20*alpha*
21*snappy*
22*beta*
23*.ova
24*arm*
25*ppc*
26.bzr
027
=== modified file 'usr/bin/orange-box-add-node'
--- usr/bin/orange-box-add-node 2014-10-27 20:54:45 +0000
+++ usr/bin/orange-box-add-node 2015-07-17 17:14:52 +0000
@@ -23,6 +23,9 @@
23set -e23set -e
24set -x24set -x
2525
26## According to OB network re-design
27. /etc/orange-box.conf
28
26ip_to_mac() {29ip_to_mac() {
27 local ip="$1"30 local ip="$1"
28 arp -n | sort | grep -m1 "^$ip\s" | awk '{print $3}'31 arp -n | sort | grep -m1 "^$ip\s" | awk '{print $3}'
@@ -31,7 +34,7 @@
31node_name() {34node_name() {
32 local num="${1##*.}"35 local num="${1##*.}"
33 num=$((num-10))36 num=$((num-10))
34 echo "node${num}"37 echo "node${num}ob${orangebox_number}"
35}38}
3639
37hostname_to_system_id() {40hostname_to_system_id() {
@@ -60,20 +63,20 @@
60maas admin zone read zone2 || maas admin zones create name=zone2 description="Physical machines on right side of Orange Box"63maas admin zone read zone2 || maas admin zones create name=zone2 description="Physical machines on right side of Orange Box"
6164
62#Create maas-br0 network if it does not already exist65#Create maas-br0 network if it does not already exist
63maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=10.14.0.0 netmask=255.255.0.0 default_gateway=10.14.4.1 dns_servers=10.14.4.1 description="Auto created when running orange-box-add-node"66maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=172.27.${orangebox_number}.0 netmask=255.255.252.0 default_gateway=172.27.${orangebox_number}.1 dns_servers=172.27.${orangebox_number}.1 description="Auto created when running orange-box-add-node"
6467
65# Loop over the list of ip addresses listening on 1699268# Loop over the list of ip addresses listening on 16992
66for ip in $@; do69for ip in $@; do
67 mac=$(ip_to_mac $ip)70 mac=$(ip_to_mac $ip)
68 hostname=$(node_name $ip)71 hostname=$(node_name $ip)
69 node=${hostname#node}72 node=`echo ${hostname}| sed "s/node\(.*\)ob${orangebox_number}/\1/"`
70 if [ $node -lt 5 ]; then73 if [ $node -lt 5 ]; then
71 zone="zone1"74 zone="zone1"
72 else75 else
73 zone="zone2"76 zone="zone2"
74 fi77 fi
75 info "$ip --> $hostname --> $mac"78 info "$ip --> $hostname --> $mac"
76 if [ -z "$ip" ] || [ "$ip" = "10.14.4.1" ]; then79 if [ -z "$ip" ] || [ "$ip" = "172.27.${orangebox_number}.1" ]; then
77 continue80 continue
78 fi81 fi
79 # Remove it, if it's already here82 # Remove it, if it's already here
8083
=== modified file 'usr/bin/orange-box-add-physical-nodes'
--- usr/bin/orange-box-add-physical-nodes 2014-07-11 18:27:46 +0000
+++ usr/bin/orange-box-add-physical-nodes 2015-07-17 17:14:52 +0000
@@ -25,11 +25,16 @@
2525
26oauth_login26oauth_login
2727
28## According to OB network re-design
29. /etc/orange-box.conf
30
31
32
28# Search for nodes listening on AMT's 1699233# Search for nodes listening on AMT's 16992
29info "Searching for all nodes on the local network listening on 16992; this will take 60 seconds...."34info "Searching for all nodes on the local network listening on 16992; this will take 60 seconds...."
30ips=$(time for i in $(seq 1 10); do nmap -p 16992 -oG - 10.14.4.1/24 | grep 16992/open | awk '{print $2}' ; done | sort -u -r)35ips=$(time for i in $(seq 1 10); do nmap -p 16992 -oG - 172.27.${orangebox_number}.1/22 | grep 16992/open | awk '{print $2}' ; done | sort -u -r)
31if [ -z "$ips" ]; then36if [ -z "$ips" ]; then
32 error "nmap did not find any nodes listening on [16992] on the [10.14.4.1/24] network"37 error "nmap did not find any nodes listening on [16992] on the [172.27.${orangebox_number}.1/22] network"
33fi38fi
34info "Found: [$ips]"39info "Found: [$ips]"
3540
3641
=== modified file 'usr/bin/orange-box-add-virtual-nodes'
--- usr/bin/orange-box-add-virtual-nodes 2015-02-07 16:07:08 +0000
+++ usr/bin/orange-box-add-virtual-nodes 2015-07-17 17:14:52 +0000
@@ -18,6 +18,13 @@
18# You should have received a copy of the GNU General Public License18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.19# along with this program. If not, see <http://www.gnu.org/licenses/>.
2020
21##
22##
23. /etc/orange-box.conf
24
25external_ip="172.27.252.${orangebox_number}"
26internal_ip="172.27.${orangebox_number}.1"
27internal_network="172.27.${orangebox_number}.0"
2128
22if [ "$(id -u)" != "0" ]; then29if [ "$(id -u)" != "0" ]; then
23 echo "Must be run with sudo or by root"30 echo "Must be run with sudo or by root"
@@ -29,13 +36,20 @@
2936
30virsh net-info default && virsh net-destroy default && virsh net-undefine default37virsh net-info default && virsh net-destroy default && virsh net-undefine default
3138
32[ -d ~maas ] || install -d /var/lib/maas --owner maas --group maas39[ -d /var/lib/maas ] || install -d /var/lib/maas --owner maas --group maas
33chsh maas -s /bin/bash40chsh maas -s /bin/bash
34[ -d ~maas/.ssh ] || echo -e "\n\n\n" | sudo -u maas ssh-keygen -N "" -t rsa -f ~maas/.ssh/id_rsa41[ -d /var/lib/maas/.ssh ] || mkdir /var/lib/maas/.ssh && chown maas:maas /var/lib/maas/.ssh
35grep 'maas@' /home/ubuntu/.ssh/authorized_keys || cat ~maas/.ssh/id_rsa.pub | tee -a /home/ubuntu/.ssh/authorized_keys42[ -f /var/lib/maas/.ssh/id_rsa ] || echo -e "\n\n\n" | sudo -u maas ssh-keygen -N "" -t rsa -f /var/lib/maas/.ssh/id_rsa
36printf "%s,%s %s %s\n" "node0.maas" "10.14.4.1" $(awk '{print $1 " " $2}' /etc/ssh/ssh_host_ecdsa_key.pub) | tee -a ~maas/.ssh/known_hosts43[ -f /var/lib/maas/.ssh/known_hosts ] || sudo -u maas ssh-keyscan 172.27.${orangebox_number}.1 |sudo -u maas tee -a /var/lib/maas/.ssh/known_hosts > /dev/null
44#Always add host keys .. not an issue if files grows
45sudo -u maas ssh-keyscan 172.27.${orangebox_number}.1 |sudo -u maas tee -a /var/lib/maas/.ssh/known_hosts > /dev/null
46sudo -u maas virsh -c qemu+ssh://ubuntu@172.27.${orangebox_number}.1/system list > /dev/null || sed -i '/ maas@/d' /home/ubuntu/.ssh/authorized_keys
47#If there is no key /new install or just removed add it"
48grep 'maas@' /home/ubuntu/.ssh/authorized_keys || cat /var/lib/maas/.ssh/id_rsa.pub | tee -a /home/ubuntu/.ssh/authorized_keys
49printf "%s,%s %s %s\n" "node0.maas" "$internal_ip" $(awk '{print $1 " " $2}' /etc/ssh/ssh_host_ecdsa_key.pub) | tee -a /var/lib/maas/.ssh/known_hosts
37chown -R ubuntu:ubuntu /home/ubuntu50chown -R ubuntu:ubuntu /home/ubuntu
3851
52
39maas admin tags new name=virtual || true53maas admin tags new name=virtual || true
40maas admin tags new name=bootstrap || true54maas admin tags new name=bootstrap || true
41maas admin tags new name=neutron || true55maas admin tags new name=neutron || true
@@ -53,25 +67,23 @@
53maas admin zone read zone0 || maas admin zones create name=zone0 description="Virtual machines on node0"67maas admin zone read zone0 || maas admin zones create name=zone0 description="Virtual machines on node0"
5468
55#Create maas-br0 network if it does not already exist69#Create maas-br0 network if it does not already exist
56maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=10.14.0.0 netmask=255.255.0.0 default_gateway=10.14.4.1 dns_servers=10.14.4.1 description="Auto created when running orange-box-add-virtual-nodes"70### For APAC Roadshow
71maas admin network read maas-br0 || maas admin networks create name=maas-br0 ip=${internal_network} netmask=255.255.252.0 default_gateway=${internal_ip} dns_servers=${internal_ip} description="Auto created when running orange-box-add-virtual-nodes"
72
5773
58for i in $(seq 0 2 | sort -r); do74for i in $(seq 0 2 | sort -r); do
59 hostname="node0vm${i}.maas"75 hostname="node0vm${i}ob${orangebox_number}.maas"
60 virsh destroy $hostname || true76 virsh destroy $hostname || true
61 virsh undefine $hostname || true77 virsh undefine $hostname || true
62 echo "INFO: Installing virtual machine"78 echo "INFO: Installing virtual machine"
63 virt-install --debug --name $hostname --ram 4096 --disk=path=/var/lib/orange-box/${hostname}-1.img,size=20 --disk=path=/var/lib/orange-box/${hostname}-2.img,size=2 --vcpus=2 --os-type=linux --pxe --network=bridge=br0,model=virtio --network=bridge=br0,model=rtl8139 --boot network --video=cirrus --graphics vnc|| true79 virt-install --debug --name $hostname --ram 4096 --disk=path=/var/lib/orange-box/${hostname}-1.img,size=20 --disk=path=/var/lib/orange-box/${hostname}-2.img,size=2 --vcpus=2 --os-type=linux --pxe --network=bridge=br0 --network=bridge=br0 --boot network --video=cirrus --graphics vnc|| true
64 virsh console $hostname || true80 virsh console $hostname || true
65 #Workaround for bug: https://bugs.launchpad.net/maas/+bug/1367482
66 virsh dumpxml $hostname > /tmp/${hostname}.xml
67 sed -i -e "s#<model type='rtl8139'/>#<model type='rtl8139'/> <rom file=''/>#" /tmp/${hostname}.xml
68 virsh define /tmp/${hostname}.xml
69 virsh autostart $hostname81 virsh autostart $hostname
70 mac=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')82 mac=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')
71 mac2=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')83 mac2=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')
72 system_id=$(maas admin nodes list mac_address=$mac | grep system_id | cut -d'"' -f4)84 system_id=$(maas admin nodes list mac_address=$mac | grep system_id | cut -d'"' -f4)
73 if [ -n "$system_id" ]; then85 if [ -n "$system_id" ]; then
74 maas admin node update $system_id hostname=$hostname power_type=virsh power_parameters_power_address=qemu+ssh://ubuntu@10.14.4.1/system power_parameters_power_id=$hostname86 maas admin node update $system_id hostname=$hostname power_type=virsh power_parameters_power_address=qemu+ssh://ubuntu@${internal_ip}/system power_parameters_power_id=$hostname
75 maas admin tag update-nodes "virtual" add=$system_id87 maas admin tag update-nodes "virtual" add=$system_id
76 case $i in88 case $i in
77 0)89 0)
7890
=== modified file 'usr/bin/orange-box-amt-monitor'
--- usr/bin/orange-box-amt-monitor 2014-04-16 22:26:52 +0000
+++ usr/bin/orange-box-amt-monitor 2015-07-17 17:14:52 +0000
@@ -1,3 +1,5 @@
1#!/bin/sh1#!/bin/sh
22
3watch -n 10 "sudo nmap -p 16992 -oG - 10.14.4.1/24 | grep 16992/open | sort"3. /etc/orange-box.conf
4watch -n 10 "sudo nmap -p 16992 -oG - 172.27.${orangebox_number}.0/22 | grep 16992/open | sort"
5
46
=== removed file 'usr/bin/orange-box-apm-power-fix'
--- usr/bin/orange-box-apm-power-fix 2014-10-31 09:19:40 +0000
+++ usr/bin/orange-box-apm-power-fix 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
1#!/bin/sh
2#
3# orange-box-apm-power-fix - fix for issue with orange-box-apm-power
4# Copyright (C) 2014 Canonical Ltd.
5#
6# Authors: Darryl Weaver <darryl.weaver@canonical.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, version 3 of the License.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20set -x
21
22if [ ! -f /var/lib/maas/boot-resources/current/syslinux/poweroff-APM.com ]
23then
24cd /srv/data
25wget https://launchpadlibrarian.net/187530745/acpioff.c32
26cd /var/lib/maas/boot-resources/current/syslinux
27sudo mv poweroff.com poweroff-APM.com
28sudo mv /srv/data/acpioff.c32 poweroff.c32
29fi
30
31#fixing the AMT template
32cd /srv/data
33wget https://launchpadlibrarian.net/187911231/not-permitted.patch
34cd /etc/maas/templates/power
35patch < /srv/data/not-permitted.patch
36
37exit
38
390
=== modified file 'usr/bin/orange-box-bootstrap-juju'
--- usr/bin/orange-box-bootstrap-juju 2015-01-07 23:15:31 +0000
+++ usr/bin/orange-box-bootstrap-juju 2015-07-17 17:14:52 +0000
@@ -24,8 +24,12 @@
24 timeout 1m run-one-until-success nc -w 10 -zvv $@ 2>&124 timeout 1m run-one-until-success nc -w 10 -zvv $@ 2>&1
25}25}
2626
27## According to OB network re-disign
28. /etc/orange-box.conf
29
27juju status && echo "Existing deployment found, exiting." && exit 030juju status && echo "Existing deployment found, exiting." && exit 0
28juju bootstrap --to node0vm0.maas --show-log --upload-tools31###juju bootstrap --to node0ob${orangebox_number}vm0.maas --show-log --upload-tools
32juju bootstrap --to node0vm0ob${orangebox_number}.maas --show-log --upload-tools
29juju set-constraints "tags="33juju set-constraints "tags="
30juju deploy --to 0 --repository=/srv/charmstore/ local:trusty/juju-gui34juju deploy --to 0 --repository=/srv/charmstore/ local:trusty/juju-gui
31juju expose juju-gui35juju expose juju-gui
3236
=== modified file 'usr/bin/orange-box-create-package-mirror'
--- usr/bin/orange-box-create-package-mirror 2015-01-21 22:04:42 +0000
+++ usr/bin/orange-box-create-package-mirror 2015-07-17 17:14:52 +0000
@@ -27,7 +27,9 @@
27fi27fi
2828
29home=$PWD29home=$PWD
30IP=10.14.4.130. /etc/orange-box.conf
31
32IP=172.27.${orangebox_number}.1
3133
32function run_mirror { 34function run_mirror {
33 echo "apt-mirror /etc/apt/orange-box-mirror.list >>/var/log/orange-box-mirror.log 2>&1"35 echo "apt-mirror /etc/apt/orange-box-mirror.list >>/var/log/orange-box-mirror.log 2>&1"
@@ -95,6 +97,17 @@
95echo Making mirror directories ...97echo Making mirror directories ...
96mkdir -p /srv/mirrors /srv/skel /srv/var98mkdir -p /srv/mirrors /srv/skel /srv/var
9799
100echo Creating postmirror.sh script ...
101# This created a blank file, for some reason :/
102echo << 'EOF' > /srv/var/postmirror.sh
103#!/bin/sh
104/srv/var/clean.sh
105EOF
106
107echo Making postmirror.sh executable ...
108chmod +x /srv/var/postmirror.sh
109echo Done. && echo
110
98echo Setting up the web dirs for mirroring ...111echo Setting up the web dirs for mirroring ...
99ln -s /srv/mirrors/archive.ubuntu.com/ubuntu /var/www/html/archive.ubuntu.com112ln -s /srv/mirrors/archive.ubuntu.com/ubuntu /var/www/html/archive.ubuntu.com
100ln -s /srv/mirrors/ubuntu-cloud.archive.canonical.com/ubuntu /var/www/html/ubuntu-cloud.archive.canonical.com113ln -s /srv/mirrors/ubuntu-cloud.archive.canonical.com/ubuntu /var/www/html/ubuntu-cloud.archive.canonical.com
101114
=== modified file 'usr/bin/orange-box-demo-cleanup'
--- usr/bin/orange-box-demo-cleanup 2014-10-23 22:18:49 +0000
+++ usr/bin/orange-box-demo-cleanup 2015-07-17 17:14:52 +0000
@@ -20,6 +20,8 @@
2020
21ENVIRONMENT=`juju env`21ENVIRONMENT=`juju env`
2222
23. /etc/orange-box.conf
24
23#Destroy juju environment25#Destroy juju environment
24juju destroy-environment $ENVIRONMENT26juju destroy-environment $ENVIRONMENT
25#make sure AMTs are all powered off27#make sure AMTs are all powered off
@@ -27,6 +29,6 @@
27if dpkg --compare-versions $maas_ver lt 1.6; then29if dpkg --compare-versions $maas_ver lt 1.6; then
28 export AMT_PASSWORD=Password1+30 export AMT_PASSWORD=Password1+
29 for i in $(seq 11 19); do31 for i in $(seq 11 19); do
30 yes | amttool 10.14.4.$i powerdown >/dev/null 2>&132 yes | amttool 172.27.${orangebox_number}.$i powerdown >/dev/null 2>&1
31 done33 done
32fi34fi
3335
=== added file 'usr/bin/orange-box-hacks'
--- usr/bin/orange-box-hacks 1970-01-01 00:00:00 +0000
+++ usr/bin/orange-box-hacks 2015-07-17 17:14:52 +0000
@@ -0,0 +1,32 @@
1#!/bin/sh
2
3okay() {
4 echo "OK: $@"
5}
6
7error() {
8 echo "ERROR: $@"
9}
10
11# Check powerstate in AMT
12for i in $(seq 1 9); do
13 amtoutput=$(yes | amttool 10.14.4.1${i} info)
14 if [ "$amthostname" = "node${i}amt" ]; then
15 okay "[node${i}]: AMT is responsive"
16 else
17 error "[node${i}]: AMT is not responsive"
18 fi
19 amtpowerstate=$(echo "$amtoutput" | grep "^Powerstate:" | awk '{print $2}')
20 if [ -n "$amtpowerstate" ]; then
21 okay "[node${i}]: AMT powerstate [$amtpowerstate]"
22 else
23 error "[node${i}]: AMT powerstate unknown [$amtpowerstate]"
24 fi
25 uptime=$(ssh node$i.maas "uptime" 2>/dev/null)
26 if [ -n "$uptime" ]; then
27 okay "[node${i}]: SSH to node successful; uptime=[$uptime]"
28 else
29 error "[node${i}]: SSH to node unsuccessful; uptime=[$uptime]"
30 fi
31 echo
32done
033
=== added file 'usr/bin/orange-box-mirror'
--- usr/bin/orange-box-mirror 1970-01-01 00:00:00 +0000
+++ usr/bin/orange-box-mirror 2015-07-17 17:14:52 +0000
@@ -0,0 +1,235 @@
1#!/bin/bash
2#
3# orange-box-mirror
4# Copyright (C) 2014 Canonical Ltd.
5#
6# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, version 3 of the License.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20set -ex
21. /etc/orange-box.conf
22#TODO# merge State in orange-box.conf
23STATE=`cat /etc/orangebox-mirror.state`
24
25# looking for inconsistency / self healing
26dig +short xyz.archive.ubuntu.com | grep 172.27.${orangebox_number}.1 > /dev/null && CHECKEDSTATE=ENABLED || CHECKEDSTATE=DISABLED
27if [[ $STATE != $CHECKEDSTATE ]]
28then
29 if [[ $STATE == MIRRORING ]]
30 then
31 echo "WAS MIRRORING"
32 # IF nobody use the log then it is not mirroring
33 if ( sudo fuser /var/log/orange-box-mirror.log )
34 then
35 CHECKEDSTATE=MIRRORING
36 else
37 dig +short xyz.archive.ubuntu.com | grep 172.27.${orangebox_number}.1 && CHECKEDSTATE=ENABLED || CHECKEDSTATE=DISABLED
38 fi
39 fi
40 STATE=$CHECKEDSTATE
41 echo $CHECKEDSTATE > /etc/orangebox-mirror.state
42 echo "Some script end up in error or been screwed healing"
43fi
44
45is-root()
46{
47 if [ "$(id -u)" != "0" ]; then
48 echo "Must be run with sudo or by root"
49 exit 77
50 fi
51}
52
53control_c()
54# run if user hits control-c
55{
56 echo -en "\n*** Ouch! Exiting ***\n"
57 [[ $STATE = MIRRORING ]] && echo "DISABLED" > /etc/orangebox-mirror.state
58 exit $?
59}
60
61# trap keyboard interrupt (control-c)
62trap control_c SIGINT
63
64
65usage()
66{
67cat << EOF
68
69orange-box-mirror - control usage and sync of local to OrangeBox mirrors
70
71USAGE: <action>
72
73 The options must be passed as follows:
74 <action>
75 enable - enable dns modification to point to local
76 disable - disable usage of the local mirror
77 sync - synchronize the mirror with archive disabling it during sync
78 status - describe current state
79
80 Note: actions requires root privileges use sudo
81
82EOF
83exit 0
84}
85
86enable-dns-usage()
87{
88[[ $STATE = MIRRORING ]] && { echo "wait for mirroring to end"; exit 2; }
89[[ $STATE = ENABLED ]] && { echo "Already enabled"; exit 0; }
90is-root
91
92#important for templating
93export TTL='$TTL'
94PWDBACK=$PWD
95rm -f /etc/bind/named.conf.orange-box-mirror
96touch /etc/bind/named.conf.orange-box-mirror
97for web_site in archive.ubuntu.com cdimage.ubuntu.com cloud-images.ubuntu.com releases.ubuntu.com ubuntu-cloud.archive.canonical.com
98do
99
100a2ensite ${web_site}
101## TODO check sed regex if name are other then a-z and "-"
102
103## MUST export for envsubst to work
104export web_site
105export web_site_root=`echo ${web_site} |sed 's/^[a-z,-]*.//'`
106export orangebox_number
107
108envsubst < /usr/lib/orange-box/templates/mirror-bind/zones.template > /etc/bind/zones.${web_site}
109
110envsubst < /usr/lib/orange-box/templates/mirror-bind/named.conf.template >> /etc/bind/named.conf.orange-box-mirror
111done
112# avoid conflict in etc/ files with ubumirror
113envsubst < /usr/lib/orange-box/templates/ubumirror.conf > /etc/ubumirror.conf
114
115# make sure no duplicates and enable only if reach that point
116TMPFILE=`mktemp`
117grep -v "named.conf.orange-box-mirror" /etc/bind/named.conf > $TMPFILE || echo "was already off continue"
118mv $TMPFILE /etc/bind/named.conf
119chown bind:bind /etc/bind/named.conf
120echo 'include "/etc/bind/named.conf.orange-box-mirror";' >> /etc/bind/named.conf
121service bind9 restart
122service apache2 restart
123echo "ENABLED" > /etc/orangebox-mirror.state
124}
125
126disable-dns-usage()
127{
128[[ $STATE = MIRRORING ]] && { echo "Mirroring in progress usage disabled"; exit 0; }
129[[ $STATE = DISABLED ]] && { echo "Already disabled"; exit 0; }
130is-root
131TMPFILE=`mktemp`
132grep -v "named.conf.orange-box-mirror" /etc/bind/named.conf > $TMPFILE || echo "was already off continue"
133mv $TMPFILE /etc/bind/named.conf
134chown bind:bind /etc/bind/named.conf
135service bind9 restart
136echo "DISABLED" > /etc/orangebox-mirror.state
137}
138
139sync-mirror()
140{
141[[ $STATE = MIRRORING ]] && { echo "already mirroring" ;exit 2; }
142PREVIOUSSTATE=$STATE
143#trick to not rewrite disabling
144STATE="ENABLED"
145disable-dns-usage
146echo "MIRRORING" > /etc/orangebox-mirror.state
147
148echo "Updating cloud-archive mirror"
149/usr/bin/lftp -c mirror -eP=8 -x icons http://ubuntu-cloud.archive.canonical.com /srv/mirrors/ubuntu-cloud.archive.canonical.com
150
151echo "Updating cloud-images mirror"
152
153ROOTDIR="/srv/mirrors/"
154RELEASES="precise trusty"
155
156cd $ROOTDIR
157lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/query
158for r in $RELEASES
159do
160cd $ROOTDIR/
161IDREL=`grep $r cloud-images.ubuntu.com/query/released.latest.txt |awk '{print $4}' `
162IDDAY=`grep -e "server" cloud-images.ubuntu.com/query/daily.latest.txt| grep -v "server-"|grep $r |awk '{print $4}' `
163mkdir -p $ROOTDIR/cloud-images.ubuntu.com/server/releases/$r/
164cd $ROOTDIR/cloud-images.ubuntu.com/server/releases/$r/
165lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/server/releases/$r/release-$IDREL/
166mkdir -p $ROOTDIR/cloud-images.ubuntu.com/releases/$r/
167cd $ROOTDIR/cloud-images.ubuntu.com/releases/$r/
168lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/releases/$r/release-$IDREL/
169
170mkdir -p $ROOTDIR/cloud-images.ubuntu.com/server/daily/$r/
171cd $ROOTDIR/cloud-images.ubuntu.com/server/daily/$r/
172lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/server/daily/$r/$IDDAY/ || true
173
174mkdir -p $ROOTDIR/cloud-images.ubuntu.com/daily/server/$r/
175cd $ROOTDIR/cloud-images.ubuntu.com/daily/server/$r/
176lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/daily/server/$r/$IDDAY/
177
178done
179
180
181echo " apt mirror sync .... "
182cat > /srv/var/postmirror.sh<<EOF
183wget -nH --cut-dirs 4 -r --no-parent -P /srv/mirrors/archive.ubuntu.com/ubuntu/dists/trusty-updates/main/ http://archive.ubuntu.com/ubuntu/dists/trusty/main/uefi/grub2-amd64/
184
185EOF
186chmod 755 /srv/var/postmirror.sh
187run-one apt-mirror /etc/apt/orange-box-mirror.list |tee -a /var/log/orange-box-mirror.log
188
189
190run-one sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg http://maas.ubuntu.com/images/ephemeral-v2/daily/ /var/www/html/maas/images/ephemeral-v2/daily 'arch=amd64' 'subarch~(generic|hwe-t)' 'release~(trusty|precise)' --max=1
191run-one sstream-mirror --keyring=/usr/share/keyrings/ubuntu-cloudimage-keyring.gpg http://maas.ubuntu.com/images/ephemeral-v2/releases/ /var/www/html/maas/images/ephemeral-v2/releases 'arch=amd64' 'subarch~(generic|hwe-t)' 'release~(trusty|precise)' --max=1
192
193maas admin boot-source update 1 url="http://172.27.${orangebox_number}.1/maas/images/ephemeral-v2/daily/streams/v1/index.sjson"
194
195
196
197chmod -R g+rx,o+rx /srv/mirrors/*.com
198echo "SYNCED" > /etc/orangebox-mirror.state
199STATE=SYNCED
200case $PREVIOUSSTATE in
201 ENABLED)
202 enable-dns-usage
203 ;;
204 DISABLED)
205 disable-dns-usage
206 ;;
207esac
208}
209
210status()
211{
212echo "This OrangeBox state is "$STATE
213}
214
215[ $# -lt 1 ] && usage
216
217ACTION=$1
218
219case $ACTION in
220 enable)
221 enable-dns-usage
222 ;;
223 disable)
224 disable-dns-usage
225 ;;
226 sync)
227 sync-mirror
228 ;;
229 status)
230 status
231 ;;
232 *)
233 usage
234 ;;
235esac
0236
=== modified file 'usr/bin/orange-box-purge-everything'
--- usr/bin/orange-box-purge-everything 2014-10-08 11:51:07 +0000
+++ usr/bin/orange-box-purge-everything 2015-07-17 17:14:52 +0000
@@ -21,6 +21,7 @@
2121
22sudo apt-get purge $(dpkg -l | egrep "orange-box|maas|squid" | awk '{print $2}') bind922sudo apt-get purge $(dpkg -l | egrep "orange-box|maas|squid" | awk '{print $2}') bind9
23rm -rf /srv/boot-resources/* /etc/bind /root/.maascli.db23rm -rf /srv/boot-resources/* /etc/bind /root/.maascli.db
24rm -rf /home/ubuntu/.juju/environments/
24echo25echo
25echo "=== IT IS HIGHLY RECOMMENDED THAT YOU REBOOT NOW! ==="26echo "=== IT IS HIGHLY RECOMMENDED THAT YOU REBOOT NOW! ==="
26echo27echo
2728
=== added file 'usr/bin/orange-box-resetproxy'
--- usr/bin/orange-box-resetproxy 1970-01-01 00:00:00 +0000
+++ usr/bin/orange-box-resetproxy 2015-07-17 17:14:52 +0000
@@ -0,0 +1,34 @@
1#!/bin/bash
2#
3# orange-box-resetproxy
4# Copyright (C) 2014 Canonical Ltd.
5#
6# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, version 3 of the License.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20set -ex
21# Only run this as root
22if [ $EUID -ne 0 ]
23then
24 echo Execute as root or with \"sudo $0\"
25 exit 1
26fi
27
28
29
30service maas-proxy stop
31rm -rf /var/spool/maas-proxy/*
32squid3 -z -f /etc/maas/maas-proxy.conf
33sleep 20
34service maas-proxy start
035
=== modified file 'usr/bin/orange-box-run'
--- usr/bin/orange-box-run 2014-06-11 01:00:16 +0000
+++ usr/bin/orange-box-run 2015-07-17 17:14:52 +0000
@@ -24,22 +24,25 @@
24 cmd="tail -f /var/log/cloud-init-output.log | ccze -A"24 cmd="tail -f /var/log/cloud-init-output.log | ccze -A"
25fi25fi
2626
27tmux new-window -n all-nodes "ssh node1.maas $cmd" \; \27## According to OB network re-design
28 split-window -v "ssh node2.maas $cmd" \; \28. /etc/orange-box.conf
29 select-layout tiled \; \29
30 split-window -h "ssh node2.maas $cmd" \; \30tmux new-window -n all-nodes "ssh node1ob${orangebox_number}.maas $cmd" \; \
31 select-layout tiled \; \31 split-window -v "ssh node2ob${orangebox_number}.maas $cmd" \; \
32 split-window -v "ssh node3.maas $cmd" \; \32 select-layout tiled \; \
33 select-layout tiled \; \33 split-window -h "ssh node2ob${orangebox_number}.maas $cmd" \; \
34 split-window -h "ssh node4.maas $cmd" \; \34 select-layout tiled \; \
35 select-layout tiled \; \35 split-window -v "ssh node3ob${orangebox_number}.maas $cmd" \; \
36 split-window -v "ssh node5.maas $cmd" \; \36 select-layout tiled \; \
37 select-layout tiled \; \37 split-window -h "ssh node4ob${orangebox_number}.maas $cmd" \; \
38 split-window -h "ssh node6.maas $cmd" \; \38 select-layout tiled \; \
39 select-layout tiled \; \39 split-window -v "ssh node5ob${orangebox_number}.maas $cmd" \; \
40 split-window -v "ssh node7.maas $cmd" \; \40 select-layout tiled \; \
41 select-layout tiled \; \41 split-window -h "ssh node6ob${orangebox_number}.maas $cmd" \; \
42 split-window -h "ssh node8.maas $cmd" \; \42 select-layout tiled \; \
43 select-layout tiled \; \43 split-window -v "ssh node7ob${orangebox_number}.maas $cmd" \; \
44 split-window -v "ssh node9.maas $cmd" \; \44 select-layout tiled \; \
45 split-window -h "ssh node8ob${orangebox_number}.maas $cmd" \; \
46 select-layout tiled \; \
47 split-window -v "ssh node9ob${orangebox_number}.maas $cmd" \; \
45 select-layout tiled48 select-layout tiled
4649
=== added file 'usr/bin/orange-box-setup-nat'
--- usr/bin/orange-box-setup-nat 1970-01-01 00:00:00 +0000
+++ usr/bin/orange-box-setup-nat 2015-07-17 17:14:52 +0000
@@ -0,0 +1,127 @@
1#!/bin/bash
2#
3# orange-box-setup-nat - Setup NAT for external network access by nodes
4# Copyright (C) 2014 Canonical Ltd.
5#
6# Authors: Ronald McCollam <ronald.mccollam@canonical.com>
7# Dustin Kirkland <kirkland@canonical.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, version 3 of the License.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21set -x
22
23if [ "$(id -u)" != "0" ]; then
24 echo "Must be run with sudo or by root"
25 exit 77
26fi
27
28# Don't bother to restart sshd when lo is configured.
29if [ "$IFACE" = lo ]; then
30 exit 0
31fi
32
33# According to OB network re-design
34. /etc/orange-box.conf
35
36
37##internal=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
38internal=$(route -n | grep "^172\.27\.${orangebox_number}\." | sed -e "s/.* //")
39external=$(ip route ls | grep ^default | awk '{print $5}')
40
41if [ -z "$internal" ] || [ -z "$external" ]; then
42 echo "usage: $0 [INTERNAL_INTERFACE] [EXTERNAL_INTERFACE]" 1>&2
43 exit 1
44fi
45
46set -e
47
48# Update MAAS upstream DNS
49maas admin maas set-config name=upstream_dns value=172.27.252.1 || true
50
51# Intel Centrino Advanced-N 6235 and Ubuntu don't work well with Wireless-N
52if lspci -v 2>/dev/null | grep -qs "Centrino Advanced-N 6235" 2>/dev/null; then
53 sed -i -e "/options iwlwifi 11n_disable=1/d" /etc/modprobe.d/iwlwifi.conf
54 echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf
55fi
56
57# Configure NAT and IP forwarding, giving slave NUCs external network access
58# through the master.
59
60# Enable IP forwarding and save for next boot
61echo 1 > /proc/sys/net/ipv4/ip_forward
62echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/10-maas-ip-forward.conf
63echo "net.ipv4.conf.all.accept_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
64echo "net.ipv6.conf.all.accept_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
65echo "net.ipv4.conf.all.send_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
66sysctl --system
67
68#Create the static ip tables for multi OBs.
69cat > /etc/rc.local <<EOF
70#!/bin/sh -e
71#
72# rc.local
73#
74# This script is executed at the end of each multiuser runlevel.
75# Make sure that the script will "exit 0" on success or any other
76# value on error.
77#
78# In order to enable or disable this script just change the execution
79# bits.
80#
81# By default this script does nothing.
82
83EOF
84for obn in `seq 4 4 80`
85do
86 [[ $obn == ${orangebox_number} ]] ||echo " ip route add 172.27.$obn.0/22 via 172.27.252.$obn " >> /etc/rc.local
87done
88echo "exit 0" >> /etc/rc.local
89
90# Note that this script assumes no existing iptables rules. If you do have
91# any, they will be deleted.
92iptables --flush
93iptables --table nat --flush
94iptables --delete-chain
95iptables --table nat --delete-chain
96
97# Firewalling this machine
98# Allow incoming SSH
99iptables -A INPUT -i $external -p tcp --dport 22 -j ACCEPT
100iptables -A INPUT -i $external -m state --state ESTABLISHED,RELATED -j ACCEPT
101###iptables -A INPUT -i $external -j DROP
102
103# Some things use the MAAS proxy - some things don't. So turn on NAT.
104echo "Setting up ip forwarding"
105iptables -t nat -A POSTROUTING -o $external -j MASQUERADE
106iptables -A FORWARD -i $external -o $internal -m state --state RELATED,ESTABLISHED -j ACCEPT
107iptables -A FORWARD -i $internal -o $external -j ACCEPT
108# The following line sets up a transparent proxy
109iptables -A PREROUTING -t nat -i br0 -p tcp -m multiport --dports 80 -j REDIRECT --to-port 3128
110
111iptables-save > /etc/iptables/rules.v4
112
113# 14.10 deprecates the iptables-persistent service in favor of netfilter-persistent
114service iptables-persistent restart || service netfilter-persistent restart
115
116# It seems we need to restart squid3 after making these network changes
117maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
118if dpkg --compare-versions $maas_ver lt 1.6; then
119# We now run squid3, and NOT squid-deb-proxy
120 update-rc.d -f squid-deb-proxy remove || true
121 service squid-deb-proxy stop || true
122 service squid3 stop || true
123 service squid3 start
124else
125 service maas-proxy stop || true
126 service maas-proxy start || true
127fi
0128
=== removed file 'usr/bin/orange-box-setup-nat'
--- usr/bin/orange-box-setup-nat 2014-10-08 11:51:07 +0000
+++ usr/bin/orange-box-setup-nat 1970-01-01 00:00:00 +0000
@@ -1,99 +0,0 @@
1#!/bin/bash
2#
3# orange-box-setup-nat - Setup NAT for external network access by nodes
4# Copyright (C) 2014 Canonical Ltd.
5#
6# Authors: Ronald McCollam <ronald.mccollam@canonical.com>
7# Dustin Kirkland <kirkland@canonical.com>
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, version 3 of the License.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the GNU General Public License
19# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
21set -x
22
23if [ "$(id -u)" != "0" ]; then
24 echo "Must be run with sudo or by root"
25 exit 77
26fi
27
28# Don't bother to restart sshd when lo is configured.
29if [ "$IFACE" = lo ]; then
30 exit 0
31fi
32
33internal=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
34external=$(ip route ls | grep ^default | awk '{print $5}')
35
36
37if [ -z "$internal" ] || [ -z "$external" ]; then
38 echo "usage: $0 [INTERNAL_INTERFACE] [EXTERNAL_INTERFACE]" 1>&2
39 exit 1
40fi
41
42set -e
43
44# Update MAAS upstream DNS
45dns=$(nmcli d list iface $external | grep -m 1 "^IP4.DNS" | awk '{ print $2 }')
46maas admin maas set-config name=upstream_dns value=$dns || true
47
48# Intel Centrino Advanced-N 6235 and Ubuntu don't work well with Wireless-N
49if lspci -v 2>/dev/null | grep -qs "Centrino Advanced-N 6235" 2>/dev/null; then
50 sed -i -e "/options iwlwifi 11n_disable=1/d" /etc/modprobe.d/iwlwifi.conf
51 echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf
52fi
53
54# Configure NAT and IP forwarding, giving slave NUCs external network access
55# through the master.
56
57# Enable IP forwarding and save for next boot
58echo 1 > /proc/sys/net/ipv4/ip_forward
59echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/10-maas-ip-forward.conf
60sysctl --system
61
62# Note that this script assumes no existing iptables rules. If you do have
63# any, they will be deleted.
64iptables --flush
65iptables --table nat --flush
66iptables --delete-chain
67iptables --table nat --delete-chain
68
69# Firewalling this machine
70# Allow incoming SSH
71iptables -A INPUT -i $external -p tcp --dport 22 -j ACCEPT
72iptables -A INPUT -i $external -m state --state ESTABLISHED,RELATED -j ACCEPT
73iptables -A INPUT -i $external -j DROP
74
75# Some things use the MAAS proxy - some things don't. So turn on NAT.
76echo "Setting up ip forwarding"
77iptables -t nat -A POSTROUTING -o $external -j MASQUERADE
78iptables -A FORWARD -i $external -o $internal -m state --state RELATED,ESTABLISHED -j ACCEPT
79iptables -A FORWARD -i $internal -o $external -j ACCEPT
80# The following line sets up a transparent proxy
81iptables -A PREROUTING -t nat -i br0 -p tcp -m multiport --dports 80 -j REDIRECT --to-port 3128
82
83iptables-save > /etc/iptables/rules.v4
84
85# 14.10 deprecates the iptables-persistent service in favor of netfilter-persistent
86service iptables-persistent restart || service netfilter-persistent restart
87
88# It seems we need to restart squid3 after making these network changes
89maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
90if dpkg --compare-versions $maas_ver lt 1.6; then
91# We now run squid3, and NOT squid-deb-proxy
92 update-rc.d -f squid-deb-proxy remove || true
93 service squid-deb-proxy stop || true
94 service squid3 stop || true
95 service squid3 start
96else
97 service maas-proxy stop || true
98 service maas-proxy start || true
99fi
1000
=== modified file 'usr/bin/orange-box-status-all-nodes'
--- usr/bin/orange-box-status-all-nodes 2014-10-20 11:58:14 +0000
+++ usr/bin/orange-box-status-all-nodes 2015-07-17 17:14:52 +0000
@@ -22,6 +22,9 @@
22export AMT_PASSWORD=Password1+22export AMT_PASSWORD=Password1+
23ERRORS=023ERRORS=0
2424
25## According to OB network re-design
26. /etc/orange-box.conf
27
25okay() {28okay() {
26 echo "OK: $@"29 echo "OK: $@"
27}30}
@@ -35,23 +38,23 @@
35status_all_nodes() {38status_all_nodes() {
36 # Check all VM nodes39 # Check all VM nodes
37 for i in $(seq 0 2); do40 for i in $(seq 0 2); do
38 if virsh list --all | grep node0vm${i} | grep running >/dev/null 2>&1; then41 if virsh list --all | grep node0ob${orangebox_number}vm${i} | grep running >/dev/null 2>&1; then
39 okay "[node0vm${i}]: Is running"42 okay "[node0ob${orangebox_number}vm${i}]: Is running"
40 uptime=$(ssh node0vm${i}.maas "uptime" 2>/dev/null)43 uptime=$(ssh node0ob${orangebox_number}vm${i}.maas "uptime" 2>/dev/null)
41 if [ -n "$uptime" ]; then44 if [ -n "$uptime" ]; then
42 okay "[node0vm${i}]: SSH to node successful; uptime=[$uptime]"45 okay "[node0ob${orangebox_number}vm${i}]: SSH to node successful; uptime=[$uptime]"
43 else46 else
44 error "[node0vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"47 error "[node0ob${orangebox_number}vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
45 fi48 fi
46 else49 else
47 error "[node0vm${i}]: Is not running"50 error "[node0ob${orangebox_number}vm${i}]: Is not running"
48 fi51 fi
49 done52 done
50 # Check all AMT nodes53 # Check all AMT nodes
51 for i in $(seq 1 9); do54 for i in $(seq 1 9); do
52 hostname="node${i}.maas"55 hostname="node${i}ob${orangebox_number}.maas"
53 # (1) Ping AMT IP Addresses56 # (1) Ping AMT IP Addresses
54 amt_ip="10.14.4.1$i"57 amt_ip="172.27.${orangebox_number}.1$i"
55 if ping -c 1 -q $amt_ip >/dev/null 2>&1; then58 if ping -c 1 -q $amt_ip >/dev/null 2>&1; then
56 okay "[$hostname]: AMT responding to ping [$amt_ip]"59 okay "[$hostname]: AMT responding to ping [$amt_ip]"
57 else60 else
5861
=== added directory 'usr/lib/orange-box/templates'
=== added directory 'usr/lib/orange-box/templates/mirror-bind'
=== added file 'usr/lib/orange-box/templates/mirror-bind/named.conf.template'
--- usr/lib/orange-box/templates/mirror-bind/named.conf.template 1970-01-01 00:00:00 +0000
+++ usr/lib/orange-box/templates/mirror-bind/named.conf.template 2015-07-17 17:14:52 +0000
@@ -0,0 +1,6 @@
1# Zone declarations for ${web_site}
2zone "${web_site}" {
3 type master;
4 file "/etc/bind/zones.${web_site}";
5};
6
07
=== added file 'usr/lib/orange-box/templates/mirror-bind/zones.template'
--- usr/lib/orange-box/templates/mirror-bind/zones.template 1970-01-01 00:00:00 +0000
+++ usr/lib/orange-box/templates/mirror-bind/zones.template 2015-07-17 17:14:52 +0000
@@ -0,0 +1,17 @@
1$TTL 300
2@ IN SOA ${web_site} ${web_site_root} (
3 999 ; serial
4 600 ; Refresh
5 1800 ; Retry
6 604800 ; Expire
7 300 ; TTL
8 )
9
10 IN NS ${web_site}
11
12ns IN CNAME ${web_site}
13
14${web_site}. IN A 172.27.${orangebox_number}.1
15${web_site} IN A 172.27.${orangebox_number}.1
16* IN A 172.27.${orangebox_number}.1
17
018
=== added file 'usr/lib/orange-box/templates/ubumirror.conf'
--- usr/lib/orange-box/templates/ubumirror.conf 1970-01-01 00:00:00 +0000
+++ usr/lib/orange-box/templates/ubumirror.conf 2015-07-17 17:14:52 +0000
@@ -0,0 +1,58 @@
1#
2# ubumirror.conf - configuration file for the ubumirror scripts.
3#
4
5# Please set the variables below to fit your site.
6# Which email address/user that will receive failure notices.
7EMAIL=root@orangebox${orangebox_number}
8
9# Server's FQDN.
10HOSTNAME=orangebox${orangebox_number}
11
12# Bandwidth limit for all mirror scripts - set to 0 for no limit.
13SPEED=0
14
15# I/O timeout for all mirror scripts - defaults to 600 seconds.
16IO_TIMEOUT=600
17
18# UBUARC_DIR is the destination for the base of the archive directory
19# The script won't run if this variable isn't set
20UBUARC_DIR="/srv/mirrors/archive.ubuntu.com/"
21
22# UBUCDI_DIR is the destination for the base of the cdimage directory
23# The script won't run if this variable isn't set
24UBUCDI_DIR="/srv/mirrors/cdimage.ubuntu.com/"
25
26# UBUREL_DIR is the destination for the base of the releases directory
27# The script won't run if this variable isn't set
28UBUREL_DIR="/srv/mirrors/releases.ubuntu.com/"
29
30# UBUPOR_DIR is the destination for the base of the ports directory
31# The script (ubuports) won't run if this variable isn't set
32UBUPOR_DIR="/srv/mirrors/ports.ubuntu.com/"
33#
34# UBUCLOUD_DIR is the destination for the base of the cloud-image directory
35# The script (ubucloudimage) won't run if this variable isn't set
36UBUCLOUD_DIR="/srv/mirrors/cloud-images.ubuntu.com/"
37
38# LOGDIR is the destination directory of all the logs
39LOGDIR="/var/log/ubumirrors/"
40
41# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
42# upstream mirrors where the ubumirror scripts will mirror from.
43UBUARC_MIRROR=rsync://rsync.archive.ubuntu.com/ubuntu
44UBUCDI_MIRROR=rsync://rsync.cdimage.ubuntu.com/cdimage
45UBUREL_MIRROR=rsync://rsync.releases.ubuntu.com/releases
46UBUPOR_MIRROR=rsync://rsync.ports.ubuntu.com/ubuntu-ports
47UBUCLOUD_MIRROR=rsync://cloud-images.ubuntu.com/cloud-images
48
49# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
50UBUARC_EXCLUDE="--exclude binary-powerpc/ --exclude binary-sparc/ --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ --exclude installer-powerpc/ --exclude installer-sparc/ --exclude *_powerpc.deb --exclude *_powerpc.udeb --exclude *_sparc.deb --exclude *_sparc.udeb --exclude Contents-powerpc.gz --exclude Contents-sparc.gz "
51
52UBUCDI_EXCLUDE="--exclude *-powerpc.* --exclude *-sparc.* --exclude source/ "
53
54UBUREL_EXCLUDE="--exclude *-powerpc.* --exclude *-sparc.* "
55
56UBUPOR_EXCLUDE="--exclude binary-powerpc/ --exclude binary-sparc/ --exclude daily-installer-powerpc/ --exclude daily-installer-sparc/ --exclude installer-powerpc/ --exclude installer-sparc/ --exclude *_powerpc.deb --exclude *_powerpc.udeb --exclude *_sparc.deb --exclude *_sparc.udeb --exclude Contents-powerpc.gz --exclude Contents-sparc.gz "
57
58UBUCLOUD_EXCLUDE=""

Subscribers

People subscribed via source and target branches