Merge lp:~andreserl/maas/package_split_for_charm into lp:~maas-maintainers/maas/packaging

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 217
Merged at revision: 215
Proposed branch: lp:~andreserl/maas/package_split_for_charm
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 351 lines (+246/-12)
7 files modified
debian/changelog (+6/-1)
debian/control (+25/-8)
debian/maas-region-controller-min.apport (+1/-1)
debian/maas-region-controller-min.postinst (+164/-0)
debian/maas-region-controller-min.postrm (+39/-0)
debian/maas-region-controller-min.prerm (+9/-0)
debian/rules (+2/-2)
To merge this branch: bzr merge lp:~andreserl/maas/package_split_for_charm
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Review via email: mp+198316@code.launchpad.net

Commit message

Split maas-region-controller into maas-region-controller-min

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

I'm generally OK with this. I'd like to have it in and start testing and working on charms, rather than worrying about other things.

So, ACK

Revision history for this message
Scott Moser (smoser) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

No commit message specified.

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 2013-12-05 19:05:14 +0000
3+++ debian/changelog 2013-12-10 17:14:35 +0000
4@@ -1,4 +1,4 @@
5-maas (1.4+bzr1761+dfsg-0ubuntu1) UNRELEASED; urgency=low
6+maas (1.4+bzr1765+dfsg-0ubuntu1) UNRELEASED; urgency=low
7
8 * UNRELEASED
9
10@@ -12,6 +12,11 @@
11 - debian/control: Depends on authbind for maas-cluster-controller.
12 - debian/maas-cluster-controller.{postinst,postrm}: Handle creation
13 and removal of required authbind file.
14+ * Split maas-region-controller into maas-region-controller-min.
15+ - debian/maas-region-controller-min.{postinst,postrm,prerm}: Handle
16+ basic configuration for rsyslogd, squid-deb-proxy, and maas-url.
17+ - debian/control: Depends on maas-region-controller-min, postgresql
18+ and rabbitmq-server for maas-region-controller.
19
20 -- Andres Rodriguez <andreserl@ubuntu.com> Thu, 10 Oct 2013 17:07:51 -0400
21
22
23=== modified file 'debian/control'
24--- debian/control 2013-12-05 17:43:07 +0000
25+++ debian/control 2013-12-10 17:14:35 +0000
26@@ -45,7 +45,7 @@
27 .
28 This package contains common files
29
30-Package: maas-region-controller
31+Package: maas-region-controller-min
32 Architecture: all
33 Depends: apache2,
34 avahi-daemon,
35@@ -57,7 +57,6 @@
36 libjs-yui3-full,
37 libjs-yui3-min,
38 maas-common (= ${binary:Version}),
39- postgresql-9.1,
40 pwgen,
41 python-django (>= 1.4),
42 python-django-maas (= ${binary:Version}),
43@@ -65,14 +64,33 @@
44 python-django-south,
45 python-maas-provisioningserver (= ${binary:Version}),
46 python-djorm-ext-pgarray,
47+ rsyslog,
48+ squid-deb-proxy,
49+ ${misc:Depends},
50+ ${python:Depends}
51+Breaks: maas-region-controller ( <= 1.4+bzr1693+dfsg-0ubuntu3 )
52+Replaces: maas-region-controller ( <= 1.4+bzr1693+dfsg-0ubuntu3 )
53+Description: Ubuntu MAAS Server
54+ Ubuntu MAAS Server is the successor to Orchestra. It offers a
55+ nice UI to provision your Ubuntu servers. Each physical server
56+ (“node”) will be commissioned automatically on first boot.
57+ During the commissioning process administrators are able to
58+ configure hardware settings manually before an automated smoke
59+ test and burn-in test are done. Once commissioned, a node can
60+ be deployed on demand by name, or allocated to a queue for
61+ dynamic allocation to services being deployed on this MAAS.
62+ .
63+ This package installs the region controller services: the web
64+ UI.
65+
66+Package: maas-region-controller
67+Architecture: all
68+Depends: maas-region-controller-min (= ${binary:Version}),
69+ postgresql (>= 9.1),
70 rabbitmq-server,
71- rsyslog,
72- squid-deb-proxy,
73 ${misc:Depends},
74 ${python:Depends}
75 Recommends: openssh-server, maas-dns (= ${binary:Version})
76-Breaks: maas ( <= 0.1+bzr1048+dfsg-0ubuntu1 )
77-Replaces: maas ( <= 0.1+bzr1048+dfsg-0ubuntu1 )
78 Description: Ubuntu MAAS Server
79 Ubuntu MAAS Server is the successor to Orchestra. It offers a
80 nice UI to provision your Ubuntu servers. Each physical server
81@@ -265,8 +283,7 @@
82 Package: maas-dns
83 Architecture: all
84 Depends: bind9,
85- maas-region-controller (= ${binary:Version}),
86- maas-dhcp (= ${binary:Version}),
87+ maas-region-controller-min (= ${binary:Version}),
88 ${misc:Depends}
89 Conflicts: dnsmasq
90 Breaks: maas-dhcp (<= 0.1+bzr777+dfsg-0ubuntu1)
91
92=== renamed file 'debian/maas-region-controller.apport' => 'debian/maas-region-controller-min.apport'
93--- debian/maas-region-controller.apport 2012-09-25 07:54:44 +0000
94+++ debian/maas-region-controller-min.apport 2013-12-10 17:14:35 +0000
95@@ -1,6 +1,6 @@
96 #!/usr/bin/python
97
98-'''apport hook for bind9
99+'''apport hook for maas-region-controller
100
101 (c) 2012 Canonical Ltd.
102 Author: Andres Rodriguez <andres.rodriguez@canonical.com>
103
104=== renamed file 'debian/maas-region-controller.dirs' => 'debian/maas-region-controller-min.dirs'
105=== renamed file 'debian/maas-region-controller.install' => 'debian/maas-region-controller-min.install'
106=== renamed file 'debian/maas-region-controller.links' => 'debian/maas-region-controller-min.links'
107=== renamed file 'debian/maas-region-controller.lintian-overrides' => 'debian/maas-region-controller-min.lintian-overrides'
108=== renamed file 'debian/maas-region-controller.logrotate' => 'debian/maas-region-controller-min.logrotate'
109=== renamed file 'debian/maas-region-controller.maas-region-celery.upstart' => 'debian/maas-region-controller-min.maas-region-celery.upstart'
110=== renamed file 'debian/maas-region-controller.maas-txlongpoll.upstart' => 'debian/maas-region-controller-min.maas-txlongpoll.upstart'
111=== added file 'debian/maas-region-controller-min.postinst'
112--- debian/maas-region-controller-min.postinst 1970-01-01 00:00:00 +0000
113+++ debian/maas-region-controller-min.postinst 2013-12-10 17:14:35 +0000
114@@ -0,0 +1,164 @@
115+#!/bin/sh
116+
117+set -e
118+
119+. /usr/share/debconf/confmodule
120+db_version 2.0
121+
122+RELEASE=`lsb_release -rs` || RELEASE=""
123+
124+restart_squid_deb_proxy() {
125+ invoke-rc.d squid-deb-proxy restart || true
126+}
127+
128+configure_region_http() {
129+ case $RELEASE in
130+ 12.04|12.10|13.04)
131+ # handle apache configs
132+ if [ -e /etc/maas/maas-http.conf -a \
133+ ! -e /etc/apache2/conf.d/maas-http.conf ]; then
134+ ln -sf /etc/maas/maas-http.conf /etc/apache2/conf.d/maas-http.conf
135+ fi
136+ ;;
137+ *)
138+ # handle apache configs
139+ if [ -e /etc/maas/maas-http.conf -a \
140+ ! -e /etc/apache2/conf-enabled/maas-http.conf ]; then
141+ ln -sf /etc/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf
142+ fi
143+ ;;
144+ esac
145+ # enable apache modules needed
146+ a2enmod proxy_http
147+ a2enmod expires
148+ a2enmod wsgi
149+}
150+
151+configure_maas_default_url() {
152+ local ipaddr="$1"
153+
154+ if grep -qs "^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$" /etc/maas/maas_local_settings.py; then
155+ sed -i "s/^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$/DEFAULT_MAAS_URL = \"http:\/\/"$ipaddr"\/MAAS\"/" \
156+ /etc/maas/maas_local_settings.py
157+ fi
158+}
159+
160+get_default_route_ip() {
161+ while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT; do
162+ [ "$Mask" = "00000000" ] && break
163+ done < /proc/net/route
164+ interface="$Iface"
165+ ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$interface" scope global)
166+ ipaddr=${ipaddr#* inet }
167+ ipaddr=${ipaddr%%/*}
168+ echo $ipaddr
169+}
170+
171+configure_maas_squid_deb_proxy() {
172+ local ipaddr="$1"
173+
174+ if [ -e /usr/share/maas/conf/99-maas -a \
175+ ! -L /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas ]; then
176+ ln -sf /usr/share/maas/conf/99-maas \
177+ /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas
178+ fi
179+
180+ sed -i "s/\(^[a-zA-Z0-9\.\-].*\) # maasurl$/$ipaddr # maasurl/" \
181+ /usr/share/maas/conf/99-maas
182+}
183+
184+if [ "$1" = "configure" ] && [ -z "$2" ]; then
185+ #########################################################
186+ ################ Folder Permissions ####################
187+ #########################################################
188+ mkdir -p /var/lib/maas/media/storage
189+ chown -R maas:maas /var/lib/maas/
190+
191+ # Config will contain credentials, so should be readable
192+ # by the application but nobody else.
193+ chown root:maas \
194+ /etc/maas/maas_local_celeryconfig.py \
195+ /etc/maas/maas_local_settings.py
196+ chmod 0640 \
197+ /etc/maas/maas_local_celeryconfig.py \
198+ /etc/maas/maas_local_settings.py
199+
200+ #########################################################
201+ ################ Configure Apache2 ####################
202+ #########################################################
203+ configure_region_http
204+
205+ #########################################################
206+ ########## Configure DEFAULT_MAAS_URL #################
207+ #########################################################
208+
209+ # Obtain IP address of default route and change DEFAULT_MAAS_URL
210+ # if default-maas-url has not been preseeded.
211+ db_get maas/default-maas-url
212+ ipaddr="$RET"
213+ if [ -z "$RET" ]; then
214+ ipaddr=$(get_default_route_ip)
215+ fi
216+ # Set the IP address of the interface with default route
217+ if [ -n "$ipaddr" ]; then
218+ configure_maas_default_url "$ipaddr"
219+ configure_maas_squid_deb_proxy "$ipaddr"
220+ db_set maas/default-maas-url "$ipaddr"
221+ fi
222+
223+ #########################################################
224+ ################ Configure Logging ####################
225+ #########################################################
226+
227+ # Give appropriate permissions
228+ if [ ! -f /var/log/maas/maas.log ]; then
229+ touch /var/log/maas/maas.log
230+ fi
231+ chown -R maas:maas /var/log/maas
232+ chmod -R 775 /var/log/maas/oops
233+
234+ # Create log directory base
235+ mkdir -p /var/log/maas/rsyslog
236+ chown -R syslog:syslog /var/log/maas/rsyslog
237+ # Make sure rsyslog reads our config
238+ invoke-rc.d rsyslog restart
239+
240+ #########################################################
241+ ################### Squid-deb-proxy ####################
242+ #########################################################
243+ # Make sure squid-deb-proxy reads our config (99-maas)
244+ restart_squid_deb_proxy
245+
246+elif [ -n "$DEBCONF_RECONFIGURE" ]; then
247+ # Set the IP address of the interface with default route
248+ db_get maas/default-maas-url
249+ ipaddr="$RET"
250+ if [ -n "$ipaddr" ]; then
251+ configure_maas_default_url "$ipaddr"
252+ configure_maas_squid_deb_proxy "$ipaddr"
253+ fi
254+
255+elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
256+ # If upgrading to any later package version, then upgrade db.
257+ invoke-rc.d apache2 stop || true
258+
259+ # make sure maas http config is symlinked
260+ configure_region_http
261+
262+ # we need to regenerate the passwords and update configs.
263+ db_get maas/default-maas-url
264+ ipaddr="$RET"
265+ configure_maas_default_url "$ipaddr"
266+ configure_maas_squid_deb_proxy "$ipaddr"
267+fi
268+
269+invoke-rc.d apache2 restart || true
270+
271+restart_squid_deb_proxy
272+
273+invoke-rc.d maas-txlongpoll restart || true
274+invoke-rc.d maas-region-celery restart || true
275+
276+db_stop
277+
278+#DEBHELPER#
279
280=== added file 'debian/maas-region-controller-min.postrm'
281--- debian/maas-region-controller-min.postrm 1970-01-01 00:00:00 +0000
282+++ debian/maas-region-controller-min.postrm 2013-12-10 17:14:35 +0000
283@@ -0,0 +1,39 @@
284+#!/bin/sh
285+
286+set -e
287+
288+. /usr/share/debconf/confmodule
289+
290+RELEASE=`lsb_release -rs` || RELEASE=""
291+
292+case "$1" in
293+ purge)
294+ rm -rf /var/log/maas
295+ rm -rf /var/lib/maas
296+ case $RELEASE in
297+ 12.04|12.10|13.04)
298+ if [ -h /etc/apache2/conf.d/maas-http.conf ]; then
299+ rm -rf /etc/apache2/conf.d/maas-http.conf
300+ fi
301+ ;;
302+ *)
303+ if [ -h /etc/apache2/conf-enabled/maas-http.conf ]; then
304+ rm -rf /etc/apache2/conf-enabled/maas-http.conf
305+ fi
306+ ;;
307+ esac
308+
309+ # Restarting apache2
310+ if [ -x /usr/sbin/invoke-rc.d ]; then
311+ invoke-rc.d apache2 restart || true
312+ fi
313+
314+ # Delete symlink
315+ if [ -L /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas ]; then
316+ rm -rf /etc/squid-deb-proxy/mirror-dstdomain.acl.d/99-maas
317+ fi
318+esac
319+
320+#DEBHELPER#
321+
322+db_stop
323
324=== added file 'debian/maas-region-controller-min.prerm'
325--- debian/maas-region-controller-min.prerm 1970-01-01 00:00:00 +0000
326+++ debian/maas-region-controller-min.prerm 2013-12-10 17:14:35 +0000
327@@ -0,0 +1,9 @@
328+#!/bin/sh
329+
330+set -e
331+
332+. /usr/share/debconf/confmodule
333+
334+#DEBHELPER#
335+
336+invoke-rc.d apache2 stop || true
337
338=== modified file 'debian/rules'
339--- debian/rules 2012-11-22 23:44:39 +0000
340+++ debian/rules 2013-12-10 17:14:35 +0000
341@@ -9,9 +9,9 @@
342 dh $@ --with python2,apport --buildsystem=python_distutils
343
344 override_dh_installinit:
345+ dh_installinit --name maas-txlongpoll --no-start
346+ dh_installinit --name maas-region-celery --no-start
347 dh_installinit --name maas-pserv
348- dh_installinit --name maas-txlongpoll
349- dh_installinit --name maas-region-celery
350 dh_installinit --name maas-cluster-celery
351 dh_installinit --name maas-dhcp-server
352

Subscribers

People subscribed via source and target branches

to all changes: