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

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 446
Merged at revision: 445
Proposed branch: lp:~andreserl/maas/packaging_rack_controller
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 299 lines (+85/-75)
10 files modified
debian/changelog (+2/-1)
debian/control (+4/-2)
debian/maas-dhcp.postinst (+2/-0)
debian/maas-proxy.install (+0/-1)
debian/maas-rack-controller.install (+0/-1)
debian/maas-rack-controller.maintscript (+1/-1)
debian/maas-rack-controller.postinst (+24/-13)
debian/maas-rack-controller.preinst (+35/-47)
debian/maas-region-controller.postinst (+2/-1)
debian/rules (+15/-8)
To merge this branch: bzr merge lp:~andreserl/maas/packaging_rack_controller
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
Review via email: mp+285623@code.launchpad.net

Commit message

Correctly install init scripts.
Introduce maas-rack-controller package.
Handle upgrades from previous releases.

To post a comment you must log in.
446. By Andres Rodriguez

Handle upgrades from earlier releases

Revision history for this message
Andres Rodriguez (andreserl) wrote :

selfie!

review: Approve

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 2016-02-04 11:31:17 +0000
3+++ debian/changelog 2016-02-16 15:44:23 +0000
4@@ -1,7 +1,8 @@
5-maas (2.0.0~alpha1+bzr4636-0ubuntu1) UNRELEASED; urgency=medium
6+maas (2.0.0~alpha1+bzr4657-0ubuntu1) UNRELEASED; urgency=medium
7
8 * New usptream release:
9 * Rename maas-cluster* to maas-rack* and handle the upgrade path.
10+ * Fix installation of init scripts and daemon systemd units.
11
12 -- Andres Rodriguez <andreserl@ubuntu.com> Mon, 01 Feb 2016 18:18:52 +0100
13
14
15=== modified file 'debian/control'
16--- debian/control 2016-02-04 11:31:17 +0000
17+++ debian/control 2016-02-16 15:44:23 +0000
18@@ -104,7 +104,9 @@
19 python3-paramiko,
20 python3-pexpect,
21 python3-pyparsing,
22+ python3-pyvmomi,
23 python3-seamicroclient,
24+ python3-simplejson,
25 python3-simplestreams,
26 python3-tempita,
27 python3-twisted,
28@@ -170,7 +172,7 @@
29 wget,
30 ${misc:Depends},
31 ${python3:Depends}
32-Suggests: amtterm, ipmitool, libvirt-bin, python3-pyvmomi
33+Suggests: amtterm, ipmitool, libvirt-bin, wsmancli
34 Conflicts: tftpd-hpa
35 Breaks: python-maas-provisioningserver,
36 maas-cluster-controller
37@@ -224,7 +226,7 @@
38
39 Package: maas-proxy
40 Architecture: all
41-Depends: squid3, ${misc:Depends}, ${python3:Depends}
42+Depends: squid3, ${misc:Depends}
43 Conflicts: squid-deb-proxy
44 Replaces: squid-deb-proxy
45 Description: MAAS Caching Proxy
46
47=== modified file 'debian/maas-dhcp.postinst'
48--- debian/maas-dhcp.postinst 2015-11-25 17:34:18 +0000
49+++ debian/maas-dhcp.postinst 2016-02-16 15:44:23 +0000
50@@ -8,6 +8,8 @@
51 # We run our own dhcpd instances.
52 systemctl stop isc-dhcp-server >/dev/null || true
53 systemctl disable isc-dhcp-server >/dev/null || true
54+ systemctl stop isc-dhcp-server6 >/dev/null || true
55+ systemctl disable isc-dhcp-server6 >/dev/null || true
56
57 dhcpd_prof="/etc/apparmor.d/usr.sbin.dhcpd"
58 if [ -f "${dhcpd_prof}" ] && command -v apparmor_parser >/dev/null 2>&1
59
60=== modified file 'debian/maas-proxy.install'
61--- debian/maas-proxy.install 2015-08-13 09:01:57 +0000
62+++ debian/maas-proxy.install 2016-02-16 15:44:23 +0000
63@@ -1,3 +1,2 @@
64 debian/extras/maas-proxy.conf usr/share/maas/
65 debian/extras/maas-proxy-common.sh usr/share/maas/
66-debian/extras/squid3.override etc/init/
67
68=== modified file 'debian/maas-rack-controller.install'
69--- debian/maas-rack-controller.install 2016-02-04 10:08:48 +0000
70+++ debian/maas-rack-controller.install 2016-02-16 15:44:23 +0000
71@@ -9,6 +9,5 @@
72
73 # Install all other stuff
74 debian/extras/99-maas-sudoers etc/sudoers.d
75-debian/extras/isc-dhcp-server.override etc/init
76 debian/extras/maas-probe-dhcp usr/sbin
77 debian/extras/maas-provision usr/sbin
78
79=== modified file 'debian/maas-rack-controller.maintscript'
80--- debian/maas-rack-controller.maintscript 2016-02-04 11:31:17 +0000
81+++ debian/maas-rack-controller.maintscript 2016-02-16 15:44:23 +0000
82@@ -14,5 +14,5 @@
83 rm_conffile /etc/maas/templates/power/vmware.template 1.9.0~alpha1+bzr4184-0ubuntu1
84 rm_conffile /etc/maas/templates/power/ipmi.conf 1.9.0~alpha1+bzr4221-0ubuntu1
85 rm_conffile /etc/maas/templates/power/ipmi.template 1.9.0~alpha1+bzr4221-0ubuntu1
86-rm_conffile /etc/init/maas-cluster.conf 2.0.0~alpha1+bzr4635-0ubuntu1
87+rm_conffile /etc/init/maas-clusterd.conf 2.0.0~alpha1+bzr4635-0ubuntu1
88 rm_conffile /lib/systemd/system/maas-clusterd.service 2.0.0~alpha1+bzr4635-0ubuntu1
89
90=== modified file 'debian/maas-rack-controller.postinst'
91--- debian/maas-rack-controller.postinst 2016-02-04 10:08:48 +0000
92+++ debian/maas-rack-controller.postinst 2016-02-16 15:44:23 +0000
93@@ -79,6 +79,29 @@
94 fi
95 }
96
97+upgrade_from_cluster_controller() {
98+ # If we are upgrading from an older (1.7, 1.8) version, then we need
99+ # to obtain the cluster UUID from the old configuration file and set
100+ # it with the new configuration tool.
101+ if [ -f /etc/maas/maas_cluster.conf ]; then
102+ uuid=$(extract_cluster_uuid /etc/maas/maas_cluster.conf)
103+ maas-provision config --uuid "$uuid"
104+ maas_url=$(extract_maas_url /etc/maas/maas_cluster.conf)
105+ maas-provision config --region-url "$maas_url"
106+ db_set maas-rack-controller/maas-url "$maas_url"
107+ mv /etc/maas/maas_cluster.conf /etc/maas/maas_cluster.conf.maas-old
108+ mv /etc/maas/pserv.yaml /etc/maas/pserv.yaml.maas-old
109+ fi
110+ # If we are upgrading from (1.9, 1.10) version, then we need to obtain
111+ # the maas_url and set it to debconf. Otherwise, the config file used
112+ # is exactly the same.
113+ if [ -f /etc/maas/clusterd.conf.1.10 ]; then
114+ mv /etc/maas/clusterd.conf.1.10 /etc/maas/rackd.conf
115+ maas_url=$(extract_maas_url /etc/maas/rackd.conf)
116+ db_set maas-rack-controller/maas-url "$maas_url"
117+ fi
118+}
119+
120 # Unconditionally ensure that there is at least an empty configuration
121 # file. This does *not* overwrite any existing configuration.
122 maas-provision config
123@@ -91,6 +114,7 @@
124 configure_cluster_uuid
125 configure_cluster_authbind
126 maas-provision upgrade-cluster
127+ upgrade_from_cluster_controller
128
129 elif [ -n "$DEBCONF_RECONFIGURE" ]; then
130 configure_maas_url
131@@ -103,19 +127,6 @@
132 configure_shared_secret
133
134 elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
135- # If we are upgrading from an older version, then we need to obtain
136- # the cluster UUID from the old configuration file and set it with
137- # the new configuration tool.
138- if [ -f /etc/maas/maas_cluster.conf ]; then
139- uuid=$(extract_cluster_uuid /etc/maas/maas_cluster.conf)
140- maas-provision config --uuid "$uuid"
141- maas_url=$(extract_maas_url /etc/maas/maas_cluster.conf)
142- maas-provision config --region-url "$maas_url"
143- db_set maas-rack-controller/maas-url "$maas_url"
144- mv /etc/maas/maas_cluster.conf /etc/maas/maas_cluster.conf.maas-old
145- mv /etc/maas/pserv.yaml /etc/maas/pserv.yaml.maas-old
146- fi
147-
148 configure_cluster_authbind
149 maas-provision upgrade-cluster
150 fi
151
152=== modified file 'debian/maas-rack-controller.preinst'
153--- debian/maas-rack-controller.preinst 2016-02-04 11:31:17 +0000
154+++ debian/maas-rack-controller.preinst 2016-02-16 15:44:23 +0000
155@@ -4,53 +4,41 @@
156
157 . /usr/share/debconf/confmodule
158
159-if [ "$1" = "upgrade" ]; then
160-
161- if dpkg --compare-versions "$2" lt 1.7.0~beta3+bzr3066-0ubuntu1; then
162- if [ -f /etc/init/maas-pserv.conf ]; then
163- invoke-rc.d maas-pserv stop
164- fi
165-
166- if [ -f /etc/init/maas-cluster-celery.conf ]; then
167- invoke-rc.d maas-cluster-celery stop
168- fi
169-
170- if [ -f /var/log/maas/celery.log ]; then
171- rm -rf /var/log/maas/celery.log
172- fi
173- fi
174-
175- if dpkg --compare-versions "$2" lt 1.7.0~beta6+bzr3232-0ubuntu1; then
176- if [ -f /etc/init/maas-cluster.conf ]; then
177- invoke-rc.d maas-cluster stop
178- fi
179- fi
180-
181- if dpkg --compare-versions "$2" lt 1.8.0~alpha1+bzr3486-0ubuntu1; then
182- if [ -f /var/log/maas/pserv.log ]; then
183- rm -rf /var/log/maas/pserv.log
184- fi
185- fi
186-
187- if dpkg --compare-versions "$2" lt 1.8.0~alpha1+bzr3523-0ubuntu1; then
188- if [ -f /etc/apache2/conf-enabled/maas-cluster-http.conf ]; then
189- rm -rf /etc/apache2/conf-enabled/maas-cluster-http.conf
190- fi
191- fi
192-
193- if dpkg --compare-versions "$2" lt 2.0.0~alpha1+bzr4636-0ubuntu1; then
194- if [ -f /etc/init/maas-clusterd.conf ] || [ -f /lib/systemd/system/maas-clusterd.service ]; then
195- invoke-rc.d maas-clusterd stop
196- fi
197- if [ -f /var/log/maas/clusterd.log ]; then
198- mv /var/log/maas/clusterd.log /var/log/maas/rackd.log
199- fi
200- if [ -f /etc/maas/clusterd.conf ]; then
201- mv /etc/maas/clusterd.conf /etc/maas/rackd.conf
202- fi
203- if [ -f /usr/lib/python3/dist-packages/twisted/plugins/maasclusterd.py ]; then
204- rm -rf /usr/lib/python3/dist-packages/twisted/plugins/maasclusterd.py
205- fi
206+if [ "$1" = "install" ]; then
207+ if [ -f /etc/init/maas-pserv.conf ]; then
208+ invoke-rc.d maas-pserv stop
209+ fi
210+
211+ if [ -f /etc/init/maas-cluster-celery.conf ]; then
212+ invoke-rc.d maas-cluster-celery stop
213+ fi
214+
215+ if [ -f /var/log/maas/celery.log ]; then
216+ rm -rf /var/log/maas/celery.log
217+ fi
218+
219+ if [ -f /etc/init/maas-cluster.conf ]; then
220+ invoke-rc.d maas-cluster stop
221+ fi
222+
223+ if [ -f /var/log/maas/pserv.log ]; then
224+ rm -rf /var/log/maas/pserv.log
225+ fi
226+
227+ if [ -f /etc/apache2/conf-enabled/maas-cluster-http.conf ]; then
228+ rm -rf /etc/apache2/conf-enabled/maas-cluster-http.conf
229+ fi
230+
231+ if [ -f /etc/init/maas-clusterd.conf ] || [ -f /lib/systemd/system/maas-clusterd.service ]; then
232+ invoke-rc.d maas-clusterd stop
233+ fi
234+
235+ if [ -f /etc/maas/clusterd.conf ]; then
236+ mv /etc/maas/clusterd.conf /etc/maas/clusterd.conf.1.10
237+ fi
238+
239+ if [ -f /var/log/maas/clusterd.log ]; then
240+ mv /var/log/maas/clusterd.log /var/log/maas/rackd.log
241 fi
242
243 fi
244
245=== modified file 'debian/maas-region-controller.postinst'
246--- debian/maas-region-controller.postinst 2016-02-04 10:08:48 +0000
247+++ debian/maas-region-controller.postinst 2016-02-16 15:44:23 +0000
248@@ -148,10 +148,11 @@
249 configure_migrate_maas_dns
250 fi
251
252+systemctl enable maas-regiond >/dev/null || true
253 invoke-rc.d maas-regiond restart || true
254 invoke-rc.d apache2 restart || true
255
256-if [ -f /etc/init/maas-rackd.conf ]; then
257+if [ -f /lib/systemd/system/maas-rackd.service ]; then
258 invoke-rc.d maas-rackd restart || true
259 fi
260
261
262=== modified file 'debian/rules'
263--- debian/rules 2016-02-04 10:08:48 +0000
264+++ debian/rules 2016-02-16 15:44:23 +0000
265@@ -13,19 +13,26 @@
266 # internet access
267
268 override_dh_installinit:
269- dh_installinit --name=maas-regiond --no-start
270- dh_installinit --name=maas-regiond-worker@ --no-start
271- dh_installinit --name=maas-rackd
272- dh_installinit --name=maas-dhcpd
273- dh_installinit --name=maas-dhcpd6
274- dh_installinit --name=maas-proxy
275+ dh_installinit -p maas-region-controller-min --name=maas-regiond --no-start
276+ dh_installinit -p maas-region-controller-min --name=maas-regiond-worker@ --no-start
277+ dh_installinit -p maas-rack-controller --name=maas-rackd
278+ dh_installinit -p maas-proxy --name=maas-proxy
279+ dh_installinit -p maas-dhcp --name=maas-dhcpd
280+ dh_installinit -p maas-dhcp --name=maas-dhcpd6
281+
282+override_dh_systemd_enable:
283+ dh_systemd_enable -p maas-region-controller-min --name=maas-regiond
284+ dh_systemd_enable -p maas-rack-controller --name=maas-rackd
285+ dh_systemd_enable -p maas-proxy --name=maas-proxy
286+ dh_systemd_enable -p maas-dhcp --name=maas-dhcpd
287+ dh_systemd_enable -p maas-dhcp --name=maas-dhcpd6
288
289 override_dh_systemd_start:
290 dh_systemd_start -p maas-region-controller-min --no-start maas-regiond.service
291 dh_systemd_start -p maas-rack-controller maas-rackd.service
292- dh_systemd_start -p maas-dhcpd maas-dhcpd.service
293- dh_systemd_start -p maas-dhcpd6 maas-dhcpd6.service
294 dh_systemd_start -p maas-proxy maas-proxy.service
295+ dh_systemd_start -p maas-dhcp maas-dhcpd.service
296+ dh_systemd_start -p maas-dhcp maas-dhcpd6.service
297
298 override_dh_auto_build:
299 dh_auto_build

Subscribers

People subscribed via source and target branches

to all changes: