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

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 490
Merged at revision: 478
Proposed branch: lp:~andreserl/maas/lp1561954
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 412 lines (+298/-22)
10 files modified
debian/changelog (+6/-2)
debian/control (+23/-3)
debian/maas-common.templates (+34/-1)
debian/maas-rack-controller.postinst (+1/-0)
debian/maas-rack-controller.templates (+0/-16)
debian/maas-rack-udeb.postinst (+77/-0)
debian/maas-rack-udeb.templates (+36/-0)
debian/maas-region-controller.postinst (+10/-0)
debian/maas-region-udeb.postinst (+82/-0)
debian/maas-region-udeb.templates (+29/-0)
To merge this branch: bzr merge lp:~andreserl/maas/lp1561954
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) Approve
LaMont Jones (community) Approve
Mathieu Trudel-Lapierre (community) Needs Fixing
Review via email: mp+291259@code.launchpad.net

Commit message

Add maas-region-udeb and maas-rack-udeb to be used as part of the Ubuntu Server Installer (LP: #1561954)

To post a comment you must log in.
lp:~andreserl/maas/lp1561954 updated
483. By Andres Rodriguez

* New upstream release, 2.0.0 beta 2 bzr 4883 (Standing FFe LP: #1553261)
* Add maas-region-udeb and maas-rack-udeb to be used as part of the
  Ubuntu Server Installer (LP: #1561954)
  - ensure maas-rack-controller and maas-region-controller can be fully
    preseeded.

484. By Andres Rodriguez

update

485. By Andres Rodriguez

Fix maas-region-udeb.postinst for better interaction

486. By Andres Rodriguez

Fix rack

487. By Andres Rodriguez

fixed

488. By Andres Rodriguez

fix

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Considering this code doesn't have to do much more than set a username/password or URLs and such, you could have done it with a single udeb which asks the question whether you want to install a region controller or rack controller (the question would be preseeded for the purpose of the Server CD anyway). That said, the approach to take is yours to choose.

I'm a little concerned with the pkgsel and tasksel usage though, as I can see this would likely override other preseeding set by the user, which may not be what you want:
+db_set pkgsel/include maas
+set_question tasksel tasksel/first multiselect "standard, server"

This will override pkgsel/include, so you may wish to db_get it first and merge the changes in (no deduplication needed), and the same applies to tasksel/first.

review: Needs Fixing
Revision history for this message
LaMont Jones (lamont) wrote :

Just one comment (I'll let you check into what the XC- tells the packager to do...) Looks good otherwise, nothing screams at me. If it works, call it good.

review: Approve
Revision history for this message
LaMont Jones (lamont) wrote :

> Considering this code doesn't have to do much more than set a
> username/password or URLs and such, you could have done it with a single udeb
> which asks the question whether you want to install a region controller or
> rack controller (the question would be preseeded for the purpose of the Server
> CD anyway). That said, the approach to take is yours to choose.
>
> I'm a little concerned with the pkgsel and tasksel usage though, as I can see
> this would likely override other preseeding set by the user, which may not be
> what you want:
> +db_set pkgsel/include maas
> +set_question tasksel tasksel/first multiselect "standard, server"
>
> This will override pkgsel/include, so you may wish to db_get it first and
> merge the changes in (no deduplication needed), and the same applies to
> tasksel/first.

Good points.

lp:~andreserl/maas/lp1561954 updated
489. By Andres Rodriguez

remove unneeded comment

490. By Andres Rodriguez

Fix lamon'ts comments

Revision history for this message
Andres Rodriguez (andreserl) :
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-04-05 21:02:49 +0000
3+++ debian/changelog 2016-04-07 21:21:25 +0000
4@@ -1,6 +1,10 @@
5-maas (2.0.0~beta2+bzr4873-0ubuntu1) UNRELEASED; urgency=medium
6+maas (2.0.0~beta2+bzr4885-0ubuntu1) UNRELEASED; urgency=medium
7
8- * UNRELEASED
9+ * New upstream release, 2.0.0 beta 2 bzr 4885 (Standing FFe LP: #1553261)
10+ * Add maas-region-udeb and maas-rack-udeb to be used as part of the
11+ Ubuntu Server Installer (LP: #1561954)
12+ - ensure maas-rack-controller and maas-region-controller can be fully
13+ preseeded.
14
15 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 05 Apr 2016 17:02:32 -0400
16
17
18=== modified file 'debian/control'
19--- debian/control 2016-04-01 13:18:49 +0000
20+++ debian/control 2016-04-07 21:21:25 +0000
21@@ -11,7 +11,7 @@
22 python3-django,
23 python3-setuptools,
24 python3-twisted
25-Standards-Version: 3.9.6
26+Standards-Version: 3.9.7
27 X-Python3-Version: >= 3.5
28 Homepage: http://maas.io/
29
30@@ -53,7 +53,7 @@
31 .
32 This package is a metapackage which installs all of the separate components
33 of MAAS on a single machine.
34-
35+
36 Package: maas-common
37 Architecture: all
38 Depends: ${misc:Depends}
39@@ -223,7 +223,7 @@
40 .
41 This package depends on the necessary components to provide iSCSI,
42 DHCP, TFTP and power management.
43-
44+
45 Package: python3-django-maas
46 Section: python
47 Architecture: all
48@@ -272,3 +272,23 @@
49 Description: MAAS Caching Proxy
50 This package installs and configures a Caching Proxy server that can be
51 used by MAAS. It enhances the overall MAAS user experience.
52+
53+Package: maas-region-udeb
54+Package-Type: udeb
55+Section: debian-installer
56+Architecture: any
57+Depends:
58+ ${shlibs:Depends},
59+ ${misc:Depends}
60+XB-Installer-Menu-Item: 2350
61+Description: Install a MAAS server (installer integration)
62+
63+Package: maas-rack-udeb
64+Package-Type: udeb
65+Section: debian-installer
66+Architecture: any
67+Depends:
68+ ${shlibs:Depends},
69+ ${misc:Depends}
70+XB-Installer-Menu-Item: 2350
71+Description: Install a MAAS Rack controller (installer integration)
72
73=== renamed file 'debian/maas-region-api.templates' => 'debian/maas-common.templates'
74--- debian/maas-region-api.templates 2016-03-25 18:26:49 +0000
75+++ debian/maas-common.templates 2016-04-07 21:21:25 +0000
76@@ -19,4 +19,37 @@
77 that is used for PXE and provisioning. However, it needs to be
78 in the same network as the clients. If the automatically
79 detected address is not in the same network as the clients, it
80- must be changed.
81+ must be changed.
82+
83+Template: maas/username
84+Type: string
85+_Description: Ubuntu MAAS username
86+ The Ubuntu MAAS server requires the administrator to create a
87+ username and password combination.
88+ .
89+ Please provide the username for the MAAS account.
90+
91+Template: maas/password
92+Type: password
93+_Description: Ubuntu MAAS password
94+ The Ubuntu MAAS server requires the administrator to create a
95+ username and password combination.
96+ .
97+ Please provide the password for the MAAS account.
98+
99+Template: maas-rack-controller/maas-url
100+Type: string
101+Default:
102+_Description: Ubuntu MAAS API address:
103+ The MAAS cluster controller and nodes need to contact the MAAS region
104+ controller API. Set the URL at which they can reach the MAAS API remotely,
105+ e.g. "http://192.168.1.1/MAAS".
106+ Since nodes must be able to access this URL, localhost or 127.0.0.1 are not
107+ useful values here.
108+
109+Template: maas-rack-controller/shared-secret
110+Type: password
111+Default:
112+_Description: MAAS Cluster Controller Shared Secret:
113+ The MAAS Cluster Controller needs to contact the MAAS server
114+ with a share secret. Set the shared secret here.
115
116=== modified file 'debian/maas-rack-controller.postinst'
117--- debian/maas-rack-controller.postinst 2016-04-01 18:27:46 +0000
118+++ debian/maas-rack-controller.postinst 2016-04-07 21:21:25 +0000
119@@ -144,6 +144,7 @@
120 configure_cluster_authbind
121 maas-rack upgrade-cluster
122 upgrade_from_cluster_controller
123+ configure_shared_secret
124
125 elif [ -n "$DEBCONF_RECONFIGURE" ]; then
126 configure_maas_url
127
128=== removed file 'debian/maas-rack-controller.templates'
129--- debian/maas-rack-controller.templates 2016-02-04 10:08:48 +0000
130+++ debian/maas-rack-controller.templates 1970-01-01 00:00:00 +0000
131@@ -1,16 +0,0 @@
132-Template: maas-rack-controller/maas-url
133-Type: string
134-Default:
135-_Description: Ubuntu MAAS API address:
136- The MAAS cluster controller and nodes need to contact the MAAS region
137- controller API. Set the URL at which they can reach the MAAS API remotely,
138- e.g. "http://192.168.1.1/MAAS".
139- Since nodes must be able to access this URL, localhost or 127.0.0.1 are not
140- useful values here.
141-
142-Template: maas-rack-controller/shared-secret
143-Type: password
144-Default:
145-_Description: MAAS Cluster Controller Shared Secret:
146- The MAAS Cluster Controller needs to contact the MAAS server
147- with a share secret. Set the shared secret here.
148
149=== added file 'debian/maas-rack-udeb.postinst'
150--- debian/maas-rack-udeb.postinst 1970-01-01 00:00:00 +0000
151+++ debian/maas-rack-udeb.postinst 2016-04-07 21:21:25 +0000
152@@ -0,0 +1,77 @@
153+#!/bin/sh -e
154+
155+# Source debconf library.
156+. /usr/share/debconf/confmodule
157+db_version 2.0
158+
159+# This conf script is capable of backing up
160+db_capb backup
161+
162+logfile=/var/lib/preseed/log
163+set_question () {
164+ echo "$1 $2 $3 $4" >>"$logfile"
165+ if ! db_fget "$2" seen; then
166+ db_register debian-installer/dummy "$2"
167+ db_subst "$2" ID "$2"
168+ db_fget "$2" seen
169+ fi
170+ if [ "$RET" = false ]; then
171+ db_set "$2" "$4"
172+ db_fset "$2" seen true
173+ fi
174+}
175+
176+STATE=1
177+while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
178+ case "$STATE" in
179+ 1)
180+ # This is a confirmation that we want to install MAAS. If we don't
181+ # then we exit the MAAS installation process
182+ db_input high maas-rack-udeb/rack-confirmation || true
183+ ;;
184+ 2)
185+ #Ask for MAAS url
186+ db_get maas-rack-udeb/rack-confirmation
187+ if [ "$RET" != "true" ]; then
188+ break
189+ fi
190+ db_input critical maas-rack-udeb/maas-url || true
191+ ;;
192+
193+ 3)
194+ # Ask for Shared Secret
195+ db_input critical maas-rack-udeb/shared-secret || true
196+ ;;
197+
198+ esac
199+
200+ if db_go; then
201+ STATE=$(($STATE + 1))
202+ else
203+ STATE=$(($STATE - 1))
204+ fi
205+done
206+db_capb
207+
208+db_get maas-rack-udeb/rack-confirmation
209+if [ "$RET" != "true" ]; then
210+ # MAAS rack controller won't be installed
211+ exit 0
212+fi
213+
214+db_get maas-rack-udeb/maas-url
215+url="$RET"
216+if [ -n "$url" ]; then
217+ set_question maas-rack-controller maas-rack-controller/maas-url string "$url"
218+fi
219+
220+db_get maas-rack-udeb/shared-secret
221+secret="$RET"
222+if [ -n "$secret" ]; then
223+ set_question maas-rack-controller maas-rack-controller/shared-secret password "$secret"
224+fi
225+
226+# Tell the package manager that we will be installing MAAS Rack Controller
227+db_set pkgsel/include maas-rack-controller
228+set_question tasksel tasksel/first multiselect "standard, server"
229+exit 0
230
231=== added file 'debian/maas-rack-udeb.templates'
232--- debian/maas-rack-udeb.templates 1970-01-01 00:00:00 +0000
233+++ debian/maas-rack-udeb.templates 2016-04-07 21:21:25 +0000
234@@ -0,0 +1,36 @@
235+Template: debian-installer/maas-rack-udeb/title
236+Type: text
237+_Description: Install your Metal as a Service (MAAS) Rack Controller
238+
239+Template: maas-rack-udeb/rack-confirmation
240+Type: boolean
241+_Description: Would you like to proceed with the installation of your MAAS Rack Controller?
242+ The MAAS rack controller (maas-rackd) provides highly available, fast
243+ and local broadcast services to the machines provisioned by MAAS. You
244+ need a MAAS rack controller attached to each fabric (which is a set of
245+ trunked switches). You can attach multiple rack controllers to these
246+ physical networks for high availability, with secondary rack controllers
247+ automatically stepping to provide these services if the primary rack
248+ controller fails.
249+ .
250+ By choosing to install a MAAS Rack controller, you will have to connect
251+ it to a Region controller to service your machines.
252+
253+Template: maas-rack-udeb/maas-url
254+Type: string
255+Default:
256+_Description: Ubuntu MAAS Region API address:
257+ The MAAS rack controller and nodes need to contact the MAAS region
258+ controller API. Set the URL at which they can reach the MAAS API remotely,
259+ e.g. "http://192.168.1.1:5240/MAAS".
260+ .
261+ Since nodes must be able to access this URL, localhost or 127.0.0.1 are not
262+ useful values here.
263+
264+Template: maas-rack-udeb/shared-secret
265+Type: password
266+Default:
267+_Description: MAAS Rack Controller shared secret:
268+ The MAAS Rack Controller needs to contact the MAAS server
269+ with a share secret. This shared secret can be found on
270+ the MAAS Region Controller server under /var/lib/maas/secret.
271
272=== modified file 'debian/maas-region-controller.postinst'
273--- debian/maas-region-controller.postinst 2016-03-31 20:03:18 +0000
274+++ debian/maas-region-controller.postinst 2016-04-07 21:21:25 +0000
275@@ -91,6 +91,16 @@
276 configure_migrate_maas_dns
277 fi
278
279+ db_get maas/username
280+ username="$RET"
281+ if [ -n "$username" ]; then
282+ db_get maas/password
283+ password="$RET"
284+ if [ -n "$password" ]; then
285+ maas-region createadmin --username "$username" --password "$password" --email "$username@maas"
286+ fi
287+ fi
288+
289 # Display installation note
290 db_input low maas/installation-note || true
291 db_go
292
293=== added file 'debian/maas-region-udeb.postinst'
294--- debian/maas-region-udeb.postinst 1970-01-01 00:00:00 +0000
295+++ debian/maas-region-udeb.postinst 2016-04-07 21:21:25 +0000
296@@ -0,0 +1,82 @@
297+#!/bin/sh -e
298+
299+# Source debconf library.
300+. /usr/share/debconf/confmodule
301+db_version 2.0
302+
303+# This conf script is capable of backing up
304+db_capb backup
305+
306+logfile=/var/lib/preseed/log
307+set_question () {
308+ echo "$1 $2 $3 $4" >>"$logfile"
309+ if ! db_fget "$2" seen; then
310+ db_register debian-installer/dummy "$2"
311+ db_subst "$2" ID "$2"
312+ db_fget "$2" seen
313+ fi
314+ if [ "$RET" = false ]; then
315+ db_set "$2" "$4"
316+ db_fset "$2" seen true
317+ fi
318+}
319+
320+
321+STATE=1
322+while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
323+ case "$STATE" in
324+ 1)
325+ # This is a confirmation that we want to install MAAS. If we don't
326+ # then we exit the MAAS installation process
327+ db_input high maas-region-udeb/maas-confirmation || true
328+ ;;
329+
330+ 2)
331+ # Ask for username
332+ db_get maas-region-udeb/maas-confirmation
333+ if [ "$RET" != "true" ]; then
334+ break
335+ fi
336+ db_input critical maas-region-udeb/username || true
337+ ;;
338+
339+ 3)
340+ # Ask for password
341+ db_get maas-region-udeb/username
342+ if [ -n "$RET" ]; then
343+ db_input critical maas-region-udeb/password || true
344+ fi
345+ ;;
346+
347+ esac
348+
349+ if db_go; then
350+ STATE=$(($STATE + 1))
351+ else
352+ STATE=$(($STATE - 1))
353+ fi
354+done
355+db_capb
356+
357+db_get maas-region-udeb/maas-confirmation
358+if [ "$RET" != "true" ]; then
359+ # MAAS won't be installed
360+ exit 0
361+fi
362+# Only preseed username/password combination if both have been
363+# input in the installer. If no $password has been input, do not
364+# preseed
365+db_get maas-region-udeb/username
366+username="$RET"
367+if [ -n "$username" ]; then
368+ db_get maas-region-udeb/password
369+ password="$RET"
370+ if [ -n "$password" ]; then
371+ set_question maas-region-controller maas/username string "$username"
372+ set_question maas-region-controller maas/password password "$password"
373+ fi
374+fi
375+# Tell the package manager that we will be installing MAAS
376+db_set pkgsel/include maas
377+set_question tasksel tasksel/first multiselect "standard, server"
378+exit 0
379
380=== added file 'debian/maas-region-udeb.templates'
381--- debian/maas-region-udeb.templates 1970-01-01 00:00:00 +0000
382+++ debian/maas-region-udeb.templates 2016-04-07 21:21:25 +0000
383@@ -0,0 +1,29 @@
384+Template: debian-installer/maas-region-udeb/title
385+Type: text
386+_Description: Install your Metal as a Service (MAAS)
387+
388+Template: maas-region-udeb/maas-confirmation
389+Type: boolean
390+_Description: Would you like to proceed with the installation of your MAAS?
391+ MAAS runs a software-defined data centre - it turns a collection of physical
392+ servers and switches into a bare metal cloud with full open source IP address
393+ management (IPAM) and instant provisioning on demand.
394+ .
395+ By choosing to install MAAS, a MAAS Region Controller API server and PostgreSQL
396+ database will be installed.
397+
398+Template: maas-region-udeb/username
399+Type: string
400+_Description: Username for your MAAS administrator account:
401+ MAAS requires an administrative account to be created before you can use MAAS.
402+ Please enter the username for the administrator. If no username is provided,
403+ you will have to create one before you are able to use MAAS.
404+
405+Template: maas-region-udeb/password
406+Type: password
407+_Description: Choose a password for the MAAS administrator account:
408+ MAAS requires an administrative account to be created before you can use MAAS.
409+ Please enter the password for the administrator's account.
410+ .
411+ If the password is not entered, your MAAS installation will proceed, but no
412+ administrator's account will be created.

Subscribers

People subscribed via source and target branches

to all changes: