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
=== modified file 'debian/changelog'
--- debian/changelog 2016-04-05 21:02:49 +0000
+++ debian/changelog 2016-04-07 21:21:25 +0000
@@ -1,6 +1,10 @@
1maas (2.0.0~beta2+bzr4873-0ubuntu1) UNRELEASED; urgency=medium1maas (2.0.0~beta2+bzr4885-0ubuntu1) UNRELEASED; urgency=medium
22
3 * UNRELEASED3 * New upstream release, 2.0.0 beta 2 bzr 4885 (Standing FFe LP: #1553261)
4 * Add maas-region-udeb and maas-rack-udeb to be used as part of the
5 Ubuntu Server Installer (LP: #1561954)
6 - ensure maas-rack-controller and maas-region-controller can be fully
7 preseeded.
48
5 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 05 Apr 2016 17:02:32 -04009 -- Andres Rodriguez <andreserl@ubuntu.com> Tue, 05 Apr 2016 17:02:32 -0400
610
711
=== modified file 'debian/control'
--- debian/control 2016-04-01 13:18:49 +0000
+++ debian/control 2016-04-07 21:21:25 +0000
@@ -11,7 +11,7 @@
11 python3-django,11 python3-django,
12 python3-setuptools,12 python3-setuptools,
13 python3-twisted13 python3-twisted
14Standards-Version: 3.9.614Standards-Version: 3.9.7
15X-Python3-Version: >= 3.515X-Python3-Version: >= 3.5
16Homepage: http://maas.io/16Homepage: http://maas.io/
1717
@@ -53,7 +53,7 @@
53 .53 .
54 This package is a metapackage which installs all of the separate components54 This package is a metapackage which installs all of the separate components
55 of MAAS on a single machine.55 of MAAS on a single machine.
56 56
57Package: maas-common57Package: maas-common
58Architecture: all58Architecture: all
59Depends: ${misc:Depends}59Depends: ${misc:Depends}
@@ -223,7 +223,7 @@
223 .223 .
224 This package depends on the necessary components to provide iSCSI,224 This package depends on the necessary components to provide iSCSI,
225 DHCP, TFTP and power management.225 DHCP, TFTP and power management.
226 226
227Package: python3-django-maas227Package: python3-django-maas
228Section: python228Section: python
229Architecture: all229Architecture: all
@@ -272,3 +272,23 @@
272Description: MAAS Caching Proxy272Description: MAAS Caching Proxy
273 This package installs and configures a Caching Proxy server that can be273 This package installs and configures a Caching Proxy server that can be
274 used by MAAS. It enhances the overall MAAS user experience.274 used by MAAS. It enhances the overall MAAS user experience.
275
276Package: maas-region-udeb
277Package-Type: udeb
278Section: debian-installer
279Architecture: any
280Depends:
281 ${shlibs:Depends},
282 ${misc:Depends}
283XB-Installer-Menu-Item: 2350
284Description: Install a MAAS server (installer integration)
285
286Package: maas-rack-udeb
287Package-Type: udeb
288Section: debian-installer
289Architecture: any
290Depends:
291 ${shlibs:Depends},
292 ${misc:Depends}
293XB-Installer-Menu-Item: 2350
294Description: Install a MAAS Rack controller (installer integration)
275295
=== renamed file 'debian/maas-region-api.templates' => 'debian/maas-common.templates'
--- debian/maas-region-api.templates 2016-03-25 18:26:49 +0000
+++ debian/maas-common.templates 2016-04-07 21:21:25 +0000
@@ -19,4 +19,37 @@
19 that is used for PXE and provisioning. However, it needs to be19 that is used for PXE and provisioning. However, it needs to be
20 in the same network as the clients. If the automatically20 in the same network as the clients. If the automatically
21 detected address is not in the same network as the clients, it21 detected address is not in the same network as the clients, it
22 must be changed. 22 must be changed.
23
24Template: maas/username
25Type: string
26_Description: Ubuntu MAAS username
27 The Ubuntu MAAS server requires the administrator to create a
28 username and password combination.
29 .
30 Please provide the username for the MAAS account.
31
32Template: maas/password
33Type: password
34_Description: Ubuntu MAAS password
35 The Ubuntu MAAS server requires the administrator to create a
36 username and password combination.
37 .
38 Please provide the password for the MAAS account.
39
40Template: maas-rack-controller/maas-url
41Type: string
42Default:
43_Description: Ubuntu MAAS API address:
44 The MAAS cluster controller and nodes need to contact the MAAS region
45 controller API. Set the URL at which they can reach the MAAS API remotely,
46 e.g. "http://192.168.1.1/MAAS".
47 Since nodes must be able to access this URL, localhost or 127.0.0.1 are not
48 useful values here.
49
50Template: maas-rack-controller/shared-secret
51Type: password
52Default:
53_Description: MAAS Cluster Controller Shared Secret:
54 The MAAS Cluster Controller needs to contact the MAAS server
55 with a share secret. Set the shared secret here.
2356
=== modified file 'debian/maas-rack-controller.postinst'
--- debian/maas-rack-controller.postinst 2016-04-01 18:27:46 +0000
+++ debian/maas-rack-controller.postinst 2016-04-07 21:21:25 +0000
@@ -144,6 +144,7 @@
144 configure_cluster_authbind144 configure_cluster_authbind
145 maas-rack upgrade-cluster145 maas-rack upgrade-cluster
146 upgrade_from_cluster_controller146 upgrade_from_cluster_controller
147 configure_shared_secret
147148
148elif [ -n "$DEBCONF_RECONFIGURE" ]; then149elif [ -n "$DEBCONF_RECONFIGURE" ]; then
149 configure_maas_url150 configure_maas_url
150151
=== removed file 'debian/maas-rack-controller.templates'
--- debian/maas-rack-controller.templates 2016-02-04 10:08:48 +0000
+++ debian/maas-rack-controller.templates 1970-01-01 00:00:00 +0000
@@ -1,16 +0,0 @@
1Template: maas-rack-controller/maas-url
2Type: string
3Default:
4_Description: Ubuntu MAAS API address:
5 The MAAS cluster controller and nodes need to contact the MAAS region
6 controller API. Set the URL at which they can reach the MAAS API remotely,
7 e.g. "http://192.168.1.1/MAAS".
8 Since nodes must be able to access this URL, localhost or 127.0.0.1 are not
9 useful values here.
10
11Template: maas-rack-controller/shared-secret
12Type: password
13Default:
14_Description: MAAS Cluster Controller Shared Secret:
15 The MAAS Cluster Controller needs to contact the MAAS server
16 with a share secret. Set the shared secret here.
170
=== added file 'debian/maas-rack-udeb.postinst'
--- debian/maas-rack-udeb.postinst 1970-01-01 00:00:00 +0000
+++ debian/maas-rack-udeb.postinst 2016-04-07 21:21:25 +0000
@@ -0,0 +1,77 @@
1#!/bin/sh -e
2
3# Source debconf library.
4. /usr/share/debconf/confmodule
5db_version 2.0
6
7# This conf script is capable of backing up
8db_capb backup
9
10logfile=/var/lib/preseed/log
11set_question () {
12 echo "$1 $2 $3 $4" >>"$logfile"
13 if ! db_fget "$2" seen; then
14 db_register debian-installer/dummy "$2"
15 db_subst "$2" ID "$2"
16 db_fget "$2" seen
17 fi
18 if [ "$RET" = false ]; then
19 db_set "$2" "$4"
20 db_fset "$2" seen true
21 fi
22}
23
24STATE=1
25while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
26 case "$STATE" in
27 1)
28 # This is a confirmation that we want to install MAAS. If we don't
29 # then we exit the MAAS installation process
30 db_input high maas-rack-udeb/rack-confirmation || true
31 ;;
32 2)
33 #Ask for MAAS url
34 db_get maas-rack-udeb/rack-confirmation
35 if [ "$RET" != "true" ]; then
36 break
37 fi
38 db_input critical maas-rack-udeb/maas-url || true
39 ;;
40
41 3)
42 # Ask for Shared Secret
43 db_input critical maas-rack-udeb/shared-secret || true
44 ;;
45
46 esac
47
48 if db_go; then
49 STATE=$(($STATE + 1))
50 else
51 STATE=$(($STATE - 1))
52 fi
53done
54db_capb
55
56db_get maas-rack-udeb/rack-confirmation
57if [ "$RET" != "true" ]; then
58 # MAAS rack controller won't be installed
59 exit 0
60fi
61
62db_get maas-rack-udeb/maas-url
63url="$RET"
64if [ -n "$url" ]; then
65 set_question maas-rack-controller maas-rack-controller/maas-url string "$url"
66fi
67
68db_get maas-rack-udeb/shared-secret
69secret="$RET"
70if [ -n "$secret" ]; then
71 set_question maas-rack-controller maas-rack-controller/shared-secret password "$secret"
72fi
73
74# Tell the package manager that we will be installing MAAS Rack Controller
75db_set pkgsel/include maas-rack-controller
76set_question tasksel tasksel/first multiselect "standard, server"
77exit 0
078
=== added file 'debian/maas-rack-udeb.templates'
--- debian/maas-rack-udeb.templates 1970-01-01 00:00:00 +0000
+++ debian/maas-rack-udeb.templates 2016-04-07 21:21:25 +0000
@@ -0,0 +1,36 @@
1Template: debian-installer/maas-rack-udeb/title
2Type: text
3_Description: Install your Metal as a Service (MAAS) Rack Controller
4
5Template: maas-rack-udeb/rack-confirmation
6Type: boolean
7_Description: Would you like to proceed with the installation of your MAAS Rack Controller?
8 The MAAS rack controller (maas-rackd) provides highly available, fast
9 and local broadcast services to the machines provisioned by MAAS. You
10 need a MAAS rack controller attached to each fabric (which is a set of
11 trunked switches). You can attach multiple rack controllers to these
12 physical networks for high availability, with secondary rack controllers
13 automatically stepping to provide these services if the primary rack
14 controller fails.
15 .
16 By choosing to install a MAAS Rack controller, you will have to connect
17 it to a Region controller to service your machines.
18
19Template: maas-rack-udeb/maas-url
20Type: string
21Default:
22_Description: Ubuntu MAAS Region API address:
23 The MAAS rack controller and nodes need to contact the MAAS region
24 controller API. Set the URL at which they can reach the MAAS API remotely,
25 e.g. "http://192.168.1.1:5240/MAAS".
26 .
27 Since nodes must be able to access this URL, localhost or 127.0.0.1 are not
28 useful values here.
29
30Template: maas-rack-udeb/shared-secret
31Type: password
32Default:
33_Description: MAAS Rack Controller shared secret:
34 The MAAS Rack Controller needs to contact the MAAS server
35 with a share secret. This shared secret can be found on
36 the MAAS Region Controller server under /var/lib/maas/secret.
037
=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst 2016-03-31 20:03:18 +0000
+++ debian/maas-region-controller.postinst 2016-04-07 21:21:25 +0000
@@ -91,6 +91,16 @@
91 configure_migrate_maas_dns91 configure_migrate_maas_dns
92 fi92 fi
9393
94 db_get maas/username
95 username="$RET"
96 if [ -n "$username" ]; then
97 db_get maas/password
98 password="$RET"
99 if [ -n "$password" ]; then
100 maas-region createadmin --username "$username" --password "$password" --email "$username@maas"
101 fi
102 fi
103
94 # Display installation note104 # Display installation note
95 db_input low maas/installation-note || true105 db_input low maas/installation-note || true
96 db_go106 db_go
97107
=== added file 'debian/maas-region-udeb.postinst'
--- debian/maas-region-udeb.postinst 1970-01-01 00:00:00 +0000
+++ debian/maas-region-udeb.postinst 2016-04-07 21:21:25 +0000
@@ -0,0 +1,82 @@
1#!/bin/sh -e
2
3# Source debconf library.
4. /usr/share/debconf/confmodule
5db_version 2.0
6
7# This conf script is capable of backing up
8db_capb backup
9
10logfile=/var/lib/preseed/log
11set_question () {
12 echo "$1 $2 $3 $4" >>"$logfile"
13 if ! db_fget "$2" seen; then
14 db_register debian-installer/dummy "$2"
15 db_subst "$2" ID "$2"
16 db_fget "$2" seen
17 fi
18 if [ "$RET" = false ]; then
19 db_set "$2" "$4"
20 db_fset "$2" seen true
21 fi
22}
23
24
25STATE=1
26while [ "$STATE" != 0 -a "$STATE" != 4 ]; do
27 case "$STATE" in
28 1)
29 # This is a confirmation that we want to install MAAS. If we don't
30 # then we exit the MAAS installation process
31 db_input high maas-region-udeb/maas-confirmation || true
32 ;;
33
34 2)
35 # Ask for username
36 db_get maas-region-udeb/maas-confirmation
37 if [ "$RET" != "true" ]; then
38 break
39 fi
40 db_input critical maas-region-udeb/username || true
41 ;;
42
43 3)
44 # Ask for password
45 db_get maas-region-udeb/username
46 if [ -n "$RET" ]; then
47 db_input critical maas-region-udeb/password || true
48 fi
49 ;;
50
51 esac
52
53 if db_go; then
54 STATE=$(($STATE + 1))
55 else
56 STATE=$(($STATE - 1))
57 fi
58done
59db_capb
60
61db_get maas-region-udeb/maas-confirmation
62if [ "$RET" != "true" ]; then
63 # MAAS won't be installed
64 exit 0
65fi
66# Only preseed username/password combination if both have been
67# input in the installer. If no $password has been input, do not
68# preseed
69db_get maas-region-udeb/username
70username="$RET"
71if [ -n "$username" ]; then
72 db_get maas-region-udeb/password
73 password="$RET"
74 if [ -n "$password" ]; then
75 set_question maas-region-controller maas/username string "$username"
76 set_question maas-region-controller maas/password password "$password"
77 fi
78fi
79# Tell the package manager that we will be installing MAAS
80db_set pkgsel/include maas
81set_question tasksel tasksel/first multiselect "standard, server"
82exit 0
083
=== added file 'debian/maas-region-udeb.templates'
--- debian/maas-region-udeb.templates 1970-01-01 00:00:00 +0000
+++ debian/maas-region-udeb.templates 2016-04-07 21:21:25 +0000
@@ -0,0 +1,29 @@
1Template: debian-installer/maas-region-udeb/title
2Type: text
3_Description: Install your Metal as a Service (MAAS)
4
5Template: maas-region-udeb/maas-confirmation
6Type: boolean
7_Description: Would you like to proceed with the installation of your MAAS?
8 MAAS runs a software-defined data centre - it turns a collection of physical
9 servers and switches into a bare metal cloud with full open source IP address
10 management (IPAM) and instant provisioning on demand.
11 .
12 By choosing to install MAAS, a MAAS Region Controller API server and PostgreSQL
13 database will be installed.
14
15Template: maas-region-udeb/username
16Type: string
17_Description: Username for your MAAS administrator account:
18 MAAS requires an administrative account to be created before you can use MAAS.
19 Please enter the username for the administrator. If no username is provided,
20 you will have to create one before you are able to use MAAS.
21
22Template: maas-region-udeb/password
23Type: password
24_Description: Choose a password for the MAAS administrator account:
25 MAAS requires an administrative account to be created before you can use MAAS.
26 Please enter the password for the administrator's account.
27 .
28 If the password is not entered, your MAAS installation will proceed, but no
29 administrator's account will be created.

Subscribers

People subscribed via source and target branches

to all changes: