Merge lp:~allenap/maas/packaging.fix-cluster-installation into lp:~maas-maintainers/maas/packaging

Proposed by Gavin Panella on 2015-07-10
Status: Merged
Approved by: Gavin Panella on 2015-07-14
Approved revision: 421
Merged at revision: 416
Proposed branch: lp:~allenap/maas/packaging.fix-cluster-installation
Merge into: lp:~maas-maintainers/maas/packaging
Diff against target: 72 lines (+11/-2)
5 files modified
debian/maas-cluster-controller.config (+1/-1)
debian/maas-cluster-controller.maas-clusterd.service (+1/-1)
debian/maas-cluster-controller.postinst (+4/-0)
debian/maas-region-controller-min.maas-regiond-worker@.service (+1/-0)
debian/maas-region-controller-min.postinst (+4/-0)
To merge this branch: bzr merge lp:~allenap/maas/packaging.fix-cluster-installation
Reviewer Review Type Date Requested Status
Andres Rodriguez (community) 2015-07-10 Approve on 2015-07-13
Review via email: mp+264416@code.launchpad.net

Commit message

Ensures that regiond.conf and clusterd.conf are both initialised after package installation.

maas-clusterd will also be restarted if the shared secret is missing. Previously it would never be started.

Description of the change

This builds on Andres's work in lp:~andreserl/maas/fix_cluster_install_1.9, and supersedes that branch.

To post a comment you must log in.
Andres Rodriguez (andreserl) wrote :

comments inline.

review: Needs Fixing
418. By Gavin Panella on 2015-07-10

Remove superfluous creation of an empty configuration file.

419. By Gavin Panella on 2015-07-10

Improve comments about unconditionally creating configuration files.

Gavin Panella (allenap) wrote :

Thanks for the review! Answers in the diff.

Andres Rodriguez (andreserl) wrote :

Comments inline. Please address the validation of regiond.conf and clusterd.conf existance. We should not be running *any* type of code unless otherwise necessary.

review: Approve
420. By Gavin Panella on 2015-07-13

Delay for 10s between unattended restarts of maas-regiond.

421. By Gavin Panella on 2015-07-13

Merge trunk.

Gavin Panella (allenap) wrote :

Thanks for the review! Replies inline. I'm not landing this until I can get a clear run in the manual CI so I imagine you have some time if you want to make more comments :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/maas-cluster-controller.config'
2--- debian/maas-cluster-controller.config 2015-06-23 12:30:50 +0000
3+++ debian/maas-cluster-controller.config 2015-07-13 18:13:40 +0000
4@@ -12,7 +12,7 @@
5 db_get maas-cluster-controller/maas-url || true
6 if [ -z "$RET" ]; then
7 # Attempt to pre-populate if installing on the region controller.
8- if [ -e /etc/maas/regiond.conf ]; then
9+ if [ -f /usr/sbin/maas-region-admin ]; then
10 url=$(maas-region-admin local_config_get --maas-url --plain)
11 # If the URL doesn't end in /MAAS then add it. This helps upgrades from
12 # precise for which the URL didn't contain /MAAS, which is now required
13
14=== modified file 'debian/maas-cluster-controller.maas-clusterd.service'
15--- debian/maas-cluster-controller.maas-clusterd.service 2015-06-29 16:38:41 +0000
16+++ debian/maas-cluster-controller.maas-clusterd.service 2015-07-13 18:13:40 +0000
17@@ -3,12 +3,12 @@
18 Documentation=https://maas.ubuntu.com/
19 Requires=network-online.target
20 After=network-online.target
21-ConditionPathExists=/var/lib/maas/secret
22
23 [Service]
24 User=maas
25 Group=maas
26 Restart=always
27+RestartSec=10s
28 Environment="LOGFILE=/var/log/maas/clusterd.log"
29 # Logs go to the journal; read them with
30 # journalctl -u maas-clusterd
31
32=== modified file 'debian/maas-cluster-controller.postinst'
33--- debian/maas-cluster-controller.postinst 2015-07-03 02:33:20 +0000
34+++ debian/maas-cluster-controller.postinst 2015-07-13 18:13:40 +0000
35@@ -79,6 +79,10 @@
36 fi
37 }
38
39+# Unconditionally ensure that there is at least an empty configuration
40+# file. This does *not* overwrite any existing configuration.
41+maas-provision config
42+
43 if [ "$1" = "configure" ] && [ -z "$2" ]; then
44 create_log_dir
45 create_var_dir
46
47=== modified file 'debian/maas-region-controller-min.maas-regiond-worker@.service'
48--- debian/maas-region-controller-min.maas-regiond-worker@.service 2015-06-24 21:23:05 +0000
49+++ debian/maas-region-controller-min.maas-regiond-worker@.service 2015-07-13 18:13:40 +0000
50@@ -13,6 +13,7 @@
51 User=maas
52 Group=maas
53 Restart=always
54+RestartSec=10s
55 Environment="DJANGO_SETTINGS_MODULE=maas.settings"
56 Environment="PYTHONPATH=/usr/share/maas:/usr/lib/django16"
57 Environment="LOGFILE=/var/log/maas/regiond.log"
58
59=== modified file 'debian/maas-region-controller-min.postinst'
60--- debian/maas-region-controller-min.postinst 2015-07-03 13:57:50 +0000
61+++ debian/maas-region-controller-min.postinst 2015-07-13 18:13:40 +0000
62@@ -38,6 +38,10 @@
63 ln -sf /var/log/apache2 /var/log/maas/
64 }
65
66+# Unconditionally ensure that there is at least an empty configuration
67+# file. This does *not* overwrite any existing configuration.
68+maas-region-admin local_config_set
69+
70 if [ "$1" = "configure" ] && [ -z "$2" ]; then
71 #########################################################
72 ################ Folder Permissions ####################

Subscribers

People subscribed via source and target branches