Merge lp:~thomnico/orange-box/mirror into lp:~cpe-sa/orange-box/staging

Proposed by Nicolas Thomas
Status: Needs review
Proposed branch: lp:~thomnico/orange-box/mirror
Merge into: lp:~cpe-sa/orange-box/staging
Diff against target: 879 lines (+584/-57) (has conflicts)
26 files modified
debian/changelog (+22/-0)
debian/control (+10/-2)
debian/postinst (+8/-0)
debian/postrm (+2/-2)
debian/preinst (+13/-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-mirror (+236/-0)
usr/bin/orange-box-resetproxy (+34/-0)
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)
Text conflict in debian/changelog
Text conflict in debian/control
Text conflict in debian/postinst
Text conflict in debian/preinst
To merge this branch: bzr merge lp:~thomnico/orange-box/mirror
Reviewer Review Type Date Requested Status
CPE SA Pending
Review via email: mp+265155@code.launchpad.net

Description of the change

Mirror feature based on 2.9 code proposed as a merge to test the feature

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

Rebranch on staging cpe-sa

550. By Nicolas Thomas

Fix a few bugs on the destination of files

551. By Nicolas Thomas

* Fix lftp destination dir
* remove deps on biosdevname to not confuse new guys

Unmerged revisions

551. By Nicolas Thomas

* Fix lftp destination dir
* remove deps on biosdevname to not confuse new guys

550. By Nicolas Thomas

Fix a few bugs on the destination of files

549. By Nicolas Thomas

Rebranch on staging cpe-sa

548. By Nicolas Thomas

* 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

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-07-23 19:54:14 +0000
3+++ debian/changelog 2015-09-11 13:42:39 +0000
4@@ -1,3 +1,4 @@
5+<<<<<<< TREE
6 orange-box (2.91~0ubuntu2~trusty) trusty; urgency=medium
7
8 * usr/bin/orange-box-add-virtual-nodes: Removed as this is now part of orange-box-examples
9@@ -22,6 +23,20 @@
10
11 -- Brad Erhart <brad.erhart@canonical.com> Mon, 20 Jul 2015 16:17:29 -0700
12
13+=======
14+orange-box (2.10~ppa9) UNRELEASED; urgency=medium
15+
16+ * Enable local mirroring
17+ * Reduce the number of dns redirects
18+ * remove dep on ubumirror and do a faster sync to cloud-images
19+ * use lftp instead of apt-mirror for cloud-archive
20+ * Rebranch on staging cpe-sa
21+ * Fix lftp destination dir
22+ * remove deps on biosdevname to not confuse new guys
23+
24+ -- Nicolas Thomas <nicolas.thomas@canonical.com> Mon, 15 Jun 2015 23:24:05 +0200
25+
26+>>>>>>> MERGE-SOURCE
27 orange-box (2.9ubuntu1~trusty) trusty; urgency=medium
28
29 * Change source/format for bzr-buildpackage to work
30@@ -63,6 +78,13 @@
31
32 -- Takenori Matsumoto <takenori.matsumoto@canonical.com> Fri, 02 May 2015 01:13:51 -0600
33
34+orange-box (1.90-0mirror-0ubuntu1) utopic; urgency=medium
35+
36+ [ Nicolas Thomas ]
37+ * Adding support for mirror
38+
39+ -- thomas <nicolas.thomas@canonical.com> Sat, 17 Jan 2015 00:31:37 +0100
40+
41 orange-box (1.89-0ubuntu1~trusty) trusty; urgency=medium
42
43 [ Dustin Kirkland ]
44
45=== modified file 'debian/control'
46--- debian/control 2015-07-22 23:36:54 +0000
47+++ debian/control 2015-09-11 13:42:39 +0000
48@@ -3,7 +3,7 @@
49 Priority: optional
50 Maintainer: Dustin Kirkland <kirkland@ubuntu.com>
51 Build-Depends: debhelper (>= 7.0.50~),
52-Standards-Version: 3.9.4
53+Standards-Version: 3.9.5
54 Homepage: http://launchpad.net/orange-box
55
56 Package: orange-box
57@@ -45,12 +45,20 @@
58 vlan,
59 wsmancli,
60 x11vnc,
61+<<<<<<< TREE
62 Recommends:
63 landscape-client,
64+=======
65+ lftp,
66+ rsync,
67+ simplestreams,
68+>>>>>>> MERGE-SOURCE
69 python-keystone,
70 python-neutronclient,
71 python-novaclient,
72- python-glanceclient
73+ python-glanceclient,
74+Recommends:
75+ landscape-client,
76 Description: Orange Box master node easy installation
77 This package can be installed on an Ubuntu Orange Box's master node
78 to automatically configure MAAS and Juju.
79
80=== modified file 'debian/postinst'
81--- debian/postinst 2015-07-22 23:36:54 +0000
82+++ debian/postinst 2015-09-11 13:42:39 +0000
83@@ -104,9 +104,17 @@
84
85 # Set up the local mirror
86 setup_local_mirror() {
87+<<<<<<< TREE
88 a2ensite archive
89 a2ensite ubuntu-cloud
90 a2dissite 000-default
91+=======
92+ # Set up the local mirror
93+# a2ensite archive
94+# a2ensite ubuntu-cloud
95+# Must enable this to make sstream and others works
96+ a2ensite 000-default
97+>>>>>>> MERGE-SOURCE
98 mkdir -p /srv/mirrors/archive.ubuntu.com
99 echo '<meta http-equiv="refresh" content="0; url=MAAS/">' > /srv/mirrors/archive.ubuntu.com/index.html
100 invoke-rc.d apache2 stop || true
101
102=== modified file 'debian/postrm'
103--- debian/postrm 2015-06-11 11:56:36 +0000
104+++ debian/postrm 2015-09-11 13:42:39 +0000
105@@ -6,14 +6,14 @@
106
107 case "$1" in
108 remove)
109- for i in archive ubuntu-cloud; do
110+ 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
111 if [ -e "/etc/apache2/sites-enabled/${i}.conf" ]; then
112 a2dissite $i
113 fi
114 done
115 invoke-rc.d $webserver reload
116 rm -f /var/log/orange-box-mirror.log
117- rm -rf /etc/maas
118+# rm -rf /etc/maas
119 rm -rf /var/lib/orange-box
120 ;;
121 esac
122
123=== modified file 'debian/preinst'
124--- debian/preinst 2015-07-22 23:36:54 +0000
125+++ debian/preinst 2015-09-11 13:42:39 +0000
126@@ -6,7 +6,9 @@
127 ## assume hostname as been set correctly .. will be checked in postinst
128 OBNum=`hostname | cut -c 10- -`
129 echo $OBNum
130-echo "orangebox_number=$OBNum" > /etc/orange-box.conf
131+echo "## Script generated file, others rely, know what your doing if tempering" > /etc/orange-box.conf
132+echo "orangebox_number=$OBNum" >> /etc/orange-box.conf
133+echo "orangebox_mirror=INIT">> /etc/orange-box.conf
134 }
135
136 ### According to OB networking re-design
137@@ -22,10 +24,15 @@
138 echo "ERROR: Read the docs; a proper OrangeBox setup requires the default user to be [ubuntu]" 1>&2
139 exit 1
140 fi
141+<<<<<<< TREE
142
143 # Ensure em1 is the correct name (disabled due to issues)
144 # biosdevname -i eth1 || (echo "biosdevname should have been run already assume it does"; true)
145
146+=======
147+ #ensure em1 is the correct name
148+ #TODO#biosdevname -i eth1 || (echo "biosdevname should have been run already assume it does"; true)
149+>>>>>>> MERGE-SOURCE
150 # TODO: Check that the AMTs are on static IPs
151 # TODO: Check dual hard drives, which one is which
152 # TODO: Ensure we have two interfaces, one internal, one external
153@@ -62,11 +69,16 @@
154 ;;
155 esac
156 done
157+<<<<<<< TREE
158
159 # Reverted to eth0 due to issues
160 # Set a sane default as em1 because the biosdevname should have been installed and run
161 [ -z "$internal_interface" ] && internal_interface=eth0
162
163+=======
164+ # Set a sane default as eth0 because the biosdevname should have been installed and run
165+ [ -z "$internal_interface" ] && internal_interface=eth0
166+>>>>>>> MERGE-SOURCE
167 # TODO: use ip
168 default_mac=$(ifconfig "$internal_interface" | grep "^$internal_interface" | sed -e "s/.*HWaddr //")
169
170
171=== removed file 'etc/apache2/sites-available/archive.conf'
172--- etc/apache2/sites-available/archive.conf 2014-04-11 05:16:52 +0000
173+++ etc/apache2/sites-available/archive.conf 1970-01-01 00:00:00 +0000
174@@ -1,13 +0,0 @@
175-<VirtualHost *:80>
176- ServerName archive.ubuntu.com
177- ServerAdmin webmaster@localhost
178- DocumentRoot /srv/mirrors/archive.ubuntu.com/
179- ErrorLog ${APACHE_LOG_DIR}/error.log
180- CustomLog ${APACHE_LOG_DIR}/access.log combined
181- <Directory /srv/mirrors/archive.ubuntu.com/>
182- Options Indexes FollowSymLinks Multiviews
183- Require all granted
184- </Directory>
185-</VirtualHost>
186-
187-# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
188
189=== added file 'etc/apache2/sites-available/archive.ubuntu.com.conf'
190--- etc/apache2/sites-available/archive.ubuntu.com.conf 1970-01-01 00:00:00 +0000
191+++ etc/apache2/sites-available/archive.ubuntu.com.conf 2015-09-11 13:42:39 +0000
192@@ -0,0 +1,14 @@
193+<VirtualHost *:80>
194+ ServerName archive.ubuntu.com
195+ ServerAlias *.archive.ubuntu.com
196+ ServerAdmin webmaster@localhost
197+ DocumentRoot /srv/mirrors/archive.ubuntu.com/
198+ ErrorLog ${APACHE_LOG_DIR}/error.log
199+ CustomLog ${APACHE_LOG_DIR}/access.log combined
200+ <Directory /srv/mirrors/archive.ubuntu.com/>
201+ Options Indexes FollowSymLinks Multiviews
202+ Require all granted
203+ </Directory>
204+</VirtualHost>
205+
206+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
207
208=== added file 'etc/apache2/sites-available/cdimage.ubuntu.com.conf'
209--- etc/apache2/sites-available/cdimage.ubuntu.com.conf 1970-01-01 00:00:00 +0000
210+++ etc/apache2/sites-available/cdimage.ubuntu.com.conf 2015-09-11 13:42:39 +0000
211@@ -0,0 +1,14 @@
212+<VirtualHost *:80>
213+ ServerName cdimage.ubuntu.com
214+ ServerAlias *.cdimage.ubuntu.com
215+ ServerAdmin root@localhost
216+ DocumentRoot /srv/mirrors/cdimage.ubuntu.com/
217+ ErrorLog ${APACHE_LOG_DIR}/cdimage.ubuntu.com-error.log
218+ CustomLog ${APACHE_LOG_DIR}/cdimage.ubuntu.com-access.log combined
219+ <Directory /srv/mirrors/cdimage.ubuntu.com/>
220+ Options Indexes FollowSymLinks Multiviews
221+ Require all granted
222+ </Directory>
223+</VirtualHost>
224+
225+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
226
227=== added file 'etc/apache2/sites-available/cloud-images.ubuntu.com.conf'
228--- etc/apache2/sites-available/cloud-images.ubuntu.com.conf 1970-01-01 00:00:00 +0000
229+++ etc/apache2/sites-available/cloud-images.ubuntu.com.conf 2015-09-11 13:42:39 +0000
230@@ -0,0 +1,14 @@
231+<VirtualHost *:80>
232+ ServerName cloud-images.ubuntu.com
233+ ServerAlias *.cloud-images.ubuntu.com
234+ ServerAdmin root@localhost
235+ DocumentRoot /srv/mirrors/cloud-images.ubuntu.com/
236+ ErrorLog ${APACHE_LOG_DIR}/cloud-images.ubuntu.com-error.log
237+ CustomLog ${APACHE_LOG_DIR}/cloud-images.ubuntu.com-access.log combined
238+ <Directory /srv/mirrors/cloud-images.ubuntu.com/>
239+ Options Indexes FollowSymLinks Multiviews
240+ Require all granted
241+ </Directory>
242+</VirtualHost>
243+
244+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
245
246=== added file 'etc/apache2/sites-available/ports.ubuntu.com.conf'
247--- etc/apache2/sites-available/ports.ubuntu.com.conf 1970-01-01 00:00:00 +0000
248+++ etc/apache2/sites-available/ports.ubuntu.com.conf 2015-09-11 13:42:39 +0000
249@@ -0,0 +1,14 @@
250+<VirtualHost *:80>
251+ ServerName ports.ubuntu.com
252+ ServerAlias *.ports.ubuntu.com
253+ ServerAdmin root@localhost
254+ DocumentRoot /srv/mirrors/ports.ubuntu.com/
255+ ErrorLog ${APACHE_LOG_DIR}/ports.ubuntu.com-error.log
256+ CustomLog ${APACHE_LOG_DIR}/ports.ubuntu.com-access.log combined
257+ <Directory /srv/mirrors/ports.ubuntu.com/>
258+ Options Indexes FollowSymLinks Multiviews
259+ Require all granted
260+ </Directory>
261+</VirtualHost>
262+
263+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
264
265=== added file 'etc/apache2/sites-available/releases.ubuntu.com.conf'
266--- etc/apache2/sites-available/releases.ubuntu.com.conf 1970-01-01 00:00:00 +0000
267+++ etc/apache2/sites-available/releases.ubuntu.com.conf 2015-09-11 13:42:39 +0000
268@@ -0,0 +1,14 @@
269+<VirtualHost *:80>
270+ ServerName releases.ubuntu.com
271+ ServerAlias *.releases.ubuntu.com
272+ ServerAdmin root@localhost
273+ DocumentRoot /srv/mirrors/releases.ubuntu.com/
274+ ErrorLog ${APACHE_LOG_DIR}/releases.ubuntu.com-error.log
275+ CustomLog ${APACHE_LOG_DIR}/releases.ubuntu.com-access.log combined
276+ <Directory /srv/mirrors/releases.ubuntu.com/>
277+ Options Indexes FollowSymLinks Multiviews
278+ Require all granted
279+ </Directory>
280+</VirtualHost>
281+
282+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
283
284=== added file 'etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf'
285--- etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf 1970-01-01 00:00:00 +0000
286+++ etc/apache2/sites-available/ubuntu-cloud.archive.canonical.com.conf 2015-09-11 13:42:39 +0000
287@@ -0,0 +1,12 @@
288+<VirtualHost *:80>
289+ ServerName ubuntu-cloud.archive.canonical.com
290+ ServerAdmin webmaster@localhost
291+ DocumentRoot /srv/mirrors/ubuntu-cloud.archive.canonical.com/
292+ ErrorLog ${APACHE_LOG_DIR}/error.log
293+ CustomLog ${APACHE_LOG_DIR}/access.log combined
294+ <Directory /srv/mirrors/ubuntu-cloud.archive.canonical.com/>
295+ Options Indexes FollowSymLinks Multiviews
296+ Require all granted
297+ </Directory>
298+</VirtualHost>
299+# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
300
301=== removed file 'etc/apache2/sites-available/ubuntu-cloud.conf'
302--- etc/apache2/sites-available/ubuntu-cloud.conf 2014-04-11 05:16:52 +0000
303+++ etc/apache2/sites-available/ubuntu-cloud.conf 1970-01-01 00:00:00 +0000
304@@ -1,12 +0,0 @@
305-<VirtualHost *:80>
306- ServerName ubuntu-cloud.archive.canonical.com
307- ServerAdmin webmaster@localhost
308- DocumentRoot /srv/mirrors/ubuntu-cloud.archive.canonical.com/
309- ErrorLog ${APACHE_LOG_DIR}/error.log
310- CustomLog ${APACHE_LOG_DIR}/access.log combined
311- <Directory /srv/mirrors/ubuntu-cloud.archive.canonical.com/>
312- Options Indexes FollowSymLinks Multiviews
313- Require all granted
314- </Directory>
315-</VirtualHost>
316-# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
317
318=== modified file 'etc/apt/orange-box-mirror.list'
319--- etc/apt/orange-box-mirror.list 2015-06-09 14:35:14 +0000
320+++ etc/apt/orange-box-mirror.list 2015-09-11 13:42:39 +0000
321@@ -8,7 +8,7 @@
322 set var_path $base_path/var
323 set cleanscript /bin/true
324 set defaultarch amd64
325-# set postmirror_script $var_path/postmirror.sh
326+set postmirror_script /srv/var/postmirror.sh
327 # set run_postmirror 0
328 set nthreads 20
329 set _tilde 0
330@@ -16,28 +16,51 @@
331 ############# end config ##############
332
333 ## Trusty
334-deb http://orange-box.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
335-deb http://orange-box.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
336-deb http://orange-box.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
337-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
338-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
339-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
340+deb http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
341+deb http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
342+deb http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
343+deb http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
344+deb-i386 http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
345+deb-i386 http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
346+deb-i386 http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
347+deb-i386 http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
348+
349+
350+deb-src http://archive.ubuntu.com/ubuntu trusty main restricted universe multiverse
351+deb-src http://archive.ubuntu.com/ubuntu trusty-security main restricted universe multiverse
352+deb-src http://archive.ubuntu.com/ubuntu trusty-updates main restricted universe multiverse
353+deb-src http://archive.ubuntu.com/ubuntu trusty-backports main restricted universe multiverse
354+
355
356 ## precise
357-deb http://orange-box.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
358-deb http://orange-box.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
359-deb http://orange-box.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
360-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise main restricted universe multiverse
361-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
362-deb-i386 http://orange-box.archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
363+deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
364+deb http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
365+deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
366+deb http://archive.ubuntu.com/ubuntu precise-backports main restricted universe multiverse
367+
368+deb-i386 http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
369+deb-i386 http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
370+deb-i386 http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
371+deb-src http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
372+deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted universe multiverse
373+deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted universe multiverse
374+
375+##http://ubuntu-cloud.archive.canonical.com precise-updates/cloud-tools/main Sources
376
377 ## Cloud-archive
378-deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
379-deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
380-deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
381-deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
382-deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
383-deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
384+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
385+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
386+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
387+#deb http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
388+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
389+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
390+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
391+#deb-i386 http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
392+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/cloud-tools main
393+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/havana main
394+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu precise-updates/icehouse main
395+#deb-src http://ubuntu-cloud.archive.canonical.com/ubuntu trusty-updates/juno main
396+
397
398 clean http://archive.ubuntu.com/ubuntu
399-clean http://ubuntu-cloud.archive.canonical.com/ubuntu
400+#clean http://ubuntu-cloud.archive.canonical.com/ubuntu
401
402=== added directory 'etc/bind'
403=== added file 'etc/bind/named.conf.wildcard-archive'
404--- etc/bind/named.conf.wildcard-archive 1970-01-01 00:00:00 +0000
405+++ etc/bind/named.conf.wildcard-archive 2015-09-11 13:42:39 +0000
406@@ -0,0 +1,6 @@
407+# Zone declarations.
408+zone "archive.ubuntu.com" {
409+ type master;
410+ file "/etc/bind/zones.wildcard-archive";
411+};
412+
413
414=== added file 'etc/bind/zones.wildcard-archive'
415--- etc/bind/zones.wildcard-archive 1970-01-01 00:00:00 +0000
416+++ etc/bind/zones.wildcard-archive 2015-09-11 13:42:39 +0000
417@@ -0,0 +1,20 @@
418+$TTL 300
419+@ IN SOA archive.ubuntu.com ubuntu.com (
420+ 999 ; serial
421+ 600 ; Refresh
422+ 1800 ; Retry
423+ 604800 ; Expire
424+ 300 ; TTL
425+ )
426+
427+ IN NS archive.ubuntu.com
428+
429+
430+
431+
432+ns IN CNAME archive.ubuntu.com
433+archive.ubuntu.com. IN A 10.14.4.1
434+archive.ubuntu.com IN A 10.14.4.1
435+ubuntu-cloud.archive.canonical.com. IN A 10.14.4.1
436+* IN A 10.14.4.1
437+
438
439=== removed directory 'etc/cron.d'
440=== removed file 'etc/cron.d/charmstore-mirror'
441--- etc/cron.d/charmstore-mirror 2014-07-30 20:05:45 +0000
442+++ etc/cron.d/charmstore-mirror 1970-01-01 00:00:00 +0000
443@@ -1,4 +0,0 @@
444-#Run every Staurday at 03:23 in the morning, if plugged in and internet is accessible the charmstore will be updated.
445-#Remove any charmstore directories inot modified in the last 90 days to save space.
446-23 3 * * 6 root run-one orange-box-sync-charmstore >>/var/log/orange-box-sync-charmstore.log 2>&1
447-38 4 1 * * root run-one find /srv/charmstore/ -maxdepth 1 -mindepth 1 -type d -mtime +90 -exec rm -rf {} \;
448
449=== removed file 'etc/cron.d/orange-box-mirror'
450--- etc/cron.d/orange-box-mirror 2014-06-02 15:43:19 +0000
451+++ etc/cron.d/orange-box-mirror 1970-01-01 00:00:00 +0000
452@@ -1,1 +0,0 @@
453-42 * * * * root run-one apt-mirror /etc/apt/orange-box-mirror.list >>/var/log/orange-box-mirror.log 2>&1
454
455=== modified file 'etc/debconf-selections'
456--- etc/debconf-selections 2014-04-04 19:42:22 +0000
457+++ etc/debconf-selections 2015-09-11 13:42:39 +0000
458@@ -1,5 +1,3 @@
459-maas-cluster-controller maas-cluster-controller/maas-url string http://10.14.4.1/MAAS
460-maas-region-controller-min maas/default-maas-url string 10.14.4.1
461 maas-region-controller-min maas/installation-note boolean true
462 iptables-persistent iptables-persistent/autosave_v6 boolean true
463 iptables-persistent iptables-persistent/autosave_v4 boolean true
464
465=== added file 'etc/orangebox-mirror.state'
466--- etc/orangebox-mirror.state 1970-01-01 00:00:00 +0000
467+++ etc/orangebox-mirror.state 2015-09-11 13:42:39 +0000
468@@ -0,0 +1,1 @@
469+INIT
470\ No newline at end of file
471
472=== added file 'etc/ucloudexclude.list'
473--- etc/ucloudexclude.list 1970-01-01 00:00:00 +0000
474+++ etc/ucloudexclude.list 2015-09-11 13:42:39 +0000
475@@ -0,0 +1,26 @@
476+lost+found/
477+desktop/
478+lucid/
479+full/
480+*jaunty*
481+*hardy*
482+*karmic*
483+*lucid*
484+*maverick*
485+*natty*
486+*oneiric*
487+*quantal*
488+*vagrant*
489+*proposed*
490+*raring*
491+*saucy*
492+*utopic*
493+*vivid*
494+*wily*
495+*alpha*
496+*snappy*
497+*beta*
498+*.ova
499+*arm*
500+*ppc*
501+.bzr
502
503=== added file 'usr/bin/orange-box-mirror'
504--- usr/bin/orange-box-mirror 1970-01-01 00:00:00 +0000
505+++ usr/bin/orange-box-mirror 2015-09-11 13:42:39 +0000
506@@ -0,0 +1,236 @@
507+#!/bin/bash
508+#
509+# orange-box-mirror
510+# Copyright (C) 2014 Canonical Ltd.
511+#
512+# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
513+#
514+# This program is free software: you can redistribute it and/or modify
515+# it under the terms of the GNU General Public License as published by
516+# the Free Software Foundation, version 3 of the License.
517+#
518+# This program is distributed in the hope that it will be useful,
519+# but WITHOUT ANY WARRANTY; without even the implied warranty of
520+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
521+# GNU General Public License for more details.
522+#
523+# You should have received a copy of the GNU General Public License
524+# along with this program. If not, see <http://www.gnu.org/licenses/>.
525+
526+set -ex
527+. /etc/orange-box.conf
528+#TODO# merge State in orange-box.conf
529+STATE=`cat /etc/orangebox-mirror.state`
530+
531+# looking for inconsistency / self healing
532+dig +short xyz.archive.ubuntu.com | grep 172.27.${orangebox_number}.1 > /dev/null && CHECKEDSTATE=ENABLED || CHECKEDSTATE=DISABLED
533+if [[ $STATE != $CHECKEDSTATE ]]
534+then
535+ if [[ $STATE == MIRRORING ]]
536+ then
537+ echo "WAS MIRRORING"
538+ # IF nobody use the log then it is not mirroring
539+ if ( sudo fuser /var/log/orange-box-mirror.log )
540+ then
541+ CHECKEDSTATE=MIRRORING
542+ else
543+ dig +short xyz.archive.ubuntu.com | grep 172.27.${orangebox_number}.1 && CHECKEDSTATE=ENABLED || CHECKEDSTATE=DISABLED
544+ fi
545+ fi
546+ STATE=$CHECKEDSTATE
547+ echo $CHECKEDSTATE > /etc/orangebox-mirror.state
548+ echo "Some script end up in error or been screwed healing"
549+fi
550+
551+is-root()
552+{
553+ if [ "$(id -u)" != "0" ]; then
554+ echo "Must be run with sudo or by root"
555+ exit 77
556+ fi
557+}
558+
559+control_c()
560+# run if user hits control-c
561+{
562+ echo -en "\n*** Ouch! Exiting ***\n"
563+ [[ $STATE = MIRRORING ]] && echo "DISABLED" > /etc/orangebox-mirror.state
564+ exit $?
565+}
566+
567+# trap keyboard interrupt (control-c)
568+trap control_c SIGINT
569+
570+
571+usage()
572+{
573+cat << EOF
574+
575+orange-box-mirror - control usage and sync of local to OrangeBox mirrors
576+
577+USAGE: <action>
578+
579+ The options must be passed as follows:
580+ <action>
581+ enable - enable dns modification to point to local
582+ disable - disable usage of the local mirror
583+ sync - synchronize the mirror with archive disabling it during sync
584+ status - describe current state
585+
586+ Note: actions requires root privileges use sudo
587+
588+EOF
589+exit 0
590+}
591+
592+enable-dns-usage()
593+{
594+[[ $STATE = MIRRORING ]] && { echo "wait for mirroring to end"; exit 2; }
595+[[ $STATE = ENABLED ]] && { echo "Already enabled"; exit 0; }
596+is-root
597+
598+#important for templating
599+export TTL='$TTL'
600+PWDBACK=$PWD
601+rm -f /etc/bind/named.conf.orange-box-mirror
602+touch /etc/bind/named.conf.orange-box-mirror
603+for web_site in archive.ubuntu.com cdimage.ubuntu.com cloud-images.ubuntu.com releases.ubuntu.com ubuntu-cloud.archive.canonical.com
604+do
605+
606+a2ensite ${web_site}
607+## TODO check sed regex if name are other then a-z and "-"
608+
609+## MUST export for envsubst to work
610+export web_site
611+export web_site_root=`echo ${web_site} |sed 's/^[a-z,-]*.//'`
612+export orangebox_number
613+
614+envsubst < /usr/lib/orange-box/templates/mirror-bind/zones.template > /etc/bind/zones.${web_site}
615+
616+envsubst < /usr/lib/orange-box/templates/mirror-bind/named.conf.template >> /etc/bind/named.conf.orange-box-mirror
617+done
618+# avoid conflict in etc/ files with ubumirror
619+envsubst < /usr/lib/orange-box/templates/ubumirror.conf > /etc/ubumirror.conf
620+
621+# make sure no duplicates and enable only if reach that point
622+TMPFILE=`mktemp`
623+grep -v "named.conf.orange-box-mirror" /etc/bind/named.conf > $TMPFILE || echo "was already off continue"
624+mv $TMPFILE /etc/bind/named.conf
625+chown bind:bind /etc/bind/named.conf
626+echo 'include "/etc/bind/named.conf.orange-box-mirror";' >> /etc/bind/named.conf
627+service bind9 restart
628+service apache2 restart
629+echo "ENABLED" > /etc/orangebox-mirror.state
630+}
631+
632+disable-dns-usage()
633+{
634+[[ $STATE = MIRRORING ]] && { echo "Mirroring in progress usage disabled"; exit 0; }
635+[[ $STATE = DISABLED ]] && { echo "Already disabled"; exit 0; }
636+is-root
637+TMPFILE=`mktemp`
638+grep -v "named.conf.orange-box-mirror" /etc/bind/named.conf > $TMPFILE || echo "was already off continue"
639+mv $TMPFILE /etc/bind/named.conf
640+chown bind:bind /etc/bind/named.conf
641+service bind9 restart
642+echo "DISABLED" > /etc/orangebox-mirror.state
643+}
644+
645+sync-mirror()
646+{
647+[[ $STATE = MIRRORING ]] && { echo "already mirroring" ;exit 2; }
648+PREVIOUSSTATE=$STATE
649+#trick to not rewrite disabling
650+STATE="ENABLED"
651+disable-dns-usage
652+echo "MIRRORING" > /etc/orangebox-mirror.state
653+
654+echo "Updating cloud-archive mirror"
655+/usr/bin/lftp -c mirror -eP=8 -x icons http://ubuntu-cloud.archive.canonical.com /srv/mirrors/ubuntu-cloud.archive.canonical.com
656+
657+echo "Updating cloud-images mirror"
658+
659+ROOTDIR="/srv/mirrors/"
660+RELEASES="precise trusty"
661+
662+cd $ROOTDIR
663+mkdir -p cloud-images.ubuntu.com/query
664+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/query cloud-images.ubuntu.com/query
665+for r in $RELEASES
666+do
667+cd $ROOTDIR/
668+IDREL=`grep $r cloud-images.ubuntu.com/query/released.latest.txt |awk '{print $4}' `
669+IDDAY=`grep -e "server" cloud-images.ubuntu.com/query/daily.latest.txt| grep -v "server-"|grep $r |awk '{print $4}' `
670+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/server/releases/$r/
671+cd $ROOTDIR/cloud-images.ubuntu.com/server/releases/$r/
672+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/server/releases/$r/release-$IDREL/
673+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/releases/$r/
674+cd $ROOTDIR/cloud-images.ubuntu.com/releases/$r/
675+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/releases/$r/release-$IDREL/
676+
677+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/server/daily/$r/
678+cd $ROOTDIR/cloud-images.ubuntu.com/server/daily/$r/
679+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/server/daily/$r/$IDDAY/ || true
680+
681+mkdir -p $ROOTDIR/cloud-images.ubuntu.com/daily/server/$r/
682+cd $ROOTDIR/cloud-images.ubuntu.com/daily/server/$r/
683+lftp -c mirror -eP=4 http://cloud-images.ubuntu.com/daily/server/$r/$IDDAY/
684+
685+done
686+
687+
688+echo " apt mirror sync .... "
689+cat > /srv/var/postmirror.sh<<EOF
690+#!/bin/bash
691+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/
692+EOF
693+chmod 755 /srv/var/postmirror.sh
694+run-one apt-mirror /etc/apt/orange-box-mirror.list |tee -a /var/log/orange-box-mirror.log
695+
696+
697+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
698+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
699+
700+maas admin boot-source update 1 url="http://172.27.${orangebox_number}.1/maas/images/ephemeral-v2/releases/streams/v1/index.sjson"
701+
702+
703+
704+chmod -R g+rx,o+rx /srv/mirrors/*.com
705+echo "SYNCED" > /etc/orangebox-mirror.state
706+STATE=SYNCED
707+case $PREVIOUSSTATE in
708+ ENABLED)
709+ enable-dns-usage
710+ ;;
711+ DISABLED)
712+ disable-dns-usage
713+ ;;
714+esac
715+}
716+
717+status()
718+{
719+echo "This OrangeBox state is "$STATE
720+}
721+
722+[ $# -lt 1 ] && usage
723+
724+ACTION=$1
725+
726+case $ACTION in
727+ enable)
728+ enable-dns-usage
729+ ;;
730+ disable)
731+ disable-dns-usage
732+ ;;
733+ sync)
734+ sync-mirror
735+ ;;
736+ status)
737+ status
738+ ;;
739+ *)
740+ usage
741+ ;;
742+esac
743
744=== added file 'usr/bin/orange-box-resetproxy'
745--- usr/bin/orange-box-resetproxy 1970-01-01 00:00:00 +0000
746+++ usr/bin/orange-box-resetproxy 2015-09-11 13:42:39 +0000
747@@ -0,0 +1,34 @@
748+#!/bin/bash
749+#
750+# orange-box-resetproxy
751+# Copyright (C) 2014 Canonical Ltd.
752+#
753+# Authors: Nicolas Thomas <nicolas.thomas@canonical.com>
754+#
755+# This program is free software: you can redistribute it and/or modify
756+# it under the terms of the GNU General Public License as published by
757+# the Free Software Foundation, version 3 of the License.
758+#
759+# This program is distributed in the hope that it will be useful,
760+# but WITHOUT ANY WARRANTY; without even the implied warranty of
761+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
762+# GNU General Public License for more details.
763+#
764+# You should have received a copy of the GNU General Public License
765+# along with this program. If not, see <http://www.gnu.org/licenses/>.
766+
767+set -ex
768+# Only run this as root
769+if [ $EUID -ne 0 ]
770+then
771+ echo Execute as root or with \"sudo $0\"
772+ exit 1
773+fi
774+
775+
776+
777+service maas-proxy stop
778+rm -rf /var/spool/maas-proxy/*
779+squid3 -z -f /etc/maas/maas-proxy.conf
780+sleep 20
781+service maas-proxy start
782
783=== added directory 'usr/lib/orange-box/templates'
784=== added directory 'usr/lib/orange-box/templates/mirror-bind'
785=== added file 'usr/lib/orange-box/templates/mirror-bind/named.conf.template'
786--- usr/lib/orange-box/templates/mirror-bind/named.conf.template 1970-01-01 00:00:00 +0000
787+++ usr/lib/orange-box/templates/mirror-bind/named.conf.template 2015-09-11 13:42:39 +0000
788@@ -0,0 +1,6 @@
789+# Zone declarations for ${web_site}
790+zone "${web_site}" {
791+ type master;
792+ file "/etc/bind/zones.${web_site}";
793+};
794+
795
796=== added file 'usr/lib/orange-box/templates/mirror-bind/zones.template'
797--- usr/lib/orange-box/templates/mirror-bind/zones.template 1970-01-01 00:00:00 +0000
798+++ usr/lib/orange-box/templates/mirror-bind/zones.template 2015-09-11 13:42:39 +0000
799@@ -0,0 +1,17 @@
800+$TTL 300
801+@ IN SOA ${web_site} ${web_site_root} (
802+ 999 ; serial
803+ 600 ; Refresh
804+ 1800 ; Retry
805+ 604800 ; Expire
806+ 300 ; TTL
807+ )
808+
809+ IN NS ${web_site}
810+
811+ns IN CNAME ${web_site}
812+
813+${web_site}. IN A 172.27.${orangebox_number}.1
814+${web_site} IN A 172.27.${orangebox_number}.1
815+* IN A 172.27.${orangebox_number}.1
816+
817
818=== added file 'usr/lib/orange-box/templates/ubumirror.conf'
819--- usr/lib/orange-box/templates/ubumirror.conf 1970-01-01 00:00:00 +0000
820+++ usr/lib/orange-box/templates/ubumirror.conf 2015-09-11 13:42:39 +0000
821@@ -0,0 +1,58 @@
822+#
823+# ubumirror.conf - configuration file for the ubumirror scripts.
824+#
825+
826+# Please set the variables below to fit your site.
827+# Which email address/user that will receive failure notices.
828+EMAIL=root@orangebox${orangebox_number}
829+
830+# Server's FQDN.
831+HOSTNAME=orangebox${orangebox_number}
832+
833+# Bandwidth limit for all mirror scripts - set to 0 for no limit.
834+SPEED=0
835+
836+# I/O timeout for all mirror scripts - defaults to 600 seconds.
837+IO_TIMEOUT=600
838+
839+# UBUARC_DIR is the destination for the base of the archive directory
840+# The script won't run if this variable isn't set
841+UBUARC_DIR="/srv/mirrors/archive.ubuntu.com/"
842+
843+# UBUCDI_DIR is the destination for the base of the cdimage directory
844+# The script won't run if this variable isn't set
845+UBUCDI_DIR="/srv/mirrors/cdimage.ubuntu.com/"
846+
847+# UBUREL_DIR is the destination for the base of the releases directory
848+# The script won't run if this variable isn't set
849+UBUREL_DIR="/srv/mirrors/releases.ubuntu.com/"
850+
851+# UBUPOR_DIR is the destination for the base of the ports directory
852+# The script (ubuports) won't run if this variable isn't set
853+UBUPOR_DIR="/srv/mirrors/ports.ubuntu.com/"
854+#
855+# UBUCLOUD_DIR is the destination for the base of the cloud-image directory
856+# The script (ubucloudimage) won't run if this variable isn't set
857+UBUCLOUD_DIR="/srv/mirrors/cloud-images.ubuntu.com/"
858+
859+# LOGDIR is the destination directory of all the logs
860+LOGDIR="/var/log/ubumirrors/"
861+
862+# UBU{ARC,CDI,REL}_MIRROR is the rsync path in the form of host::directory/ of the
863+# upstream mirrors where the ubumirror scripts will mirror from.
864+UBUARC_MIRROR=rsync://rsync.archive.ubuntu.com/ubuntu
865+UBUCDI_MIRROR=rsync://rsync.cdimage.ubuntu.com/cdimage
866+UBUREL_MIRROR=rsync://rsync.releases.ubuntu.com/releases
867+UBUPOR_MIRROR=rsync://rsync.ports.ubuntu.com/ubuntu-ports
868+UBUCLOUD_MIRROR=rsync://cloud-images.ubuntu.com/cloud-images
869+
870+# UBU{ARC,CDI,REL}_EXCLUDE is what things you want to exclude
871+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 "
872+
873+UBUCDI_EXCLUDE="--exclude *-powerpc.* --exclude *-sparc.* --exclude source/ "
874+
875+UBUREL_EXCLUDE="--exclude *-powerpc.* --exclude *-sparc.* "
876+
877+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 "
878+
879+UBUCLOUD_EXCLUDE=""

Subscribers

People subscribed via source and target branches

to all changes: