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
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-01-21 22:04:42 +0000
3+++ debian/changelog 2015-07-17 17:14:52 +0000
4@@ -1,20 +1,82 @@
5-orange-box (1.90) unreleased; urgency=medium
6-
7- * etc/apt/orange-box-mirror.list, usr/bin/orange-box-create-package-
8- mirror:
9- - we're not currently using postmirror.sh, so set to /bin/true
10-
11- -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 09 Jan 2015 11:13:51 -0600
12-
13-orange-box (1.89-0ubuntu1) vivid; urgency=medium
14-
15+orange-box (2.10~ppa6) UNRELEASED; urgency=medium
16+
17+ * Enable local mirroring
18+ * Reduce the number of dns redirects
19+ * remove dep on ubumirror and do a faster sync to cloud-images
20+ * use lftp instead of apt-mirror for cloud-archive
21+
22+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 23:24:05 +0200
23+
24+orange-box (2.9ubuntu1~trusty) trusty; urgency=medium
25+
26+ * Change source/format for bzr-buildpackage to work
27+ * Fix issue with the ssh checking for power management of VMs
28+ *
29+ *
30+
31+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 13:32:06 +0200
32+
33+orange-box (2.9-0ubuntu1) trusty; urgency=medium
34+
35+ * Add biosdevname cmd in scripts
36+ * Add a check/heal for VMs powermanagement ssh keys
37+ *
38+
39+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 10:40:23 +0200
40+
41+orange-box (2.8ubuntu1~trusty-0ubuntu1) trusty; urgency=medium
42+
43+ [ Nicolas Thomas ]
44+ * Remove synccharmstore etc..
45+ * Adapt a number of changes to network setup etc..
46+ * Assume ob number in preinst and check in postinst in case network is not up
47+ * preinst bridgeutils
48+
49+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Thu, 11 Jun 2015 20:59:08 +0200
50+
51+orange-box (2.7) trusty; urgency=medium
52+
53+ [ Takenori Matsumoto ]
54+ * usr/bin/orange-box-setup-nat:
55+ - Fix net.ipv4.conf.all.accept_redirects
56+ * usr/bin/orange-box-add-virtual-node
57+ - Fix Add maas's ssh key into /home/ubuntu/.ssh/authorized_keys so that MAAS can control power via virsh
58+
59+ -- Takenori Matsumoto <takenori.matsumoto@canonical.com> Fri, 02 May 2015 14:13:51 -0600
60+
61+orange-box (2.6) trusty; urgency=medium
62+
63+ [ Takenori Matsumoto ]
64+ * 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
65+
66+ [ takenori ]
67+ * usr/bin/orange-box-add-virtual-nodes:
68+ * usr/bin/orange-box-add-virtual-nodes:
69+ * usr/bin/orange-box-add-virtual-nodes:
70+ * :
71+
72+ -- Takenori Matsumoto <takenori.matsumoto@canonical.com> Fri, 02 May 2015 01:13:51 -0600
73+
74+orange-box (1.90-0mirror-0ubuntu1) utopic; urgency=medium
75+
76+ [ Nicolas Thomas ]
77+ * Adding support for mirror
78+
79+ -- thomas <nicolas.thomas@canonical.com> Sat, 17 Jan 2015 00:31:37 +0100
80+
81+orange-box (1.89-0ubuntu1~trusty) trusty; urgency=medium
82+
83+ [ Dustin Kirkland ]
84 * usr/bin/orange-box-bootstrap-juju:
85 - go back to --upload-tools, please keep this!
86 * usr/bin/orange-box-add-virtual-nodes:
87 - use ~maas rather than hard coding to /home/maas
88 + note that maas 1.7 has created a home directory in /var/lib/maas
89
90- -- Dustin Kirkland <kirkland@ubuntu.com> Fri, 09 Jan 2015 11:13:49 -0600
91+ [ takenori ]
92+ * :
93+
94+ -- Dustin Kirkland <kirkland@ubuntu.com> Wed, 29 Oct 2014 09:58:53 -0500
95
96 orange-box (1.88-0ubuntu1) unstable; urgency=medium
97
98
99=== modified file 'debian/control'
100--- debian/control 2014-09-24 12:15:15 +0000
101+++ debian/control 2015-07-17 17:14:52 +0000
102@@ -3,13 +3,17 @@
103 Priority: optional
104 Maintainer: Dustin Kirkland <kirkland@ubuntu.com>
105 Build-Depends: debhelper (>= 7.0.50~),
106-Standards-Version: 3.9.4
107+Standards-Version: 3.9.5
108 Homepage: http://launchpad.net/orange-box
109
110 Package: orange-box
111 Architecture: all
112 Pre-Depends:
113- run-one,
114+ run-one,
115+ maas,
116+ maas-cluster-controller,
117+ nmap,
118+ bridge-utils,
119 Depends: ${misc:Depends},
120 amtterm,
121 apache2,
122@@ -27,10 +31,7 @@
123 libglib2.0-bin,
124 libvirt-bin,
125 openssh-server,
126- maas,
127- maas-cluster-controller,
128 network-manager,
129- nmap,
130 pastebinit,
131 qemu-kvm,
132 remmina,
133@@ -43,12 +44,16 @@
134 vlan,
135 wsmancli,
136 x11vnc,
137-Recommends:
138- landscape-client,
139+ biosdevname,
140+ lftp,
141+ rsync,
142+ simplestreams,
143 python-keystone,
144 python-neutronclient,
145 python-novaclient,
146- python-glanceclient
147+ python-glanceclient,
148+Recommends:
149+ landscape-client,
150 Description: Orange Box master node easy installation
151 This package can be installed on an Ubuntu Orange Box's master node
152 to automatically configure MAAS and Juju.
153
154=== added file 'debian/install'
155--- debian/install 1970-01-01 00:00:00 +0000
156+++ debian/install 2015-07-17 17:14:52 +0000
157@@ -0,0 +1,3 @@
158+etc/
159+home/
160+usr/
161
162=== modified file 'debian/links'
163--- debian/links 2014-05-08 23:10:25 +0000
164+++ debian/links 2015-07-17 17:14:52 +0000
165@@ -1,1 +1,1 @@
166-/usr/bin/orange-box-setup-nat /etc/network/if-up.d/orange-box-setup-nat
167+
168
169=== added file 'debian/postinst'
170--- debian/postinst 1970-01-01 00:00:00 +0000
171+++ debian/postinst 2015-07-17 17:14:52 +0000
172@@ -0,0 +1,332 @@
173+#!/bin/bash
174+
175+set -e
176+set -x
177+
178+PKG="orange-box"
179+RETRY=120
180+
181+. /usr/lib/orange-box/inc/common
182+. /etc/orange-box.conf
183+
184+check_orangebox_number() {
185+## be sure to wake AMT first give some time and ping again.
186+nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 > /dev/null
187+sleep 12
188+nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 > /dev/null
189+NUMAMTS=`nmap -p 16992 -oG - 172.27.${orangebox_number}.11-20 |grep open |wc -l`
190+[[ $NUMAMTS < 3 ]] && (echo "AMT or hostname not set correctly"; rm -f /etc/orange-box.conf;exit 2)
191+true
192+}
193+
194+
195+router_ip=172.27.${orangebox_number}.1
196+static_low=172.27.`expr ${orangebox_number} + 2`.1
197+static_high=172.27.`expr ${orangebox_number} + 2`.254
198+dhcp_low=172.27.`expr ${orangebox_number} + 1`.1
199+dhcp_high=172.27.`expr ${orangebox_number} + 1`.254
200+br0_broadcast=172.27.`expr ${orangebox_number} + 3`.255
201+
202+setup_maas_admin() {
203+ # Configure the MAAS admin user
204+ # Sadly, there's no way to test if the user has been created already,
205+ # so ignore errors for idempotence
206+ maas-region-admin createadmin --username admin --email maas-admin@example.com --password="admin" 2>/dev/null || true
207+ . /etc/maas/maas_cluster.conf
208+ APIKEY=$(maas-region-admin apikey --username admin | tail -n1)
209+ maas login admin $MAAS_URL $APIKEY
210+}
211+
212+setup_maas_networking() {
213+ count=0
214+ while ! maas admin node-group-interfaces list $CLUSTER_UUID >/dev/null 2>&1; do
215+ count=$((count+1))
216+ sleep 1
217+ if [ $count -gt $RETRY ]; then
218+ error "[maas admin node-group-interfaces list] failed [$RETRY] times"
219+ fi
220+ done
221+ internal_interface=$(route -n | grep "^172\.27\.${orangebox_number}\." | sed -e "s/.* //")
222+ # Support MAAS 1.5, and 1.6
223+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
224+ if dpkg --compare-versions $maas_ver lt 1.6; then
225+ 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
226+
227+ else
228+ sh -x /var/lib/dpkg/info/maas-dns.postinst configure
229+ 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
230+
231+ fi
232+ # Setup nat
233+ # Ensure we have an external connection
234+ orange-box-test-uplink
235+ orange-box-setup-nat
236+ # Redirect to MAAS web interface
237+ cat >/var/www/html/index.html <<EOF
238+<meta http-equiv="refresh" content="0; url=/MAAS">
239+EOF
240+}
241+
242+setup_dns() {
243+ # Set MAAS upstream DNS
244+ maas admin maas set-config name=upstream_dns value=172.27.252.1
245+ sed -i -e "/^nameserver ${router_ip}$/d" /etc/resolvconf/resolv.conf.d/head
246+ echo "nameserver ${router_ip}" >> /etc/resolvconf/resolv.conf.d/head
247+ resolvconf -u
248+ sed -e 's/dnssec-validation auto;/dnssec-enable no;dnssec-validation no;/g' -i /etc/bind/named.conf.options
249+}
250+
251+setup_squid() {
252+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
253+ if dpkg --compare-versions $maas_ver lt 1.6; then
254+ # This is now a transparent proxy
255+ if [ -d "/etc/squid-deb-proxy" ]; then
256+ echo > /etc/squid-deb-proxy/squid-deb-proxy.conf
257+ fi
258+ cat /usr/lib/orange-box/inc/squid.conf > /etc/squid3/squid.conf
259+ # Enable squid3, disable squid-deb-proxy
260+ update-rc.d -f squid-deb-proxy remove || true
261+ invoke-rc.d squid-deb-proxy stop || true
262+ # Create directories, if necessary
263+ squid3 -z -N || true
264+ ensure_running squid3
265+ fi
266+ true
267+}
268+
269+setup_local_mirror() {
270+ # Set up the local mirror
271+# a2ensite archive
272+# a2ensite ubuntu-cloud
273+# Must enable this to make sstream and others works
274+ a2ensite 000-default
275+ mkdir -p /srv/mirrors/archive.ubuntu.com
276+ echo '<meta http-equiv="refresh" content="0; url=MAAS/">' > /srv/mirrors/archive.ubuntu.com/index.html
277+ invoke-rc.d apache2 stop || true
278+ invoke-rc.d apache2 start
279+}
280+
281+setup_boot_resources() {
282+ # Importing boot resources
283+ # This might take a long time.
284+ # MAAS won't work very well until this is done, so we're going to block
285+ # until this completes.
286+ orange-box-test-uplink
287+ # Support MAAS 1.5, and newer
288+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
289+ if dpkg --compare-versions $maas_ver lt 1.6; then
290+ cat /usr/lib/orange-box/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
291+ run-this-one maas-import-pxe-files --config-file /etc/maas/bootresources.yaml
292+ else
293+ maas admin boot-resources import
294+ while [ $(maas admin boot-images read $CLUSTER_UUID | wc -l) -lt 10 ]; do
295+ # Waiting for images to download
296+ sleep 10
297+ done
298+ # add precise to the list but don't wait it is not necessary now.
299+ # usual failure is already there..
300+ maas admin boot-source-selections create 1 os="ubuntu" release="precise" arches="amd64" subarches="*" labels="*" || true
301+ maas admin boot-resources import
302+ fi
303+}
304+
305+setup_desktop() {
306+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.background picture-uri file:///usr/share/orange-box/orange-box-background.png
307+ sudo -u ubuntu dbus-launch gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop', 'byobu.desktop', 'remmina.desktop']"
308+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.session idle-delay 999999
309+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
310+ sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
311+ if [ -e /etc/lightdm/lightdm.conf ]; then
312+ sed -i -e "/autologin-user=/d" /etc/lightdm/users.conf
313+ echo "autologin-user=ubuntu" >> /etc/lightdm/users.conf
314+ fi
315+ echo "enabled=0" > /etc/default/apport
316+ invoke-rc.d apport stop || true
317+}
318+
319+setup_ssh_keys() {
320+ # Disable remote password authentication, since our username/password
321+ # combo is very well known
322+ if ! grep -qs "^PasswordAuthentication no" /etc/ssh/sshd_config 2>/dev/null; then
323+ echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
324+ invoke-rc.d ssh stop || true
325+ invoke-rc.d ssh start
326+ fi
327+ if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then
328+ su -l ubuntu -c "ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa"
329+ fi
330+ maas admin sshkeys new key="$(cat /home/ubuntu/.ssh/id_rsa.pub)" || true
331+ if ! grep -qs "^Host.*maas$" /home/ubuntu/.ssh/config; then
332+ cat <<EOF >>/home/ubuntu/.ssh/config
333+
334+Host *.maas
335+UserKnownHostsFile /dev/null
336+StrictHostKeyChecking no
337+CheckHostIP no
338+
339+EOF
340+ fi
341+ chmod 600 /home/ubuntu/.ssh/config
342+ chown -R ubuntu:ubuntu /home/ubuntu/.ssh/config
343+
344+}
345+
346+setup_juju() {
347+ mkdir -p /home/ubuntu/.juju
348+ cat >/home/ubuntu/.juju/environments.yaml <<EOF
349+default: maas
350+environments:
351+ maas:
352+ type: maas
353+ maas-server: 'http://${router_ip}/MAAS/'
354+ maas-oauth: '$APIKEY'
355+ default-series: trusty
356+ #enable-os-upgrade: false
357+ authorized-keys-path: /home/ubuntu/.ssh/id_rsa.pub
358+ admin-secret: 'admin'
359+ logging-config: '<root>=DEBUG'
360+ lxc-clone: true
361+EOF
362+ rm -rf /home/ubuntu/.juju-plugins
363+ git clone https://github.com/juju/plugins /home/ubuntu/.juju-plugins
364+ sudo chown -R ubuntu:ubuntu /home/ubuntu/
365+ echo "PATH=\$PATH:/home/ubuntu/.juju-plugins:/home/ubuntu/Examples/bin" >> /home/ubuntu/.bashrc
366+ #Required for local charm deployments to work.
367+ sed -i -e '/^export JUJU_REPOSITORY=/d' /home/ubuntu/.bashrc
368+}
369+
370+ensure_running() {
371+ job="$1"
372+ count=1
373+ while true; do
374+ if (service $job status | grep -qs "running"); then
375+ break
376+ fi
377+ invoke-rc.d $job start
378+ sleep 1
379+ count=$((count+1))
380+ if [ $count -gt $RETRY ]; then
381+ error "[$job] refused to start [$RETRY] times"
382+ fi
383+ done
384+}
385+
386+ensure_running_maas() {
387+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
388+ if dpkg --compare-versions $maas_ver lt 1.6; then
389+ ensure_running maas-region-celery
390+ ensure_running maas-cluster-celery
391+ ensure_running maas-txlongpoll
392+ ensure_running maas-pserv
393+ ensure_running maas-dhcp-server
394+ ensure_running squid3
395+ else
396+ ensure_running apache2
397+ ensure_running maas-clusterd
398+ ensure_running maas-dhcpd
399+ ensure_running maas-proxy
400+ fi
401+ invoke-rc.d tgt stop || true
402+ invoke-rc.d tgt start
403+ ensure_running tgt
404+}
405+
406+setup_all_nodes() {
407+ # Ensure that pxe and dhcp are running
408+ ensure_running_maas
409+ maas admin node-groups import-boot-images
410+ orange-box-add-physical-nodes
411+ orange-box-add-virtual-nodes
412+}
413+
414+apply_patches() {
415+ # This is a DISGUSTING HACK that needs to go away
416+ # as soon as MAAS ships these fixes
417+ cd /
418+ cat /usr/lib/orange-box/patches/acquire_languages_none.patch | patch -p0 -N || true
419+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
420+ if dpkg --compare-versions $maas_ver lt 1.6; then
421+ cat /usr/lib/orange-box/patches/arp_ip_order.patch | patch -p0 -N || true
422+ cat /usr/lib/orange-box/patches/try_amt_harder.patch | patch -p0 -N || true
423+ rm -f /usr/lib/python2.7/dist-packages/provisioningserver/utils/__init__.pyc
424+ invoke-rc.d maas-cluster-celery stop || true
425+ invoke-rc.d maas-cluster-celery start
426+ fi
427+ cd -
428+}
429+
430+setup_landscape() {
431+ # The master node will be managed by Landscape
432+ # TODO: this is currently hardcoded to our own landscape account
433+ if which landscape-config; then
434+ case "$(hostname)" in
435+ OrangeBox*|orangebox*)
436+ landscape-config -a canonical-orange -t "$(hostname)__$(dmidecode -s baseboard-serial-number)" -p ubuntu-aubergine --script-users=ALL --silent --include-manager-plugins=ScriptExecution || true
437+ ;;
438+ esac
439+ fi
440+}
441+
442+setup_examples() {
443+ mkdir -p /home/ubuntu
444+ if [ -d /home/ubuntu/Examples/.bzr ]; then
445+ bzr pull >/dev/null 2>&1 || true
446+ elif [ -d /home/ubuntu/Examples ]; then
447+ mv -f /home/ubuntu/Examples /home/ubuntu/.Examples
448+ bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
449+ else
450+ bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
451+ fi
452+ chown -R ubuntu:ubuntu /home/ubuntu
453+}
454+
455+case "$1" in
456+ configure)
457+ check_orangebox_number
458+ setup_desktop
459+ ###apply_patches
460+ setup_maas_admin
461+ setup_dns
462+ if [ -n "$2" ]; then
463+ echo
464+ echo "INFO: Skipping importing boot resources, since this is a package upgrade"
465+ echo "INFO: If you want to update boot resources, run:"
466+ echo "INFO: sudo maas-import-pxe-files"
467+ echo "INFO: sudo maas admin node-groups import-boot-images"
468+ echo
469+ else
470+ setup_boot_resources
471+ fi
472+ setup_maas_networking
473+ maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
474+ if dpkg --compare-versions $maas_ver lt 1.6; then
475+ setup_squid
476+ fi
477+ setup_local_mirror
478+ setup_ssh_keys
479+ setup_juju
480+ if [ -n "$2" ]; then
481+ echo
482+ echo "INFO: Skipping adding all nodes, since this is a package upgrade"
483+ echo "INFO: If you want to delete and add all nodes again, run:"
484+ echo "INFO: sudo orange-box-add-physical-nodes"
485+ echo "INFO: sudo orange-box-add-virtual-nodes"
486+ echo
487+ else
488+ # Only add all nodes and configure landscape on initial install, not upgrades
489+ setup_landscape
490+ setup_all_nodes
491+ fi
492+# setup_examples
493+ ;;
494+ abort-upgrade|abort-remove|abort-deconfigure)
495+ ;;
496+ *)
497+ echo "postinst called with unknown argument \`$1'" >&2
498+ exit 1
499+ ;;
500+esac
501+
502+#DEBHELPER#
503+
504+exit 0
505
506=== removed file 'debian/postinst'
507--- debian/postinst 2014-11-27 23:56:37 +0000
508+++ debian/postinst 1970-01-01 00:00:00 +0000
509@@ -1,310 +0,0 @@
510-#!/bin/sh
511-
512-set -e
513-set -x
514-
515-PKG="orange-box"
516-RETRY=120
517-
518-. /usr/lib/orange-box/inc/common
519-
520-setup_maas_admin() {
521- # Configure the MAAS admin user
522- # Sadly, there's no way to test if the user has been created already,
523- # so ignore errors for idempotence
524- maas-region-admin createadmin --username admin --email maas-admin@example.com --password="admin" 2>/dev/null || true
525- . /etc/maas/maas_cluster.conf
526- APIKEY=$(maas-region-admin apikey --username admin | tail -n1)
527- maas login admin $MAAS_URL $APIKEY
528-}
529-
530-setup_maas_networking() {
531- count=0
532- while ! maas admin node-group-interfaces list $CLUSTER_UUID >/dev/null 2>&1; do
533- count=$((count+1))
534- sleep 1
535- if [ $count -gt $RETRY ]; then
536- error "[maas admin node-group-interfaces list] failed [$RETRY] times"
537- fi
538- done
539- internal_interface=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
540- # Support MAAS 1.5, and 1.6
541- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
542- if dpkg --compare-versions $maas_ver lt 1.6; then
543- 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
544- else
545- sh -x /var/lib/dpkg/info/maas-dns.postinst configure
546- 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
547- fi
548- # Setup nat
549- # Ensure we have an external connection
550- orange-box-test-uplink
551- orange-box-setup-nat
552- # Redirect to MAAS web interface
553- cat >/var/www/html/index.html <<EOF
554-<meta http-equiv="refresh" content="0; url=/MAAS">
555-EOF
556-}
557-
558-setup_dns() {
559- # Set MAAS upstream DNS
560- external_interface=$(ip route ls | grep ^default | awk '{print $5}')
561- dns=$(nmcli d list iface $external_interface | grep -m 1 "^IP4.DNS" | awk '{ print $2 }')
562- maas admin maas set-config name=upstream_dns value=$dns
563- sed -i -e "/^nameserver 10.14.4.1$/d" /etc/resolvconf/resolv.conf.d/head
564- echo "nameserver 10.14.4.1" >> /etc/resolvconf/resolv.conf.d/head
565- resolvconf -u
566- sed -e 's/dnssec-validation auto;/dnssec-enable no;dnssec-validation no;/g' -i /etc/bind/named.conf.options
567-}
568-
569-setup_squid() {
570- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
571- if dpkg --compare-versions $maas_ver lt 1.6; then
572- # This is now a transparent proxy
573- if [ -d "/etc/squid-deb-proxy" ]; then
574- echo > /etc/squid-deb-proxy/squid-deb-proxy.conf
575- fi
576- cat /usr/lib/orange-box/inc/squid.conf > /etc/squid3/squid.conf
577- # Disable squid3, enable squid-deb-proxy
578- update-rc.d -f squid-deb-proxy remove || true
579- invoke-rc.d squid-deb-proxy stop || true
580- # Create directories, if necessary
581- squid3 -z -N || true
582- ensure_running squid3
583- fi
584- true
585-}
586-
587-setup_local_mirror() {
588- # Set up the local mirror
589- a2ensite archive
590- a2ensite ubuntu-cloud
591- a2dissite 000-default
592- mkdir -p /srv/mirrors/archive.ubuntu.com
593- echo '<meta http-equiv="refresh" content="0; url=MAAS/">' > /srv/mirrors/archive.ubuntu.com/index.html
594- invoke-rc.d apache2 stop || true
595- invoke-rc.d apache2 start
596- # Sync the charm store to /srv/charmstore
597- # Note: This is going to take a LONG time
598- orange-box-sync-charmstore &
599-}
600-
601-setup_boot_resources() {
602- # Importing boot resources
603- # This might take a long time.
604- # MAAS won't work very well until this is done, so we're going to block
605- # until this completes.
606- orange-box-test-uplink
607- # Support MAAS 1.5, and newer
608- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
609- if dpkg --compare-versions $maas_ver lt 1.6; then
610- cat /usr/lib/orange-box/inc/bootresources_1.5.yaml > /etc/maas/bootresources.yaml
611- run-this-one maas-import-pxe-files --config-file /etc/maas/bootresources.yaml
612- else
613- maas admin boot-resources import
614- while [ $(maas admin boot-images read $CLUSTER_UUID | wc -l) -lt 10 ]; do
615- # Waiting for images to download
616- sleep 10
617- done
618- fi
619-}
620-
621-setup_desktop() {
622- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.background picture-uri file:///usr/share/orange-box/orange-box-background.png
623- sudo -u ubuntu dbus-launch gsettings set com.canonical.Unity.Launcher favorites "['firefox.desktop', 'byobu.desktop', 'remmina.desktop']"
624- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.session idle-delay 999999
625- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver idle-activation-enabled false
626- sudo -u ubuntu dbus-launch gsettings set org.gnome.desktop.screensaver lock-enabled false
627- if [ -e /etc/lightdm/lightdm.conf ]; then
628- sed -i -e "/autologin-user=/d" /etc/lightdm/users.conf
629- echo "autologin-user=ubuntu" >> /etc/lightdm/users.conf
630- fi
631- echo "enabled=0" > /etc/default/apport
632- invoke-rc.d apport stop || true
633-}
634-
635-setup_ssh_keys() {
636- # Disable remote password authentication, since our username/password
637- # combo is very well known
638- if ! grep -qs "^PasswordAuthentication no" /etc/ssh/sshd_config 2>/dev/null; then
639- echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
640- invoke-rc.d ssh stop || true
641- invoke-rc.d ssh start
642- fi
643- if [ ! -e /home/ubuntu/.ssh/id_rsa ]; then
644- su -l ubuntu -c "ssh-keygen -N '' -f /home/ubuntu/.ssh/id_rsa"
645- fi
646- maas admin sshkeys new key="$(cat /home/ubuntu/.ssh/id_rsa.pub)" || true
647- if ! grep -qs "^Host.*maas$" /home/ubuntu/.ssh/config; then
648- cat <<EOF >>/home/ubuntu/.ssh/config
649-
650-Host *.maas
651-UserKnownHostsFile /dev/null
652-StrictHostKeyChecking no
653-CheckHostIP no
654-
655-EOF
656- fi
657- chmod 600 /home/ubuntu/.ssh/config
658- chown -R ubuntu:ubuntu /home/ubuntu/.ssh/config
659-}
660-
661-setup_juju() {
662- mkdir -p /home/ubuntu/.juju
663- cat >/home/ubuntu/.juju/environments.yaml <<EOF
664-default: maas
665-environments:
666- maas:
667- type: maas
668- maas-server: 'http://10.14.4.1/MAAS/'
669- maas-oauth: '$APIKEY'
670- default-series: trusty
671- #enable-os-upgrade: false
672- authorized-keys-path: /home/ubuntu/.ssh/id_rsa.pub
673- admin-secret: 'admin'
674- logging-config: '<root>=DEBUG'
675- lxc-clone: true
676-EOF
677- rm -rf /home/ubuntu/.juju-plugins
678- git clone https://github.com/juju/plugins /home/ubuntu/.juju-plugins
679- sudo chown -R ubuntu:ubuntu /home/ubuntu/
680- echo "PATH=\$PATH:/home/ubuntu/.juju-plugins:/home/ubuntu/Examples/bin" >> /home/ubuntu/.bashrc
681- #Required for local charm deployments to work.
682- sed -i -e '/^export JUJU_REPOSITORY=/d' /home/ubuntu/.bashrc
683- echo "export JUJU_REPOSITORY=/srv/charmstore" >> /home/ubuntu/.bashrc
684-}
685-
686-ensure_running() {
687- job="$1"
688- count=1
689- while true; do
690- if (service $job status | grep -qs "running"); then
691- break
692- fi
693- invoke-rc.d $job start
694- sleep 1
695- count=$((count+1))
696- if [ $count -gt $RETRY ]; then
697- error "[$job] refused to start [$RETRY] times"
698- fi
699- done
700-}
701-
702-ensure_running_maas() {
703- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
704- if dpkg --compare-versions $maas_ver lt 1.6; then
705- ensure_running maas-region-celery
706- ensure_running maas-cluster-celery
707- ensure_running maas-txlongpoll
708- ensure_running maas-pserv
709- ensure_running maas-dhcp-server
710- ensure_running squid3
711- else
712- ensure_running apache2
713- ensure_running maas-clusterd
714- ensure_running maas-dhcpd
715- ensure_running maas-proxy
716- fi
717- invoke-rc.d tgt stop || true
718- invoke-rc.d tgt start
719- ensure_running tgt
720-}
721-
722-setup_all_nodes() {
723- # Ensure that pxe and dhcp are running
724- ensure_running_maas
725- maas admin node-groups import-boot-images
726- orange-box-add-physical-nodes
727- orange-box-add-virtual-nodes
728-}
729-
730-apply_patches() {
731- # This is a DISGUSTING HACK that needs to go away
732- # as soon as MAAS ships these fixes
733- cd /
734- cat /usr/lib/orange-box/patches/acquire_languages_none.patch | patch -p0 -N || true
735- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
736- if dpkg --compare-versions $maas_ver lt 1.6; then
737- cat /usr/lib/orange-box/patches/arp_ip_order.patch | patch -p0 -N || true
738- cat /usr/lib/orange-box/patches/try_amt_harder.patch | patch -p0 -N || true
739- rm -f /usr/lib/python2.7/dist-packages/provisioningserver/utils/__init__.pyc
740- invoke-rc.d maas-cluster-celery stop || true
741- invoke-rc.d maas-cluster-celery start
742- fi
743- cd -
744-}
745-
746-setup_landscape() {
747- # The master node will be managed by Landscape
748- # TODO: this is currently hardcoded to our own landscape account
749- if which landscape-config; then
750- case "$(hostname)" in
751- OrangeBox*|orangebox*)
752- landscape-config -a canonical-orange -t "$(hostname)__$(dmidecode -s baseboard-serial-number)" -p ubuntu-aubergine --script-users=ALL --silent --include-manager-plugins=ScriptExecution || true
753- ;;
754- esac
755- fi
756-}
757-
758-setup_examples() {
759- mkdir -p /home/ubuntu
760- if [ -d /home/ubuntu/Examples/.bzr ]; then
761- bzr pull >/dev/null 2>&1 || true
762- elif [ -d /home/ubuntu/Examples ]; then
763- mv -f /home/ubuntu/Examples /home/ubuntu/.Examples
764- bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
765- else
766- bzr branch lp:orange-box-examples /home/ubuntu/Examples >/dev/null 2>&1 || true
767- fi
768- chown -R ubuntu:ubuntu /home/ubuntu
769-}
770-
771-case "$1" in
772- configure)
773- setup_desktop
774- apply_patches
775- setup_maas_admin
776- setup_dns
777- if [ -n "$2" ]; then
778- echo
779- echo "INFO: Skipping importing boot resources, since this is a package upgrade"
780- echo "INFO: If you want to update boot resources, run:"
781- echo "INFO: sudo maas-import-pxe-files"
782- echo "INFO: sudo maas admin node-groups import-boot-images"
783- echo
784- else
785- setup_boot_resources
786- fi
787- setup_maas_networking
788- maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
789- if dpkg --compare-versions $maas_ver lt 1.6; then
790- setup_squid
791- fi
792- setup_local_mirror
793- setup_ssh_keys
794- setup_juju
795- if [ -n "$2" ]; then
796- echo
797- echo "INFO: Skipping adding all nodes, since this is a package upgrade"
798- echo "INFO: If you want to delete and add all nodes again, run:"
799- echo "INFO: sudo orange-box-add-physical-nodes"
800- echo "INFO: sudo orange-box-add-virtual-nodes"
801- echo
802- else
803- # Only add all nodes and configure landscape on initial install, not upgrades
804- setup_landscape
805- setup_all_nodes
806- fi
807- setup_examples
808- ;;
809- abort-upgrade|abort-remove|abort-deconfigure)
810- ;;
811- *)
812- echo "postinst called with unknown argument \`$1'" >&2
813- exit 1
814- ;;
815-esac
816-
817-#DEBHELPER#
818-
819-exit 0
820
821=== added file 'debian/postrm'
822--- debian/postrm 1970-01-01 00:00:00 +0000
823+++ debian/postrm 2015-07-17 17:14:52 +0000
824@@ -0,0 +1,23 @@
825+#!/bin/sh
826+
827+set -e
828+
829+webserver="apache2"
830+
831+case "$1" in
832+ remove)
833+ 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
834+ if [ -e "/etc/apache2/sites-enabled/${i}.conf" ]; then
835+ a2dissite $i
836+ fi
837+ done
838+ invoke-rc.d $webserver reload
839+ rm -f /var/log/orange-box-mirror.log
840+# rm -rf /etc/maas
841+ rm -rf /var/lib/orange-box
842+ ;;
843+esac
844+
845+#DEBHELPER#
846+
847+exit 0
848
849=== removed file 'debian/postrm'
850--- debian/postrm 2014-07-17 04:12:46 +0000
851+++ debian/postrm 1970-01-01 00:00:00 +0000
852@@ -1,23 +0,0 @@
853-#!/bin/sh
854-
855-set -e
856-
857-webserver="apache2"
858-
859-case "$1" in
860- remove)
861- for i in archive ubuntu-cloud; do
862- if [ -e "/etc/apache2/sites-enabled/${i}.conf" ]; then
863- a2dissite $i
864- fi
865- done
866- invoke-rc.d $webserver reload
867- rm -f /var/log/orange-box-mirror.log
868- rm -rf /etc/maas
869- rm -rf /var/lib/orange-box
870- ;;
871-esac
872-
873-#DEBHELPER#
874-
875-exit 0
876
877=== added file 'debian/preinst'
878--- debian/preinst 1970-01-01 00:00:00 +0000
879+++ debian/preinst 2015-07-17 17:14:52 +0000
880@@ -0,0 +1,168 @@
881+#!/bin/sh
882+set -e
883+set -x
884+
885+get_orangebox_number() {
886+## assume hostname as been set correctly .. will be checked in postinst
887+OBNum=`hostname | cut -c 10- -`
888+echo $OBNum
889+echo "## Script generated file, others rely, know what your doing if tempering" > /etc/orange-box.conf
890+echo "orangebox_number=$OBNum" >> /etc/orange-box.conf
891+echo "orangebox_mirror=INIT">> /etc/orange-box.conf
892+}
893+
894+### According to OB networking re-design
895+orangebox_number=`get_orangebox_number`
896+default_maas_ip=172.27.${orangebox_number}.1
897+gateway_ip=172.27.252.1
898+external_ip=172.27.252.${orangebox_number}
899+internal_ip=172.27.${orangebox_number}.1
900+br0_broadcast=172.27.`expr ${orangebox_number} + 3`.255
901+
902+#unnecessary comment
903+
904+preflight_checks() {
905+ if [ "$(id -u ubuntu)" != "1000" ]; then
906+ echo "ERROR: Read the docs; a proper OrangeBox setup requires the default user to be [ubuntu]" 1>&2
907+ exit 1
908+ fi
909+ #ensure em1 is the correct name
910+ biosdevname -i eth1 || (echo "biosdevname should have been run already assume it does"; true)
911+ # TODO: Check that the AMTs are on static IPs
912+ # TODO: Check dual hard drives, which one is which
913+ # TODO: Ensure we have two interfaces, one internal, one external
914+}
915+
916+setup_debconf() {
917+ echo "debconf maas/default-maas-url string $default_maas_ip" | debconf-set-selections -
918+ echo "debconf maas-cluster-controller/maas-url string http://${default_maas_ip}/MAAS" | debconf-set-selections -
919+ echo "debconf maas/installation-note boolean true" | debconf-set-selections -
920+ echo "debconf iptables-persistent/autosave_done boolean true" | debconf-set-selections -
921+ echo "debconf iptables-persistent/autosave_v4 boolean true" | debconf-set-selections -
922+ echo "debconf iptables-persistent/autosave_v6 boolean true" | debconf-set-selections -
923+}
924+
925+setup_networking() {
926+ modprobe 8021q || true
927+ sed -i -e "/8021q/d" /etc/modules || true
928+ echo "8021q" >> /etc/modules
929+ # Set up the two network interfaces
930+ external_interface=$(ip route ls | grep ^default | awk '{print $5}')
931+ # TODO: ip addr ls
932+ for interface in $(ifconfig -a -s | grep -v ^Iface | awk '{print $1}'); do
933+ case "$interface" in
934+ lo|br*|wlan*|vnet*)
935+ continue
936+ ;;
937+ $external_interface)
938+ continue
939+ ;;
940+ *)
941+ internal_interface="$interface"
942+ break
943+ ;;
944+ esac
945+ done
946+ # Set a sane default as em1 because the biosdevname should have been installed and run
947+ [ -z "$internal_interface" ] && internal_interface=em1
948+ # TODO: use ip
949+ default_mac=$(ifconfig "$internal_interface" | grep "^$internal_interface" | sed -e "s/.*HWaddr //")
950+ # Tell NetworkManager to piss off
951+ sed -i -e "/^unmanaged-devices=mac:$default_mac$/d" /etc/NetworkManager/NetworkManager.conf
952+ cat >>/etc/NetworkManager/NetworkManager.conf <<EOF
953+[keyfile]
954+unmanaged-devices=mac:$default_mac
955+EOF
956+ invoke-rc.d network-manager stop || true
957+ invoke-rc.d network-manager start
958+ cat >/etc/network/interfaces <<EOF
959+auto lo
960+iface lo inet loopback
961+
962+auto $external_interface
963+iface $external_interface inet static
964+ address ${external_ip}
965+ netmask 255.255.252.0
966+ broadcast 172.27.255.255
967+ gateway ${gateway_ip}
968+ dns-nameservers ${gateway_ip}
969+
970+auto $internal_interface
971+iface $internal_interface inet manual
972+
973+
974+auto br0
975+iface br0 inet static
976+ address ${internal_ip}
977+ netmask 255.255.252.0
978+ broadcast $br0_broadcast
979+ bridge_ports $internal_interface
980+ bridge_stp off
981+ bridge_fd 0
982+ bridge_maxwait 0
983+
984+# VLAN 2, Uplink network
985+iface ${internal_interface}.2 inet dhcp
986+vlan-raw-device $internal_interface
987+
988+# Network management alias
989+iface br0:1 inet static
990+address 10.90.90.91
991+netmask 255.255.255.0
992+broadcast 10.90.90.255
993+
994+EOF
995+ ifdown --force $internal_interface || true
996+ ifdown --force br0 || true
997+ ifup $internal_interface
998+ ifup br0
999+ ### Same for $external_interface
1000+ ifdown --force $external_interface || true
1001+ ifup $external_interface
1002+
1003+ # Wait a moment for the network to normalize
1004+ echo "INFO: Ensure networking has settled"
1005+ run-one-until-success ping -c 10 maas.ubuntu.com
1006+}
1007+
1008+setup_external_drive() {
1009+ # External drive must be:
1010+ # a) partitioned into 1 big partition
1011+ # b) ext4 formatted
1012+ # Find root disk
1013+ root_disk=$(mount | grep " on / " | awk '{print $1}' | sed -e "s/[0-9]\+$//")
1014+ # Find biggest non-root disk
1015+ ext_disk=$(fdisk -l | grep "^Disk /" | grep -v $root_disk | sort -k4 -n -r | awk '{print $2}' | awk -F: '{print $1}')
1016+ partition="${ext_disk}1"
1017+ if [ -b "$ext_disk" ]; then
1018+ if [ ! -b "$partition" ]; then
1019+ # Create the partition, if it doesn't exist already
1020+ echo "n
1021+p
1022+1
1023+
1024+
1025+w
1026+"|fdisk "$ext_disk"
1027+ mkfs.ext4 "$partition"
1028+ fi
1029+ sed -i -e "/ \/srv/d" /etc/fstab
1030+ # Add the fstab entry
1031+ uuid=$(blkid -s UUID -o value "$partition")
1032+ echo "UUID=$uuid /srv ext4 defaults 1 1" >> /etc/fstab
1033+ fi
1034+ umount $partition || true
1035+ mount -a
1036+ chown root:root /srv
1037+ chmod 755 /srv
1038+}
1039+
1040+
1041+preflight_checks
1042+setup_external_drive
1043+setup_debconf
1044+setup_networking
1045+
1046+#DEBHELPER#
1047+
1048+exit 0
1049
1050=== removed file 'debian/preinst'
1051--- debian/preinst 2014-08-25 14:32:16 +0000
1052+++ debian/preinst 1970-01-01 00:00:00 +0000
1053@@ -1,136 +0,0 @@
1054-#!/bin/sh
1055-set -e
1056-set -x
1057-
1058-#unnecessary comment
1059-
1060-preflight_checks() {
1061- if [ "$(id -u ubuntu)" != "1000" ]; then
1062- echo "ERROR: Read the docs; a proper OrangeBox setup requires the default user to be [ubuntu]" 1>&2
1063- exit 1
1064- fi
1065- # TODO: Check that the AMTs are on static IPs
1066- # TODO: Check dual hard drives, which one is which
1067- # TODO: Ensure we have two interfaces, one internal, one external
1068-}
1069-
1070-setup_debconf() {
1071- echo "debconf maas/default-maas-url string 10.14.4.1" | debconf-set-selections -
1072- echo "debconf maas-cluster-controller/maas-url string http://10.14.4.1/MAAS" | debconf-set-selections -
1073- echo "debconf maas/installation-note boolean true" | debconf-set-selections -
1074- echo "debconf iptables-persistent/autosave_done boolean true" | debconf-set-selections -
1075- echo "debconf iptables-persistent/autosave_v4 boolean true" | debconf-set-selections -
1076- echo "debconf iptables-persistent/autosave_v6 boolean true" | debconf-set-selections -
1077-}
1078-
1079-setup_networking() {
1080- modprobe 8021q || true
1081- sed -i -e "/8021q/d" /etc/modules || true
1082- echo "8021q" >> /etc/modules
1083- # Set up the two network interfaces
1084- external_interface=$(ip route ls | grep ^default | awk '{print $5}')
1085- # TODO: ip addr ls
1086- for interface in $(ifconfig -a -s | grep -v ^Iface | awk '{print $1}'); do
1087- case "$interface" in
1088- lo|br*|wlan*)
1089- continue
1090- ;;
1091- $external_interface)
1092- continue
1093- ;;
1094- *)
1095- internal_interface="$interface"
1096- break
1097- ;;
1098- esac
1099- done
1100- # Set a sane default
1101- [ -z "$internal_interface" ] && internal_interface=eth0
1102- # TODO: use ip
1103- default_mac=$(ifconfig "$internal_interface" | grep "^$internal_interface" | sed -e "s/.*HWaddr //")
1104- # Tell NetworkManager to piss off
1105- sed -i -e "/^unmanaged-devices=mac:$default_mac$/d" /etc/NetworkManager/NetworkManager.conf
1106- cat >>/etc/NetworkManager/NetworkManager.conf <<EOF
1107-[keyfile]
1108-unmanaged-devices=mac:$default_mac
1109-EOF
1110- invoke-rc.d network-manager stop || true
1111- invoke-rc.d network-manager start
1112- cat >/etc/network/interfaces <<EOF
1113-auto lo
1114-iface lo inet loopback
1115-
1116-auto $internal_interface
1117-iface $internal_interface inet manual
1118-
1119-auto br0
1120-iface br0 inet static
1121- address 10.14.4.1
1122- netmask 255.255.0.0
1123- broadcast 10.14.255.255
1124- bridge_ports $internal_interface
1125- bridge_stp off
1126- bridge_fd 0
1127- bridge_maxwait 0
1128-
1129-# VLAN 2, Uplink network
1130-iface eth0.2 inet dhcp
1131-vlan-raw-device eth0
1132-
1133-# Network management alias
1134-iface br0:1 inet static
1135-address 10.90.90.91
1136-netmask 255.255.255.0
1137-broadcast 10.90.90.255
1138-
1139-EOF
1140- ifdown --force $internal_interface || true
1141- ifdown --force br0 || true
1142- ifup $internal_interface
1143- ifup br0
1144- # Wait a moment for the network to normalize
1145- echo "INFO: Ensure networking has settled"
1146- run-one-until-success ping -c 10 maas.ubuntu.com
1147-}
1148-
1149-setup_external_drive() {
1150- # External drive must be:
1151- # a) partitioned into 1 big partition
1152- # b) ext4 formatted
1153- # Find root disk
1154- root_disk=$(mount | grep " on / " | awk '{print $1}' | sed -e "s/[0-9]\+$//")
1155- # Find biggest non-root disk
1156- ext_disk=$(fdisk -l | grep "^Disk /" | grep -v $root_disk | sort -k4 -n -r | awk '{print $2}' | awk -F: '{print $1}')
1157- partition="${ext_disk}1"
1158- if [ -b "$ext_disk" ]; then
1159- if [ ! -b "$partition" ]; then
1160- # Create the partition, if it doesn't exist already
1161- echo "n
1162-p
1163-1
1164-
1165-
1166-w
1167-"|fdisk "$ext_disk"
1168- mkfs.ext4 "$partition"
1169- fi
1170- sed -i -e "/ \/srv/d" /etc/fstab
1171- # Add the fstab entry
1172- uuid=$(blkid -s UUID -o value "$partition")
1173- echo "UUID=$uuid /srv ext4 defaults 1 1" >> /etc/fstab
1174- fi
1175- umount $partition || true
1176- mount -a
1177- chown root:root /srv
1178- chmod 755 /srv
1179-}
1180-
1181-
1182-preflight_checks
1183-setup_external_drive
1184-setup_debconf
1185-setup_networking
1186-
1187-#DEBHELPER#
1188-
1189-exit 0
1190
1191=== modified file 'debian/source/format'
1192--- debian/source/format 2014-04-04 19:40:10 +0000
1193+++ debian/source/format 2015-07-17 17:14:52 +0000
1194@@ -1,1 +1,1 @@
1195-3.0 (quilt)
1196+3.0 (native)
1197
1198=== removed file 'etc/apache2/sites-available/archive.conf'
1199--- etc/apache2/sites-available/archive.conf 2014-04-11 05:16:52 +0000
1200+++ etc/apache2/sites-available/archive.conf 1970-01-01 00:00:00 +0000
1201@@ -1,13 +0,0 @@
1202-<VirtualHost *:80>
1203- ServerName archive.ubuntu.com
1204- ServerAdmin webmaster@localhost
1205- DocumentRoot /srv/mirrors/archive.ubuntu.com/
1206- ErrorLog ${APACHE_LOG_DIR}/error.log
1207- CustomLog ${APACHE_LOG_DIR}/access.log combined
1208- <Directory /srv/mirrors/archive.ubuntu.com/>
1209- Options Indexes FollowSymLinks Multiviews
1210- Require all granted
1211- </Directory>
1212-</VirtualHost>
1213-
1214-# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1215
1216=== added file 'etc/apache2/sites-available/archive.ubuntu.com.conf'
1217--- etc/apache2/sites-available/archive.ubuntu.com.conf 1970-01-01 00:00:00 +0000
1218+++ etc/apache2/sites-available/archive.ubuntu.com.conf 2015-07-17 17:14:52 +0000
1219@@ -0,0 +1,14 @@
1220+<VirtualHost *:80>
1221+ ServerName archive.ubuntu.com
1222+ ServerAlias *.archive.ubuntu.com
1223+ ServerAdmin webmaster@localhost
1224+ DocumentRoot /srv/mirrors/archive.ubuntu.com/
1225+ ErrorLog ${APACHE_LOG_DIR}/error.log
1226+ CustomLog ${APACHE_LOG_DIR}/access.log combined
1227+ <Directory /srv/mirrors/archive.ubuntu.com/>
1228+ Options Indexes FollowSymLinks Multiviews
1229+ Require all granted
1230+ </Directory>
1231+</VirtualHost>
1232+
1233+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1234
1235=== added file 'etc/apache2/sites-available/cdimage.ubuntu.com.conf'
1236--- etc/apache2/sites-available/cdimage.ubuntu.com.conf 1970-01-01 00:00:00 +0000
1237+++ etc/apache2/sites-available/cdimage.ubuntu.com.conf 2015-07-17 17:14:52 +0000
1238@@ -0,0 +1,14 @@
1239+<VirtualHost *:80>
1240+ ServerName cdimage.ubuntu.com
1241+ ServerAlias *.cdimage.ubuntu.com
1242+ ServerAdmin root@localhost
1243+ DocumentRoot /srv/mirrors/cdimage.ubuntu.com/
1244+ ErrorLog ${APACHE_LOG_DIR}/cdimage.ubuntu.com-error.log
1245+ CustomLog ${APACHE_LOG_DIR}/cdimage.ubuntu.com-access.log combined
1246+ <Directory /srv/mirrors/cdimage.ubuntu.com/>
1247+ Options Indexes FollowSymLinks Multiviews
1248+ Require all granted
1249+ </Directory>
1250+</VirtualHost>
1251+
1252+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1253
1254=== added file 'etc/apache2/sites-available/cloud-images.ubuntu.com.conf'
1255--- etc/apache2/sites-available/cloud-images.ubuntu.com.conf 1970-01-01 00:00:00 +0000
1256+++ etc/apache2/sites-available/cloud-images.ubuntu.com.conf 2015-07-17 17:14:52 +0000
1257@@ -0,0 +1,14 @@
1258+<VirtualHost *:80>
1259+ ServerName cloud-images.ubuntu.com
1260+ ServerAlias *.cloud-images.ubuntu.com
1261+ ServerAdmin root@localhost
1262+ DocumentRoot /srv/mirrors/cloud-images.ubuntu.com/
1263+ ErrorLog ${APACHE_LOG_DIR}/cloud-images.ubuntu.com-error.log
1264+ CustomLog ${APACHE_LOG_DIR}/cloud-images.ubuntu.com-access.log combined
1265+ <Directory /srv/mirrors/cloud-images.ubuntu.com/>
1266+ Options Indexes FollowSymLinks Multiviews
1267+ Require all granted
1268+ </Directory>
1269+</VirtualHost>
1270+
1271+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1272
1273=== added file 'etc/apache2/sites-available/ports.ubuntu.com.conf'
1274--- etc/apache2/sites-available/ports.ubuntu.com.conf 1970-01-01 00:00:00 +0000
1275+++ etc/apache2/sites-available/ports.ubuntu.com.conf 2015-07-17 17:14:52 +0000
1276@@ -0,0 +1,14 @@
1277+<VirtualHost *:80>
1278+ ServerName ports.ubuntu.com
1279+ ServerAlias *.ports.ubuntu.com
1280+ ServerAdmin root@localhost
1281+ DocumentRoot /srv/mirrors/ports.ubuntu.com/
1282+ ErrorLog ${APACHE_LOG_DIR}/ports.ubuntu.com-error.log
1283+ CustomLog ${APACHE_LOG_DIR}/ports.ubuntu.com-access.log combined
1284+ <Directory /srv/mirrors/ports.ubuntu.com/>
1285+ Options Indexes FollowSymLinks Multiviews
1286+ Require all granted
1287+ </Directory>
1288+</VirtualHost>
1289+
1290+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1291
1292=== added file 'etc/apache2/sites-available/releases.ubuntu.com.conf'
1293--- etc/apache2/sites-available/releases.ubuntu.com.conf 1970-01-01 00:00:00 +0000
1294+++ etc/apache2/sites-available/releases.ubuntu.com.conf 2015-07-17 17:14:52 +0000
1295@@ -0,0 +1,14 @@
1296+<VirtualHost *:80>
1297+ ServerName releases.ubuntu.com
1298+ ServerAlias *.releases.ubuntu.com
1299+ ServerAdmin root@localhost
1300+ DocumentRoot /srv/mirrors/releases.ubuntu.com/
1301+ ErrorLog ${APACHE_LOG_DIR}/releases.ubuntu.com-error.log
1302+ CustomLog ${APACHE_LOG_DIR}/releases.ubuntu.com-access.log combined
1303+ <Directory /srv/mirrors/releases.ubuntu.com/>
1304+ Options Indexes FollowSymLinks Multiviews
1305+ Require all granted
1306+ </Directory>
1307+</VirtualHost>
1308+
1309+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1310
1311=== added file 'etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf'
1312--- etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf 1970-01-01 00:00:00 +0000
1313+++ etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf 2015-07-17 17:14:52 +0000
1314@@ -0,0 +1,12 @@
1315+<VirtualHost *:80>
1316+ ServerName ubuntu-cloud.archive.canonical.com
1317+ ServerAdmin webmaster@localhost
1318+ DocumentRoot /srv/mirrors/ubuntu-cloud.archive.canonical.com/
1319+ ErrorLog ${APACHE_LOG_DIR}/error.log
1320+ CustomLog ${APACHE_LOG_DIR}/access.log combined
1321+ <Directory /srv/mirrors/ubuntu-cloud.archive.canonical.com/>
1322+ Options Indexes FollowSymLinks Multiviews
1323+ Require all granted
1324+ </Directory>
1325+</VirtualHost>
1326+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1327
1328=== removed file 'etc/apache2/sites-available/ubuntu-cloud.conf'
1329--- etc/apache2/sites-available/ubuntu-cloud.conf 2014-04-11 05:16:52 +0000
1330+++ etc/apache2/sites-available/ubuntu-cloud.conf 1970-01-01 00:00:00 +0000
1331@@ -1,12 +0,0 @@
1332-<VirtualHost *:80>
1333- ServerName ubuntu-cloud.archive.canonical.com
1334- ServerAdmin webmaster@localhost
1335- DocumentRoot /srv/mirrors/ubuntu-cloud.archive.canonical.com/
1336- ErrorLog ${APACHE_LOG_DIR}/error.log
1337- CustomLog ${APACHE_LOG_DIR}/access.log combined
1338- <Directory /srv/mirrors/ubuntu-cloud.archive.canonical.com/>
1339- Options Indexes FollowSymLinks Multiviews
1340- Require all granted
1341- </Directory>
1342-</VirtualHost>
1343-# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
1344
1345=== modified file 'etc/apt/orange-box-mirror.list'
1346--- etc/apt/orange-box-mirror.list 2015-01-21 22:04:42 +0000
1347+++ etc/apt/orange-box-mirror.list 2015-07-17 17:14:52 +0000
1348@@ -8,7 +8,7 @@
1349 set var_path $base_path/var
1350 set cleanscript /bin/true
1351 set defaultarch amd64
1352-set postmirror_script /bin/true
1353+set postmirror_script /srv/var/postmirror.sh
1354 # set run_postmirror 0
1355 set nthreads 20
1356 set _tilde 0
1357@@ -16,28 +16,51 @@
1358 ############# end config ##############
1359
1360 ## Trusty
1361-deb http://orange-box.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
1362-deb http://orange-box.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
1363-deb http://orange-box.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
1364-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
1365-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
1366-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
1367+deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
1368+deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
1369+deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
1370+deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
1371+deb-i386 http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
1372+deb-i386 http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
1373+deb-i386 http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
1374+deb-i386 http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
1375+
1376+
1377+deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
1378+deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
1379+deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
1380+deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
1381+
1382
1383 ## precise
1384-deb http://orange-box.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
1385-deb http://orange-box.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
1386-deb http://orange-box.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
1387-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
1388-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
1389-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
1390+deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
1391+deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
1392+deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
1393+deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
1394+
1395+deb-i386 http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
1396+deb-i386 http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
1397+deb-i386 http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
1398+deb-src http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
1399+deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
1400+deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
1401+
1402+##http://ubuntu-cloud.archive.canonical.com precise-updates/cloud-tools/main Sources
1403
1404 ## Cloud-archive
1405-deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
1406-deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
1407-deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
1408-deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
1409-deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
1410-deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
1411+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
1412+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
1413+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
1414+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
1415+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
1416+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
1417+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
1418+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
1419+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
1420+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
1421+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
1422+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
1423+
1424
1425 clean http://archive.ubuntu.com/ubuntu
1426-clean http://ubuntu-cloud.archive.canonical.com/ubuntu
1427+#clean http://ubuntu-cloud.archive.canonical.com/ubuntu
1428
1429=== added directory 'etc/bind'
1430=== added file 'etc/bind/named.conf.wildcard-archive'
1431--- etc/bind/named.conf.wildcard-archive 1970-01-01 00:00:00 +0000
1432+++ etc/bind/named.conf.wildcard-archive 2015-07-17 17:14:52 +0000
1433@@ -0,0 +1,6 @@
1434+# Zone declarations.
1435+zone "archive.ubuntu.com" {
1436+ type master;
1437+ file "/etc/bind/zones.wildcard-archive";
1438+};
1439+
1440
1441=== added file 'etc/bind/zones.wildcard-archive'
1442--- etc/bind/zones.wildcard-archive 1970-01-01 00:00:00 +0000
1443+++ etc/bind/zones.wildcard-archive 2015-07-17 17:14:52 +0000
1444@@ -0,0 +1,20 @@
1445+$TTL 300
1446+@ IN SOA archive.ubuntu.com ubuntu.com (
1447+ 999 ; serial
1448+ 600 ; Refresh
1449+ 1800 ; Retry
1450+ 604800 ; Expire
1451+ 300 ; TTL
1452+ )
1453+
1454+ IN NS archive.ubuntu.com
1455+
1456+
1457+
1458+
1459+ns IN CNAME archive.ubuntu.com
1460+archive.ubuntu.com. IN A 10.14.4.1
1461+archive.ubuntu.com IN A 10.14.4.1
1462+ubuntu-cloud.archive.canonical.com. IN A 10.14.4.1
1463+* IN A 10.14.4.1
1464+
1465
1466=== removed directory 'etc/cron.d'
1467=== removed file 'etc/cron.d/charmstore-mirror'
1468--- etc/cron.d/charmstore-mirror 2014-07-30 20:05:45 +0000
1469+++ etc/cron.d/charmstore-mirror 1970-01-01 00:00:00 +0000
1470@@ -1,4 +0,0 @@
1471-#Run every Staurday at 03:23 in the morning, if plugged in and internet is accessible the charmstore will be updated.
1472-#Remove any charmstore directories inot modified in the last 90 days to save space.
1473-23 3 * * 6 root run-one orange-box-sync-charmstore >>/var/log/orange-box-sync-charmstore.log 2>&1
1474-38 4 1 * * root run-one find /srv/charmstore/ -maxdepth 1 -mindepth 1 -type d -mtime +90 -exec rm -rf {} \;
1475
1476=== removed file 'etc/cron.d/orange-box-mirror'
1477--- etc/cron.d/orange-box-mirror 2014-06-02 15:43:19 +0000
1478+++ etc/cron.d/orange-box-mirror 1970-01-01 00:00:00 +0000
1479@@ -1,1 +0,0 @@
1480-42 * * * * root run-one apt-mirror /etc/apt/orange-box-mirror.list >>/var/log/orange-box-mirror.log 2>&1
1481
1482=== modified file 'etc/debconf-selections'
1483--- etc/debconf-selections 2014-04-04 19:42:22 +0000
1484+++ etc/debconf-selections 2015-07-17 17:14:52 +0000
1485@@ -1,5 +1,3 @@
1486-maas-cluster-controller maas-cluster-controller/maas-url string http://10.14.4.1/MAAS
1487-maas-region-controller-min maas/default-maas-url string 10.14.4.1
1488 maas-region-controller-min maas/installation-note boolean true
1489 iptables-persistent iptables-persistent/autosave_v6 boolean true
1490 iptables-persistent iptables-persistent/autosave_v4 boolean true
1491
1492=== added file 'etc/orangebox-mirror.state'
1493--- etc/orangebox-mirror.state 1970-01-01 00:00:00 +0000
1494+++ etc/orangebox-mirror.state 2015-07-17 17:14:52 +0000
1495@@ -0,0 +1,1 @@
1496+INIT
1497\ No newline at end of file
1498
1499=== added file 'etc/ucloudexclude.list'
1500--- etc/ucloudexclude.list 1970-01-01 00:00:00 +0000
1501+++ etc/ucloudexclude.list 2015-07-17 17:14:52 +0000
1502@@ -0,0 +1,26 @@
1503+lost+found/
1504+desktop/
1505+lucid/
1506+full/
1507+*jaunty*
1508+*hardy*
1509+*karmic*
1510+*lucid*
1511+*maverick*
1512+*natty*
1513+*oneiric*
1514+*quantal*
1515+*vagrant*
1516+*proposed*
1517+*raring*
1518+*saucy*
1519+*utopic*
1520+*vivid*
1521+*wily*
1522+*alpha*
1523+*snappy*
1524+*beta*
1525+*.ova
1526+*arm*
1527+*ppc*
1528+.bzr
1529
1530=== modified file 'usr/bin/orange-box-add-node'
1531--- usr/bin/orange-box-add-node 2014-10-27 20:54:45 +0000
1532+++ usr/bin/orange-box-add-node 2015-07-17 17:14:52 +0000
1533@@ -23,6 +23,9 @@
1534 set -e
1535 set -x
1536
1537+## According to OB network re-design
1538+. /etc/orange-box.conf
1539+
1540 ip_to_mac() {
1541 local ip="$1"
1542 arp -n | sort | grep -m1 "^$ip\s" | awk '{print $3}'
1543@@ -31,7 +34,7 @@
1544 node_name() {
1545 local num="${1##*.}"
1546 num=$((num-10))
1547- echo "node${num}"
1548+ echo "node${num}ob${orangebox_number}"
1549 }
1550
1551 hostname_to_system_id() {
1552@@ -60,20 +63,20 @@
1553 maas admin zone read zone2 || maas admin zones create name=zone2 description="Physical machines on right side of Orange Box"
1554
1555 #Create maas-br0 network if it does not already exist
1556-maas 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"
1557+maas 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"
1558
1559 # Loop over the list of ip addresses listening on 16992
1560 for ip in $@; do
1561 mac=$(ip_to_mac $ip)
1562 hostname=$(node_name $ip)
1563- node=${hostname#node}
1564+ node=`echo ${hostname}| sed "s/node\(.*\)ob${orangebox_number}/\1/"`
1565 if [ $node -lt 5 ]; then
1566 zone="zone1"
1567 else
1568 zone="zone2"
1569 fi
1570 info "$ip --> $hostname --> $mac"
1571- if [ -z "$ip" ] || [ "$ip" = "10.14.4.1" ]; then
1572+ if [ -z "$ip" ] || [ "$ip" = "172.27.${orangebox_number}.1" ]; then
1573 continue
1574 fi
1575 # Remove it, if it's already here
1576
1577=== modified file 'usr/bin/orange-box-add-physical-nodes'
1578--- usr/bin/orange-box-add-physical-nodes 2014-07-11 18:27:46 +0000
1579+++ usr/bin/orange-box-add-physical-nodes 2015-07-17 17:14:52 +0000
1580@@ -25,11 +25,16 @@
1581
1582 oauth_login
1583
1584+## According to OB network re-design
1585+. /etc/orange-box.conf
1586+
1587+
1588+
1589 # Search for nodes listening on AMT's 16992
1590 info "Searching for all nodes on the local network listening on 16992; this will take 60 seconds...."
1591-ips=$(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)
1592+ips=$(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)
1593 if [ -z "$ips" ]; then
1594- error "nmap did not find any nodes listening on [16992] on the [10.14.4.1/24] network"
1595+ error "nmap did not find any nodes listening on [16992] on the [172.27.${orangebox_number}.1/22] network"
1596 fi
1597 info "Found: [$ips]"
1598
1599
1600=== modified file 'usr/bin/orange-box-add-virtual-nodes'
1601--- usr/bin/orange-box-add-virtual-nodes 2015-02-07 16:07:08 +0000
1602+++ usr/bin/orange-box-add-virtual-nodes 2015-07-17 17:14:52 +0000
1603@@ -18,6 +18,13 @@
1604 # You should have received a copy of the GNU General Public License
1605 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1606
1607+##
1608+##
1609+. /etc/orange-box.conf
1610+
1611+external_ip="172.27.252.${orangebox_number}"
1612+internal_ip="172.27.${orangebox_number}.1"
1613+internal_network="172.27.${orangebox_number}.0"
1614
1615 if [ "$(id -u)" != "0" ]; then
1616 echo "Must be run with sudo or by root"
1617@@ -29,13 +36,20 @@
1618
1619 virsh net-info default && virsh net-destroy default && virsh net-undefine default
1620
1621-[ -d ~maas ] || install -d /var/lib/maas --owner maas --group maas
1622+[ -d /var/lib/maas ] || install -d /var/lib/maas --owner maas --group maas
1623 chsh maas -s /bin/bash
1624-[ -d ~maas/.ssh ] || echo -e "\n\n\n" | sudo -u maas ssh-keygen -N "" -t rsa -f ~maas/.ssh/id_rsa
1625-grep 'maas@' /home/ubuntu/.ssh/authorized_keys || cat ~maas/.ssh/id_rsa.pub | tee -a /home/ubuntu/.ssh/authorized_keys
1626-printf "%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_hosts
1627+[ -d /var/lib/maas/.ssh ] || mkdir /var/lib/maas/.ssh && chown maas:maas /var/lib/maas/.ssh
1628+[ -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
1629+[ -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
1630+#Always add host keys .. not an issue if files grows
1631+sudo -u maas ssh-keyscan 172.27.${orangebox_number}.1 |sudo -u maas tee -a /var/lib/maas/.ssh/known_hosts > /dev/null
1632+sudo -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
1633+#If there is no key /new install or just removed add it"
1634+grep 'maas@' /home/ubuntu/.ssh/authorized_keys || cat /var/lib/maas/.ssh/id_rsa.pub | tee -a /home/ubuntu/.ssh/authorized_keys
1635+printf "%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
1636 chown -R ubuntu:ubuntu /home/ubuntu
1637
1638+
1639 maas admin tags new name=virtual || true
1640 maas admin tags new name=bootstrap || true
1641 maas admin tags new name=neutron || true
1642@@ -53,25 +67,23 @@
1643 maas admin zone read zone0 || maas admin zones create name=zone0 description="Virtual machines on node0"
1644
1645 #Create maas-br0 network if it does not already exist
1646-maas 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"
1647+### For APAC Roadshow
1648+maas 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"
1649+
1650
1651 for i in $(seq 0 2 | sort -r); do
1652- hostname="node0vm${i}.maas"
1653+ hostname="node0vm${i}ob${orangebox_number}.maas"
1654 virsh destroy $hostname || true
1655 virsh undefine $hostname || true
1656 echo "INFO: Installing virtual machine"
1657- 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|| true
1658+ 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
1659 virsh console $hostname || true
1660- #Workaround for bug: https://bugs.launchpad.net/maas/+bug/1367482
1661- virsh dumpxml $hostname > /tmp/${hostname}.xml
1662- sed -i -e "s#<model type='rtl8139'/>#<model type='rtl8139'/> <rom file=''/>#" /tmp/${hostname}.xml
1663- virsh define /tmp/${hostname}.xml
1664 virsh autostart $hostname
1665 mac=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')
1666 mac2=$(virsh dumpxml $hostname | python -c 'import sys, lxml.etree; print list(lxml.etree.parse(sys.stdin).iter("mac"))[0].get("address")')
1667 system_id=$(maas admin nodes list mac_address=$mac | grep system_id | cut -d'"' -f4)
1668 if [ -n "$system_id" ]; then
1669- 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=$hostname
1670+ 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
1671 maas admin tag update-nodes "virtual" add=$system_id
1672 case $i in
1673 0)
1674
1675=== modified file 'usr/bin/orange-box-amt-monitor'
1676--- usr/bin/orange-box-amt-monitor 2014-04-16 22:26:52 +0000
1677+++ usr/bin/orange-box-amt-monitor 2015-07-17 17:14:52 +0000
1678@@ -1,3 +1,5 @@
1679 #!/bin/sh
1680
1681-watch -n 10 "sudo nmap -p 16992 -oG - 10.14.4.1/24 | grep 16992/open | sort"
1682+. /etc/orange-box.conf
1683+watch -n 10 "sudo nmap -p 16992 -oG - 172.27.${orangebox_number}.0/22 | grep 16992/open | sort"
1684+
1685
1686=== removed file 'usr/bin/orange-box-apm-power-fix'
1687--- usr/bin/orange-box-apm-power-fix 2014-10-31 09:19:40 +0000
1688+++ usr/bin/orange-box-apm-power-fix 1970-01-01 00:00:00 +0000
1689@@ -1,38 +0,0 @@
1690-#!/bin/sh
1691-#
1692-# orange-box-apm-power-fix - fix for issue with orange-box-apm-power
1693-# Copyright (C) 2014 Canonical Ltd.
1694-#
1695-# Authors: Darryl Weaver <darryl.weaver@canonical.com>
1696-#
1697-# This program is free software: you can redistribute it and/or modify
1698-# it under the terms of the GNU General Public License as published by
1699-# the Free Software Foundation, version 3 of the License.
1700-#
1701-# This program is distributed in the hope that it will be useful,
1702-# but WITHOUT ANY WARRANTY; without even the implied warranty of
1703-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1704-# GNU General Public License for more details.
1705-#
1706-# You should have received a copy of the GNU General Public License
1707-# along with this program. If not, see <http://www.gnu.org/licenses/>.
1708-
1709-set -x
1710-
1711-if [ ! -f /var/lib/maas/boot-resources/current/syslinux/poweroff-APM.com ]
1712-then
1713-cd /srv/data
1714-wget https://launchpadlibrarian.net/187530745/acpioff.c32
1715-cd /var/lib/maas/boot-resources/current/syslinux
1716-sudo mv poweroff.com poweroff-APM.com
1717-sudo mv /srv/data/acpioff.c32 poweroff.c32
1718-fi
1719-
1720-#fixing the AMT template
1721-cd /srv/data
1722-wget https://launchpadlibrarian.net/187911231/not-permitted.patch
1723-cd /etc/maas/templates/power
1724-patch < /srv/data/not-permitted.patch
1725-
1726-exit
1727-
1728
1729=== modified file 'usr/bin/orange-box-bootstrap-juju'
1730--- usr/bin/orange-box-bootstrap-juju 2015-01-07 23:15:31 +0000
1731+++ usr/bin/orange-box-bootstrap-juju 2015-07-17 17:14:52 +0000
1732@@ -24,8 +24,12 @@
1733 timeout 1m run-one-until-success nc -w 10 -zvv $@ 2>&1
1734 }
1735
1736+## According to OB network re-disign
1737+. /etc/orange-box.conf
1738+
1739 juju status && echo "Existing deployment found, exiting." && exit 0
1740-juju bootstrap --to node0vm0.maas --show-log --upload-tools
1741+###juju bootstrap --to node0ob${orangebox_number}vm0.maas --show-log --upload-tools
1742+juju bootstrap --to node0vm0ob${orangebox_number}.maas --show-log --upload-tools
1743 juju set-constraints "tags="
1744 juju deploy --to 0 --repository=/srv/charmstore/ local:trusty/juju-gui
1745 juju expose juju-gui
1746
1747=== modified file 'usr/bin/orange-box-create-package-mirror'
1748--- usr/bin/orange-box-create-package-mirror 2015-01-21 22:04:42 +0000
1749+++ usr/bin/orange-box-create-package-mirror 2015-07-17 17:14:52 +0000
1750@@ -27,7 +27,9 @@
1751 fi
1752
1753 home=$PWD
1754-IP=10.14.4.1
1755+. /etc/orange-box.conf
1756+
1757+IP=172.27.${orangebox_number}.1
1758
1759 function run_mirror {
1760 echo "apt-mirror /etc/apt/orange-box-mirror.list >>/var/log/orange-box-mirror.log 2>&1"
1761@@ -95,6 +97,17 @@
1762 echo Making mirror directories ...
1763 mkdir -p /srv/mirrors /srv/skel /srv/var
1764
1765+echo Creating postmirror.sh script ...
1766+# This created a blank file, for some reason :/
1767+echo << 'EOF' > /srv/var/postmirror.sh
1768+#!/bin/sh
1769+/srv/var/clean.sh
1770+EOF
1771+
1772+echo Making postmirror.sh executable ...
1773+chmod +x /srv/var/postmirror.sh
1774+echo Done. && echo
1775+
1776 echo Setting up the web dirs for mirroring ...
1777 ln -s /srv/mirrors/archive.ubuntu.com/ubuntu /var/www/html/archive.ubuntu.com
1778 ln -s /srv/mirrors/ubuntu-cloud.archive.canonical.com/ubuntu /var/www/html/ubuntu-cloud.archive.canonical.com
1779
1780=== modified file 'usr/bin/orange-box-demo-cleanup'
1781--- usr/bin/orange-box-demo-cleanup 2014-10-23 22:18:49 +0000
1782+++ usr/bin/orange-box-demo-cleanup 2015-07-17 17:14:52 +0000
1783@@ -20,6 +20,8 @@
1784
1785 ENVIRONMENT=`juju env`
1786
1787+. /etc/orange-box.conf
1788+
1789 #Destroy juju environment
1790 juju destroy-environment $ENVIRONMENT
1791 #make sure AMTs are all powered off
1792@@ -27,6 +29,6 @@
1793 if dpkg --compare-versions $maas_ver lt 1.6; then
1794 export AMT_PASSWORD=Password1+
1795 for i in $(seq 11 19); do
1796- yes | amttool 10.14.4.$i powerdown >/dev/null 2>&1
1797+ yes | amttool 172.27.${orangebox_number}.$i powerdown >/dev/null 2>&1
1798 done
1799 fi
1800
1801=== added file 'usr/bin/orange-box-hacks'
1802--- usr/bin/orange-box-hacks 1970-01-01 00:00:00 +0000
1803+++ usr/bin/orange-box-hacks 2015-07-17 17:14:52 +0000
1804@@ -0,0 +1,32 @@
1805+#!/bin/sh
1806+
1807+okay() {
1808+ echo "OK: $@"
1809+}
1810+
1811+error() {
1812+ echo "ERROR: $@"
1813+}
1814+
1815+# Check powerstate in AMT
1816+for i in $(seq 1 9); do
1817+ amtoutput=$(yes | amttool 10.14.4.1${i} info)
1818+ if [ "$amthostname" = "node${i}amt" ]; then
1819+ okay "[node${i}]: AMT is responsive"
1820+ else
1821+ error "[node${i}]: AMT is not responsive"
1822+ fi
1823+ amtpowerstate=$(echo "$amtoutput" | grep "^Powerstate:" | awk '{print $2}')
1824+ if [ -n "$amtpowerstate" ]; then
1825+ okay "[node${i}]: AMT powerstate [$amtpowerstate]"
1826+ else
1827+ error "[node${i}]: AMT powerstate unknown [$amtpowerstate]"
1828+ fi
1829+ uptime=$(ssh node$i.maas "uptime" 2>/dev/null)
1830+ if [ -n "$uptime" ]; then
1831+ okay "[node${i}]: SSH to node successful; uptime=[$uptime]"
1832+ else
1833+ error "[node${i}]: SSH to node unsuccessful; uptime=[$uptime]"
1834+ fi
1835+ echo
1836+done
1837
1838=== added file 'usr/bin/orange-box-mirror'
1839--- usr/bin/orange-box-mirror 1970-01-01 00:00:00 +0000
1840+++ usr/bin/orange-box-mirror 2015-07-17 17:14:52 +0000
1841@@ -0,0 +1,235 @@
1842+#!/bin/bash
1843+#
1844+# orange-box-mirror
1845+# Copyright (C) 2014 Canonical Ltd.
1846+#
1847+# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
1848+#
1849+# This program is free software: you can redistribute it and/or modify
1850+# it under the terms of the GNU General Public License as published by
1851+# the Free Software Foundation, version 3 of the License.
1852+#
1853+# This program is distributed in the hope that it will be useful,
1854+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1855+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1856+# GNU General Public License for more details.
1857+#
1858+# You should have received a copy of the GNU General Public License
1859+# along with this program. If not, see <http://www.gnu.org/licenses/>.
1860+
1861+set -ex
1862+. /etc/orange-box.conf
1863+#TODO# merge State in orange-box.conf
1864+STATE=`cat /etc/orangebox-mirror.state`
1865+
1866+# looking for inconsistency / self healing
1867+dig +short xyz.archive.ubuntu.com | grep 172.27.${orangebox_number}.1 > /dev/null && CHECKEDSTATE=ENABLED || CHECKEDSTATE=DISABLED
1868+if [[ $STATE != $CHECKEDSTATE ]]
1869+then
1870+ if [[ $STATE == MIRRORING ]]
1871+ then
1872+ echo "WAS MIRRORING"
1873+ # IF nobody use the log then it is not mirroring
1874+ if ( sudo fuser /var/log/orange-box-mirror.log )
1875+ then
1876+ CHECKEDSTATE=MIRRORING
1877+ else
1878+ dig +short xyz.archive.ubuntu.com | grep 172.27.${orangebox_number}.1 && CHECKEDSTATE=ENABLED || CHECKEDSTATE=DISABLED
1879+ fi
1880+ fi
1881+ STATE=$CHECKEDSTATE
1882+ echo $CHECKEDSTATE > /etc/orangebox-mirror.state
1883+ echo "Some script end up in error or been screwed healing"
1884+fi
1885+
1886+is-root()
1887+{
1888+ if [ "$(id -u)" != "0" ]; then
1889+ echo "Must be run with sudo or by root"
1890+ exit 77
1891+ fi
1892+}
1893+
1894+control_c()
1895+# run if user hits control-c
1896+{
1897+ echo -en "\n*** Ouch! Exiting ***\n"
1898+ [[ $STATE = MIRRORING ]] && echo "DISABLED" > /etc/orangebox-mirror.state
1899+ exit $?
1900+}
1901+
1902+# trap keyboard interrupt (control-c)
1903+trap control_c SIGINT
1904+
1905+
1906+usage()
1907+{
1908+cat << EOF
1909+
1910+orange-box-mirror - control usage and sync of local to OrangeBox mirrors
1911+
1912+USAGE: <action>
1913+
1914+ The options must be passed as follows:
1915+ <action>
1916+ enable - enable dns modification to point to local
1917+ disable - disable usage of the local mirror
1918+ sync - synchronize the mirror with archive disabling it during sync
1919+ status - describe current state
1920+
1921+ Note: actions requires root privileges use sudo
1922+
1923+EOF
1924+exit 0
1925+}
1926+
1927+enable-dns-usage()
1928+{
1929+[[ $STATE = MIRRORING ]] && { echo "wait for mirroring to end"; exit 2; }
1930+[[ $STATE = ENABLED ]] && { echo "Already enabled"; exit 0; }
1931+is-root
1932+
1933+#important for templating
1934+export TTL='$TTL'
1935+PWDBACK=$PWD
1936+rm -f /etc/bind/named.conf.orange-box-mirror
1937+touch /etc/bind/named.conf.orange-box-mirror
1938+for web_site in archive.ubuntu.com cdimage.ubuntu.com cloud-images.ubuntu.com releases.ubuntu.com ubuntu-cloud.archive.canonical.com
1939+do
1940+
1941+a2ensite ${web_site}
1942+## TODO check sed regex if name are other then a-z and "-"
1943+
1944+## MUST export for envsubst to work
1945+export web_site
1946+export web_site_root=`echo ${web_site} |sed 's/^[a-z,-]*.//'`
1947+export orangebox_number
1948+
1949+envsubst < /usr/lib/orange-box/templates/mirror-bind/zones.template > /etc/bind/zones.${web_site}
1950+
1951+envsubst < /usr/lib/orange-box/templates/mirror-bind/named.conf.template >> /etc/bind/named.conf.orange-box-mirror
1952+done
1953+# avoid conflict in etc/ files with ubumirror
1954+envsubst < /usr/lib/orange-box/templates/ubumirror.conf > /etc/ubumirror.conf
1955+
1956+# make sure no duplicates and enable only if reach that point
1957+TMPFILE=`mktemp`
1958+grep -v "named.conf.orange-box-mirror" /etc/bind/named.conf > $TMPFILE || echo "was already off continue"
1959+mv $TMPFILE /etc/bind/named.conf
1960+chown bind:bind /etc/bind/named.conf
1961+echo 'include "/etc/bind/named.conf.orange-box-mirror";' >> /etc/bind/named.conf
1962+service bind9 restart
1963+service apache2 restart
1964+echo "ENABLED" > /etc/orangebox-mirror.state
1965+}
1966+
1967+disable-dns-usage()
1968+{
1969+[[ $STATE = MIRRORING ]] && { echo "Mirroring in progress usage disabled"; exit 0; }
1970+[[ $STATE = DISABLED ]] && { echo "Already disabled"; exit 0; }
1971+is-root
1972+TMPFILE=`mktemp`
1973+grep -v "named.conf.orange-box-mirror" /etc/bind/named.conf > $TMPFILE || echo "was already off continue"
1974+mv $TMPFILE /etc/bind/named.conf
1975+chown bind:bind /etc/bind/named.conf
1976+service bind9 restart
1977+echo "DISABLED" > /etc/orangebox-mirror.state
1978+}
1979+
1980+sync-mirror()
1981+{
1982+[[ $STATE = MIRRORING ]] && { echo "already mirroring" ;exit 2; }
1983+PREVIOUSSTATE=$STATE
1984+#trick to not rewrite disabling
1985+STATE="ENABLED"
1986+disable-dns-usage
1987+echo "MIRRORING" > /etc/orangebox-mirror.state
1988+
1989+echo "Updating cloud-archive mirror"
1990+/usr/bin/lftp -c mirror -eP=8 -x icons http://ubuntu-cloud.archive.canonical.com /srv/mirrors/ubuntu-cloud.archive.canonical.com
1991+
1992+echo "Updating cloud-images mirror"
1993+
1994+ROOTDIR="/srv/mirrors/"
1995+RELEASES="precise trusty"
1996+
1997+cd $ROOTDIR
1998+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/query
1999+for r in $RELEASES
2000+do
2001+cd $ROOTDIR/
2002+IDREL=`grep $r cloud-images.ubuntu.com/query/released.latest.txt |awk '{print $4}' `
2003+IDDAY=`grep -e "server" cloud-images.ubuntu.com/query/daily.latest.txt| grep -v "server-"|grep $r |awk '{print $4}' `
2004+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/server/releases/$r/
2005+cd $ROOTDIR/cloud-images.ubuntu.com/server/releases/$r/
2006+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/server/releases/$r/release-$IDREL/
2007+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/releases/$r/
2008+cd $ROOTDIR/cloud-images.ubuntu.com/releases/$r/
2009+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/releases/$r/release-$IDREL/
2010+
2011+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/server/daily/$r/
2012+cd $ROOTDIR/cloud-images.ubuntu.com/server/daily/$r/
2013+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/server/daily/$r/$IDDAY/ || true
2014+
2015+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/daily/server/$r/
2016+cd $ROOTDIR/cloud-images.ubuntu.com/daily/server/$r/
2017+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/daily/server/$r/$IDDAY/
2018+
2019+done
2020+
2021+
2022+echo " apt mirror sync .... "
2023+cat > /srv/var/postmirror.sh<<EOF
2024+wget -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/
2025+
2026+EOF
2027+chmod 755 /srv/var/postmirror.sh
2028+run-one apt-mirror /etc/apt/orange-box-mirror.list |tee -a /var/log/orange-box-mirror.log
2029+
2030+
2031+run-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
2032+run-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
2033+
2034+maas admin boot-source update 1 url="http://172.27.${orangebox_number}.1/maas/images/ephemeral-v2/daily/streams/v1/index.sjson"
2035+
2036+
2037+
2038+chmod -R g+rx,o+rx /srv/mirrors/*.com
2039+echo "SYNCED" > /etc/orangebox-mirror.state
2040+STATE=SYNCED
2041+case $PREVIOUSSTATE in
2042+ ENABLED)
2043+ enable-dns-usage
2044+ ;;
2045+ DISABLED)
2046+ disable-dns-usage
2047+ ;;
2048+esac
2049+}
2050+
2051+status()
2052+{
2053+echo "This OrangeBox state is "$STATE
2054+}
2055+
2056+[ $# -lt 1 ] && usage
2057+
2058+ACTION=$1
2059+
2060+case $ACTION in
2061+ enable)
2062+ enable-dns-usage
2063+ ;;
2064+ disable)
2065+ disable-dns-usage
2066+ ;;
2067+ sync)
2068+ sync-mirror
2069+ ;;
2070+ status)
2071+ status
2072+ ;;
2073+ *)
2074+ usage
2075+ ;;
2076+esac
2077
2078=== modified file 'usr/bin/orange-box-purge-everything'
2079--- usr/bin/orange-box-purge-everything 2014-10-08 11:51:07 +0000
2080+++ usr/bin/orange-box-purge-everything 2015-07-17 17:14:52 +0000
2081@@ -21,6 +21,7 @@
2082
2083 sudo apt-get purge $(dpkg -l | egrep "orange-box|maas|squid" | awk '{print $2}') bind9
2084 rm -rf /srv/boot-resources/* /etc/bind /root/.maascli.db
2085+rm -rf /home/ubuntu/.juju/environments/
2086 echo
2087 echo "=== IT IS HIGHLY RECOMMENDED THAT YOU REBOOT NOW! ==="
2088 echo
2089
2090=== added file 'usr/bin/orange-box-resetproxy'
2091--- usr/bin/orange-box-resetproxy 1970-01-01 00:00:00 +0000
2092+++ usr/bin/orange-box-resetproxy 2015-07-17 17:14:52 +0000
2093@@ -0,0 +1,34 @@
2094+#!/bin/bash
2095+#
2096+# orange-box-resetproxy
2097+# Copyright (C) 2014 Canonical Ltd.
2098+#
2099+# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
2100+#
2101+# This program is free software: you can redistribute it and/or modify
2102+# it under the terms of the GNU General Public License as published by
2103+# the Free Software Foundation, version 3 of the License.
2104+#
2105+# This program is distributed in the hope that it will be useful,
2106+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2107+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2108+# GNU General Public License for more details.
2109+#
2110+# You should have received a copy of the GNU General Public License
2111+# along with this program. If not, see <http://www.gnu.org/licenses/>.
2112+
2113+set -ex
2114+# Only run this as root
2115+if [ $EUID -ne 0 ]
2116+then
2117+ echo Execute as root or with \"sudo $0\"
2118+ exit 1
2119+fi
2120+
2121+
2122+
2123+service maas-proxy stop
2124+rm -rf /var/spool/maas-proxy/*
2125+squid3 -z -f /etc/maas/maas-proxy.conf
2126+sleep 20
2127+service maas-proxy start
2128
2129=== modified file 'usr/bin/orange-box-run'
2130--- usr/bin/orange-box-run 2014-06-11 01:00:16 +0000
2131+++ usr/bin/orange-box-run 2015-07-17 17:14:52 +0000
2132@@ -24,22 +24,25 @@
2133 cmd="tail -f /var/log/cloud-init-output.log | ccze -A"
2134 fi
2135
2136-tmux new-window -n all-nodes "ssh node1.maas $cmd" \; \
2137- split-window -v "ssh node2.maas $cmd" \; \
2138- select-layout tiled \; \
2139- split-window -h "ssh node2.maas $cmd" \; \
2140- select-layout tiled \; \
2141- split-window -v "ssh node3.maas $cmd" \; \
2142- select-layout tiled \; \
2143- split-window -h "ssh node4.maas $cmd" \; \
2144- select-layout tiled \; \
2145- split-window -v "ssh node5.maas $cmd" \; \
2146- select-layout tiled \; \
2147- split-window -h "ssh node6.maas $cmd" \; \
2148- select-layout tiled \; \
2149- split-window -v "ssh node7.maas $cmd" \; \
2150- select-layout tiled \; \
2151- split-window -h "ssh node8.maas $cmd" \; \
2152- select-layout tiled \; \
2153- split-window -v "ssh node9.maas $cmd" \; \
2154+## According to OB network re-design
2155+. /etc/orange-box.conf
2156+
2157+tmux new-window -n all-nodes "ssh node1ob${orangebox_number}.maas $cmd" \; \
2158+ split-window -v "ssh node2ob${orangebox_number}.maas $cmd" \; \
2159+ select-layout tiled \; \
2160+ split-window -h "ssh node2ob${orangebox_number}.maas $cmd" \; \
2161+ select-layout tiled \; \
2162+ split-window -v "ssh node3ob${orangebox_number}.maas $cmd" \; \
2163+ select-layout tiled \; \
2164+ split-window -h "ssh node4ob${orangebox_number}.maas $cmd" \; \
2165+ select-layout tiled \; \
2166+ split-window -v "ssh node5ob${orangebox_number}.maas $cmd" \; \
2167+ select-layout tiled \; \
2168+ split-window -h "ssh node6ob${orangebox_number}.maas $cmd" \; \
2169+ select-layout tiled \; \
2170+ split-window -v "ssh node7ob${orangebox_number}.maas $cmd" \; \
2171+ select-layout tiled \; \
2172+ split-window -h "ssh node8ob${orangebox_number}.maas $cmd" \; \
2173+ select-layout tiled \; \
2174+ split-window -v "ssh node9ob${orangebox_number}.maas $cmd" \; \
2175 select-layout tiled
2176
2177=== added file 'usr/bin/orange-box-setup-nat'
2178--- usr/bin/orange-box-setup-nat 1970-01-01 00:00:00 +0000
2179+++ usr/bin/orange-box-setup-nat 2015-07-17 17:14:52 +0000
2180@@ -0,0 +1,127 @@
2181+#!/bin/bash
2182+#
2183+# orange-box-setup-nat - Setup NAT for external network access by nodes
2184+# Copyright (C) 2014 Canonical Ltd.
2185+#
2186+# Authors: Ronald McCollam <ronald.mccollam@canonical.com>
2187+# Dustin Kirkland <kirkland@canonical.com>
2188+#
2189+# This program is free software: you can redistribute it and/or modify
2190+# it under the terms of the GNU General Public License as published by
2191+# the Free Software Foundation, version 3 of the License.
2192+#
2193+# This program is distributed in the hope that it will be useful,
2194+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2195+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2196+# GNU General Public License for more details.
2197+#
2198+# You should have received a copy of the GNU General Public License
2199+# along with this program. If not, see <http://www.gnu.org/licenses/>.
2200+
2201+set -x
2202+
2203+if [ "$(id -u)" != "0" ]; then
2204+ echo "Must be run with sudo or by root"
2205+ exit 77
2206+fi
2207+
2208+# Don't bother to restart sshd when lo is configured.
2209+if [ "$IFACE" = lo ]; then
2210+ exit 0
2211+fi
2212+
2213+# According to OB network re-design
2214+. /etc/orange-box.conf
2215+
2216+
2217+##internal=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
2218+internal=$(route -n | grep "^172\.27\.${orangebox_number}\." | sed -e "s/.* //")
2219+external=$(ip route ls | grep ^default | awk '{print $5}')
2220+
2221+if [ -z "$internal" ] || [ -z "$external" ]; then
2222+ echo "usage: $0 [INTERNAL_INTERFACE] [EXTERNAL_INTERFACE]" 1>&2
2223+ exit 1
2224+fi
2225+
2226+set -e
2227+
2228+# Update MAAS upstream DNS
2229+maas admin maas set-config name=upstream_dns value=172.27.252.1 || true
2230+
2231+# Intel Centrino Advanced-N 6235 and Ubuntu don't work well with Wireless-N
2232+if lspci -v 2>/dev/null | grep -qs "Centrino Advanced-N 6235" 2>/dev/null; then
2233+ sed -i -e "/options iwlwifi 11n_disable=1/d" /etc/modprobe.d/iwlwifi.conf
2234+ echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf
2235+fi
2236+
2237+# Configure NAT and IP forwarding, giving slave NUCs external network access
2238+# through the master.
2239+
2240+# Enable IP forwarding and save for next boot
2241+echo 1 > /proc/sys/net/ipv4/ip_forward
2242+echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/10-maas-ip-forward.conf
2243+echo "net.ipv4.conf.all.accept_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
2244+echo "net.ipv6.conf.all.accept_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
2245+echo "net.ipv4.conf.all.send_redirects=1 >> /etc/sysctl.d/10-maas-ip-forward.conf"
2246+sysctl --system
2247+
2248+#Create the static ip tables for multi OBs.
2249+cat > /etc/rc.local <<EOF
2250+#!/bin/sh -e
2251+#
2252+# rc.local
2253+#
2254+# This script is executed at the end of each multiuser runlevel.
2255+# Make sure that the script will "exit 0" on success or any other
2256+# value on error.
2257+#
2258+# In order to enable or disable this script just change the execution
2259+# bits.
2260+#
2261+# By default this script does nothing.
2262+
2263+EOF
2264+for obn in `seq 4 4 80`
2265+do
2266+ [[ $obn == ${orangebox_number} ]] ||echo " ip route add 172.27.$obn.0/22 via 172.27.252.$obn " >> /etc/rc.local
2267+done
2268+echo "exit 0" >> /etc/rc.local
2269+
2270+# Note that this script assumes no existing iptables rules. If you do have
2271+# any, they will be deleted.
2272+iptables --flush
2273+iptables --table nat --flush
2274+iptables --delete-chain
2275+iptables --table nat --delete-chain
2276+
2277+# Firewalling this machine
2278+# Allow incoming SSH
2279+iptables -A INPUT -i $external -p tcp --dport 22 -j ACCEPT
2280+iptables -A INPUT -i $external -m state --state ESTABLISHED,RELATED -j ACCEPT
2281+###iptables -A INPUT -i $external -j DROP
2282+
2283+# Some things use the MAAS proxy - some things don't. So turn on NAT.
2284+echo "Setting up ip forwarding"
2285+iptables -t nat -A POSTROUTING -o $external -j MASQUERADE
2286+iptables -A FORWARD -i $external -o $internal -m state --state RELATED,ESTABLISHED -j ACCEPT
2287+iptables -A FORWARD -i $internal -o $external -j ACCEPT
2288+# The following line sets up a transparent proxy
2289+iptables -A PREROUTING -t nat -i br0 -p tcp -m multiport --dports 80 -j REDIRECT --to-port 3128
2290+
2291+iptables-save > /etc/iptables/rules.v4
2292+
2293+# 14.10 deprecates the iptables-persistent service in favor of netfilter-persistent
2294+service iptables-persistent restart || service netfilter-persistent restart
2295+
2296+# It seems we need to restart squid3 after making these network changes
2297+maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
2298+if dpkg --compare-versions $maas_ver lt 1.6; then
2299+# We now run squid3, and NOT squid-deb-proxy
2300+ update-rc.d -f squid-deb-proxy remove || true
2301+ service squid-deb-proxy stop || true
2302+ service squid3 stop || true
2303+ service squid3 start
2304+else
2305+ service maas-proxy stop || true
2306+ service maas-proxy start || true
2307+fi
2308
2309=== removed file 'usr/bin/orange-box-setup-nat'
2310--- usr/bin/orange-box-setup-nat 2014-10-08 11:51:07 +0000
2311+++ usr/bin/orange-box-setup-nat 1970-01-01 00:00:00 +0000
2312@@ -1,99 +0,0 @@
2313-#!/bin/bash
2314-#
2315-# orange-box-setup-nat - Setup NAT for external network access by nodes
2316-# Copyright (C) 2014 Canonical Ltd.
2317-#
2318-# Authors: Ronald McCollam <ronald.mccollam@canonical.com>
2319-# Dustin Kirkland <kirkland@canonical.com>
2320-#
2321-# This program is free software: you can redistribute it and/or modify
2322-# it under the terms of the GNU General Public License as published by
2323-# the Free Software Foundation, version 3 of the License.
2324-#
2325-# This program is distributed in the hope that it will be useful,
2326-# but WITHOUT ANY WARRANTY; without even the implied warranty of
2327-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2328-# GNU General Public License for more details.
2329-#
2330-# You should have received a copy of the GNU General Public License
2331-# along with this program. If not, see <http://www.gnu.org/licenses/>.
2332-
2333-set -x
2334-
2335-if [ "$(id -u)" != "0" ]; then
2336- echo "Must be run with sudo or by root"
2337- exit 77
2338-fi
2339-
2340-# Don't bother to restart sshd when lo is configured.
2341-if [ "$IFACE" = lo ]; then
2342- exit 0
2343-fi
2344-
2345-internal=$(route -n | grep "^10\.14\." | sed -e "s/.* //")
2346-external=$(ip route ls | grep ^default | awk '{print $5}')
2347-
2348-
2349-if [ -z "$internal" ] || [ -z "$external" ]; then
2350- echo "usage: $0 [INTERNAL_INTERFACE] [EXTERNAL_INTERFACE]" 1>&2
2351- exit 1
2352-fi
2353-
2354-set -e
2355-
2356-# Update MAAS upstream DNS
2357-dns=$(nmcli d list iface $external | grep -m 1 "^IP4.DNS" | awk '{ print $2 }')
2358-maas admin maas set-config name=upstream_dns value=$dns || true
2359-
2360-# Intel Centrino Advanced-N 6235 and Ubuntu don't work well with Wireless-N
2361-if lspci -v 2>/dev/null | grep -qs "Centrino Advanced-N 6235" 2>/dev/null; then
2362- sed -i -e "/options iwlwifi 11n_disable=1/d" /etc/modprobe.d/iwlwifi.conf
2363- echo "options iwlwifi 11n_disable=1" >> /etc/modprobe.d/iwlwifi.conf
2364-fi
2365-
2366-# Configure NAT and IP forwarding, giving slave NUCs external network access
2367-# through the master.
2368-
2369-# Enable IP forwarding and save for next boot
2370-echo 1 > /proc/sys/net/ipv4/ip_forward
2371-echo "net.ipv4.ip_forward=1" > /etc/sysctl.d/10-maas-ip-forward.conf
2372-sysctl --system
2373-
2374-# Note that this script assumes no existing iptables rules. If you do have
2375-# any, they will be deleted.
2376-iptables --flush
2377-iptables --table nat --flush
2378-iptables --delete-chain
2379-iptables --table nat --delete-chain
2380-
2381-# Firewalling this machine
2382-# Allow incoming SSH
2383-iptables -A INPUT -i $external -p tcp --dport 22 -j ACCEPT
2384-iptables -A INPUT -i $external -m state --state ESTABLISHED,RELATED -j ACCEPT
2385-iptables -A INPUT -i $external -j DROP
2386-
2387-# Some things use the MAAS proxy - some things don't. So turn on NAT.
2388-echo "Setting up ip forwarding"
2389-iptables -t nat -A POSTROUTING -o $external -j MASQUERADE
2390-iptables -A FORWARD -i $external -o $internal -m state --state RELATED,ESTABLISHED -j ACCEPT
2391-iptables -A FORWARD -i $internal -o $external -j ACCEPT
2392-# The following line sets up a transparent proxy
2393-iptables -A PREROUTING -t nat -i br0 -p tcp -m multiport --dports 80 -j REDIRECT --to-port 3128
2394-
2395-iptables-save > /etc/iptables/rules.v4
2396-
2397-# 14.10 deprecates the iptables-persistent service in favor of netfilter-persistent
2398-service iptables-persistent restart || service netfilter-persistent restart
2399-
2400-# It seems we need to restart squid3 after making these network changes
2401-maas_ver=$(dpkg -l maas | tail -n1 | awk '{print $3}')
2402-if dpkg --compare-versions $maas_ver lt 1.6; then
2403-# We now run squid3, and NOT squid-deb-proxy
2404- update-rc.d -f squid-deb-proxy remove || true
2405- service squid-deb-proxy stop || true
2406- service squid3 stop || true
2407- service squid3 start
2408-else
2409- service maas-proxy stop || true
2410- service maas-proxy start || true
2411-fi
2412
2413=== modified file 'usr/bin/orange-box-status-all-nodes'
2414--- usr/bin/orange-box-status-all-nodes 2014-10-20 11:58:14 +0000
2415+++ usr/bin/orange-box-status-all-nodes 2015-07-17 17:14:52 +0000
2416@@ -22,6 +22,9 @@
2417 export AMT_PASSWORD=Password1+
2418 ERRORS=0
2419
2420+## According to OB network re-design
2421+. /etc/orange-box.conf
2422+
2423 okay() {
2424 echo "OK: $@"
2425 }
2426@@ -35,23 +38,23 @@
2427 status_all_nodes() {
2428 # Check all VM nodes
2429 for i in $(seq 0 2); do
2430- if virsh list --all | grep node0vm${i} | grep running >/dev/null 2>&1; then
2431- okay "[node0vm${i}]: Is running"
2432- uptime=$(ssh node0vm${i}.maas "uptime" 2>/dev/null)
2433+ if virsh list --all | grep node0ob${orangebox_number}vm${i} | grep running >/dev/null 2>&1; then
2434+ okay "[node0ob${orangebox_number}vm${i}]: Is running"
2435+ uptime=$(ssh node0ob${orangebox_number}vm${i}.maas "uptime" 2>/dev/null)
2436 if [ -n "$uptime" ]; then
2437- okay "[node0vm${i}]: SSH to node successful; uptime=[$uptime]"
2438+ okay "[node0ob${orangebox_number}vm${i}]: SSH to node successful; uptime=[$uptime]"
2439 else
2440- error "[node0vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
2441+ error "[node0ob${orangebox_number}vm${i}]: SSH to node unsuccessful; uptime=[$uptime]"
2442 fi
2443 else
2444- error "[node0vm${i}]: Is not running"
2445+ error "[node0ob${orangebox_number}vm${i}]: Is not running"
2446 fi
2447 done
2448 # Check all AMT nodes
2449 for i in $(seq 1 9); do
2450- hostname="node${i}.maas"
2451+ hostname="node${i}ob${orangebox_number}.maas"
2452 # (1) Ping AMT IP Addresses
2453- amt_ip="10.14.4.1$i"
2454+ amt_ip="172.27.${orangebox_number}.1$i"
2455 if ping -c 1 -q $amt_ip >/dev/null 2>&1; then
2456 okay "[$hostname]: AMT responding to ping [$amt_ip]"
2457 else
2458
2459=== added directory 'usr/lib/orange-box/templates'
2460=== added directory 'usr/lib/orange-box/templates/mirror-bind'
2461=== added file 'usr/lib/orange-box/templates/mirror-bind/named.conf.template'
2462--- usr/lib/orange-box/templates/mirror-bind/named.conf.template 1970-01-01 00:00:00 +0000
2463+++ usr/lib/orange-box/templates/mirror-bind/named.conf.template 2015-07-17 17:14:52 +0000
2464@@ -0,0 +1,6 @@
2465+# Zone declarations for ${web_site}
2466+zone "${web_site}" {
2467+ type master;
2468+ file "/etc/bind/zones.${web_site}";
2469+};
2470+
2471
2472=== added file 'usr/lib/orange-box/templates/mirror-bind/zones.template'
2473--- usr/lib/orange-box/templates/mirror-bind/zones.template 1970-01-01 00:00:00 +0000
2474+++ usr/lib/orange-box/templates/mirror-bind/zones.template 2015-07-17 17:14:52 +0000
2475@@ -0,0 +1,17 @@
2476+$TTL 300
2477+@ IN SOA ${web_site} ${web_site_root} (
2478+ 999 ; serial
2479+ 600 ; Refresh
2480+ 1800 ; Retry
2481+ 604800 ; Expire
2482+ 300 ; TTL
2483+ )
2484+
2485+ IN NS ${web_site}
2486+
2487+ns IN CNAME ${web_site}
2488+
2489+${web_site}. IN A 172.27.${orangebox_number}.1
2490+${web_site} IN A 172.27.${orangebox_number}.1
2491+* IN A 172.27.${orangebox_number}.1
2492+
2493
2494=== added file 'usr/lib/orange-box/templates/ubumirror.conf'
2495--- usr/lib/orange-box/templates/ubumirror.conf 1970-01-01 00:00:00 +0000
2496+++ usr/lib/orange-box/templates/ubumirror.conf 2015-07-17 17:14:52 +0000
2497@@ -0,0 +1,58 @@
2498+#
2499+# ubumirror.conf - configuration file for the ubumirror scripts.
2500+#
2501+
2502+# Please set the variables below to fit your site.
2503+# Which email address/user that will receive failure notices.
2504+EMAIL=root@orangebox${orangebox_number}
2505+
2506+# Server's FQDN.
2507+HOSTNAME=orangebox${orangebox_number}
2508+
2509+# Bandwidth limit for all mirror scripts - set to 0 for no limit.
2510+SPEED=0
2511+
2512+# I/O timeout for all mirror scripts - defaults to 600 seconds.
2513+IO_TIMEOUT=600
2514+
2515+# UBUARC_DIR is the destination for the base of the archive directory
2516+# The script won't run if this variable isn't set
2517+UBUARC_DIR="/srv/mirrors/archive.ubuntu.com/"
2518+
2519+# UBUCDI_DIR is the destination for the base of the cdimage directory
2520+# The script won't run if this variable isn't set
2521+UBUCDI_DIR="/srv/mirrors/cdimage.ubuntu.com/"
2522+
2523+# UBUREL_DIR is the destination for the base of the releases directory
2524+# The script won't run if this variable isn't set
2525+UBUREL_DIR="/srv/mirrors/releases.ubuntu.com/"
2526+
2527+# UBUPOR_DIR is the destination for the base of the ports directory
2528+# The script (ubuports) won't run if this variable isn't set
2529+UBUPOR_DIR="/srv/mirrors/ports.ubuntu.com/"
2530+#
2531+# UBUCLOUD_DIR is the destination for the base of the cloud-image directory
2532+# The script (ubucloudimage) won't run if this variable isn't set
2533+UBUCLOUD_DIR="/srv/mirrors/cloud-images.ubuntu.com/"
2534+
2535+# LOGDIR is the destination directory of all the logs
2536+LOGDIR="/var/log/ubumirrors/"
2537+
2538+# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
2539+# upstream mirrors where the ubumirror scripts will mirror from.
2540+UBUARC_MIRROR=rsync://rsync.archive.ubuntu.com/ubuntu
2541+UBUCDI_MIRROR=rsync://rsync.cdimage.ubuntu.com/cdimage
2542+UBUREL_MIRROR=rsync://rsync.releases.ubuntu.com/releases
2543+UBUPOR_MIRROR=rsync://rsync.ports.ubuntu.com/ubuntu-ports
2544+UBUCLOUD_MIRROR=rsync://cloud-images.ubuntu.com/cloud-images
2545+
2546+# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
2547+UBUARC_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 "
2548+
2549+UBUCDI_EXCLUDE="--exclude *-powerpc.* --exclude *-sparc.* --exclude source/ "
2550+
2551+UBUREL_EXCLUDE="--exclude *-powerpc.* --exclude *-sparc.* "
2552+
2553+UBUPOR_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 "
2554+
2555+UBUCLOUD_EXCLUDE=""

Subscribers

People subscribed via source and target branches