Merge lp:~andreserl/maas/packaging_clusterd_conf into lp:~maas-maintainers/maas/packaging
- packaging_clusterd_conf
- Merge into packaging
Proposed by
Andres Rodriguez
Status: | Superseded |
---|---|
Proposed branch: | lp:~andreserl/maas/packaging_clusterd_conf |
Merge into: | lp:~maas-maintainers/maas/packaging |
Diff against target: |
522 lines (+66/-195) 15 files modified
debian/maas-cluster-controller.config (+3/-3) debian/maas-cluster-controller.install (+0/-6) debian/maas-cluster-controller.maas-clusterd.service (+2/-3) debian/maas-cluster-controller.maas-clusterd.upstart (+1/-1) debian/maas-cluster-controller.postinst (+22/-40) debian/maas-region-controller-min.apport (+3/-1) debian/maas-region-controller-min.install (+0/-3) debian/maas-region-controller-min.links (+0/-1) debian/maas-region-controller-min.maas-regiond.service (+1/-1) debian/maas-region-controller-min.postinst (+6/-69) debian/maas-region-controller.config (+1/-1) debian/maas-region-controller.postinst (+27/-28) debian/patches/01-fix-database-settings.patch (+0/-17) debian/patches/02-pserv-config.patch (+0/-19) debian/patches/series (+0/-2) |
To merge this branch: | bzr merge lp:~andreserl/maas/packaging_clusterd_conf |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
MAAS Maintainers | Pending | ||
Review via email: mp+257020@code.launchpad.net |
This proposal has been superseded by a proposal from 2015-04-22.
Commit message
Description of the change
To post a comment you must log in.
Unmerged revisions
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 2013-03-19 19:44:20 +0000 |
3 | +++ debian/maas-cluster-controller.config 2015-04-22 01:44:57 +0000 |
4 | @@ -12,8 +12,8 @@ |
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/maas_local_settings.py ]; then |
9 | - url=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"\"")} END{print array[2] }' /etc/maas/maas_local_settings.py) |
10 | + if [ -e /etc/maas/regiond.conf ]; then |
11 | + url=$(awk '$1 == "maas_url:" { split($0,array," ")} END{print array[2] }' /etc/maas/regiond.conf) |
12 | # If the URL doesn't end in /MAAS then add it. This helps upgrades from |
13 | # precise for which the URL didn't contain /MAAS, which is now required |
14 | if ! echo $url | grep -qs "/MAAS$"; then |
15 | @@ -22,7 +22,7 @@ |
16 | db_set maas-cluster-controller/maas-url "$url" |
17 | else |
18 | # Will only get here if dbconf value not already set, or |
19 | - # /etc/maas/maas_local_settings.py doesn't exist. |
20 | + # /etc/maas/regiond.conf doesn't exist. |
21 | db_input medium maas-cluster-controller/maas-url || true |
22 | db_go |
23 | fi |
24 | |
25 | === modified file 'debian/maas-cluster-controller.install' |
26 | --- debian/maas-cluster-controller.install 2015-03-25 16:35:38 +0000 |
27 | +++ debian/maas-cluster-controller.install 2015-04-22 01:44:57 +0000 |
28 | @@ -1,12 +1,6 @@ |
29 | # Install twisted plugins |
30 | twisted/plugins/maasclusterd.py usr/share/pyshared/twisted/plugins |
31 | |
32 | -# Install PSERV config file |
33 | -debian/tmp/etc/maas/pserv.yaml |
34 | - |
35 | -# Install cluster config file |
36 | -debian/tmp/etc/maas/maas_cluster.conf |
37 | - |
38 | # Install templates |
39 | debian/tmp/etc/maas/templates/dhcp |
40 | debian/tmp/etc/maas/templates/power |
41 | |
42 | === modified file 'debian/maas-cluster-controller.maas-clusterd.service' |
43 | --- debian/maas-cluster-controller.maas-clusterd.service 2015-03-17 20:12:30 +0000 |
44 | +++ debian/maas-cluster-controller.maas-clusterd.service 2015-04-22 01:44:57 +0000 |
45 | @@ -5,16 +5,15 @@ |
46 | ConditionPathExists=/etc/maas/maas_cluster.conf |
47 | # This (pserv.yaml) will go away once streamline |
48 | # config files or move to sqlite. |
49 | -ConditionPathExists=/etc/maas/pserv.yaml |
50 | +ConditionPathExists=/etc/maas/clusterd.conf |
51 | ConditionPathExists=/var/lib/maas/secret |
52 | |
53 | [Service] |
54 | Restart=on-failure |
55 | -EnvironmentFile=/etc/maas/maas_cluster.conf |
56 | ExecStart=/bin/sh -ec '\ |
57 | exec /usr/bin/authbind --deep /usr/bin/twistd \ |
58 | --nodaemon --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid \ |
59 | - maas-clusterd --config-file=/etc/maas/pserv.yaml > \ |
60 | + maas-clusterd --config-file=/etc/maas/clusterd.conf > \ |
61 | /var/log/maas/clusterd.log 2>&1' |
62 | |
63 | [Install] |
64 | |
65 | === modified file 'debian/maas-cluster-controller.maas-clusterd.upstart' |
66 | --- debian/maas-cluster-controller.maas-clusterd.upstart 2015-01-23 14:56:56 +0000 |
67 | +++ debian/maas-cluster-controller.maas-clusterd.upstart 2015-04-22 01:44:57 +0000 |
68 | @@ -6,7 +6,7 @@ |
69 | |
70 | respawn |
71 | |
72 | -env CONFIG_FILE=/etc/maas/maas_cluster.conf |
73 | +env CONFIG_FILE=/etc/maas/clusterd.conf |
74 | env LOGFILE=/var/log/maas/clusterd.log |
75 | |
76 | pre-start script |
77 | |
78 | === modified file 'debian/maas-cluster-controller.postinst' |
79 | --- debian/maas-cluster-controller.postinst 2015-03-17 17:15:56 +0000 |
80 | +++ debian/maas-cluster-controller.postinst 2015-04-22 01:44:57 +0000 |
81 | @@ -39,7 +39,8 @@ |
82 | extract_cluster_uuid(){ |
83 | # Extract ClUSTER_UUID setting from config file $1. This will work |
84 | # the cluster config (which is shell). |
85 | - sed -n -e "s/^CLUSTER_UUID *= *[\"']\([^\"']*\).*/\1/p" "$1" |
86 | + #awk '$1 == "cluster_uuid:" { split($0,array," ")} END{print array[2] }' "$1" |
87 | + awk '{ split($1,array,"\"")} END{print array[2] }' "$1" |
88 | } |
89 | |
90 | configure_cluster_uuid(){ |
91 | @@ -48,23 +49,13 @@ |
92 | # we want to generate one. |
93 | local uuid |
94 | |
95 | - if [ -n "$(extract_cluster_uuid /etc/maas/maas_cluster.conf)" ]; then |
96 | + uuid=$(awk '$1 == "cluster_uuid:" { split($0,array," ")} END{print array[2] }' "/etc/maas/clusterd.conf") |
97 | + if [ -n "$uuid" ]; then |
98 | # UUID is already set up. Wonderful. |
99 | return |
100 | else |
101 | # No UUID at all yet. Generate one. |
102 | - uuid="$(uuidgen)" |
103 | - fi |
104 | - |
105 | - # Write the uuid to maas_cluster.conf |
106 | - # There is no initial placeholder in this file, so just append the setting. |
107 | - echo "CLUSTER_UUID=\"$uuid\"" >>/etc/maas/maas_cluster.conf |
108 | -} |
109 | - |
110 | -enable_apache_version_mod(){ |
111 | - COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true) |
112 | - if [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then |
113 | - a2enmod version |
114 | + maas-provision config --init |
115 | fi |
116 | } |
117 | |
118 | @@ -83,19 +74,11 @@ |
119 | chmod 700 /etc/authbind/byuid/$MAAS_UID |
120 | } |
121 | |
122 | -restart_apache2(){ |
123 | - if [ -x /usr/sbin/invoke-rc.d ]; then |
124 | - invoke-rc.d apache2 restart || true |
125 | - else |
126 | - /etc/init.d/apache2 restart || true |
127 | - fi |
128 | -} |
129 | - |
130 | configure_maas_url(){ |
131 | # Get the MAAS_URL on configure/reconfigure and write it to the conf files. |
132 | db_get maas-cluster-controller/maas-url || true |
133 | if [ -n "$RET" ]; then |
134 | - maas-provision configure-maas-url "$RET" |
135 | + maas-provision config --region-url "$RET" |
136 | fi |
137 | } |
138 | |
139 | @@ -108,36 +91,35 @@ |
140 | fi |
141 | } |
142 | |
143 | - |
144 | if [ "$1" = "configure" ] && [ -z "$2" ]; then |
145 | create_log_dir |
146 | configure_maas_tgt |
147 | -fi |
148 | - |
149 | -if [ "$1" = "configure" ]; then |
150 | - if dpkg --compare-versions "$2" lt 0.1+bzr1239+dfsg-0ubuntu1; then |
151 | - create_log_dir |
152 | - fi |
153 | - |
154 | - configure_maas_tgt |
155 | + configure_maas_url |
156 | + configure_cluster_uuid |
157 | + configure_cluster_authbind |
158 | + maas-provision upgrade-cluster |
159 | + |
160 | +elif [ -n "$DEBCONF_RECONFIGURE" ]; then |
161 | configure_maas_url |
162 | # Only ask for a shared secret when the region is not installed |
163 | # on the same system. |
164 | - if [ -n "$DEBCONF_RECONFIGURE" ] && [ ! -f /usr/sbin/maas-region-admin ]; then |
165 | + if [ ! -f /usr/sbin/maas-region-admin ]; then |
166 | db_input high maas-cluster-controller/shared-secret |
167 | db_go |
168 | fi |
169 | configure_shared_secret |
170 | |
171 | - # This config file may contain a private cluster UUID. Only maas |
172 | - # can read it; only root can write it. |
173 | - chown root:maas /etc/maas/maas_cluster.conf |
174 | - chmod 0640 /etc/maas/maas_cluster.conf |
175 | +elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then |
176 | + # If we are upgrading from an older version, then we need |
177 | + # to obtain the *old* CLUSTER UUID and set it. |
178 | + if [ -f /etc/maas/maas_cluster.conf ]; then |
179 | + uuid=$(extract_cluster_uuid) |
180 | + maas-provision config --uuid "$uuid" |
181 | + mv /etc/maas/maas_cluster.conf /etc/maas/maas_cluster.conf.maas-old |
182 | + mv /etc/maas/pserv.yaml /etc/maas/pserv.yaml.maas-old |
183 | + fi |
184 | |
185 | - configure_cluster_uuid |
186 | configure_cluster_authbind |
187 | - enable_apache_version_mod |
188 | - restart_apache2 |
189 | maas-provision upgrade-cluster |
190 | fi |
191 | |
192 | |
193 | === modified file 'debian/maas-region-controller-min.apport' |
194 | --- debian/maas-region-controller-min.apport 2015-01-21 16:24:16 +0000 |
195 | +++ debian/maas-region-controller-min.apport 2015-04-22 01:44:57 +0000 |
196 | @@ -21,7 +21,7 @@ |
197 | |
198 | def add_info(report, ui): |
199 | response = ui.yesno( |
200 | - "The contents of your /etc/maas/maas_local_settings.py, " |
201 | + "The contents of your /etc/maas/regiond.conf, " |
202 | "/etc/maas/pserv.yaml files may help developers diagnose your bug " |
203 | "more quickly. However, it may contain sensitive information. Do " |
204 | "you want to include it in your bug report?") |
205 | @@ -30,6 +30,8 @@ |
206 | raise StopIteration |
207 | elif response is True: |
208 | attach_conffiles(report, 'maas') |
209 | + attach_file_if_exists( |
210 | + report, '/etc/maas/regiond.conf', 'MAASRegionConfig') |
211 | |
212 | # Attaching log files |
213 | attach_file_if_exists( |
214 | |
215 | === modified file 'debian/maas-region-controller-min.install' |
216 | --- debian/maas-region-controller-min.install 2014-11-05 16:38:22 +0000 |
217 | +++ debian/maas-region-controller-min.install 2015-04-22 01:44:57 +0000 |
218 | @@ -7,9 +7,6 @@ |
219 | # Install Apache Config |
220 | debian/tmp/etc/maas/maas-http.conf |
221 | |
222 | -# Install MAAS local settings |
223 | -debian/tmp/etc/maas/maas_local_settings.py |
224 | - |
225 | # Install new preseed files |
226 | debian/tmp/etc/maas/preseeds |
227 | |
228 | |
229 | === removed file 'debian/maas-region-controller-min.links' |
230 | --- debian/maas-region-controller-min.links 2014-09-25 20:19:36 +0000 |
231 | +++ debian/maas-region-controller-min.links 1970-01-01 00:00:00 +0000 |
232 | @@ -1,1 +0,0 @@ |
233 | -etc/maas/maas_local_settings.py usr/share/maas/maas_local_settings.py |
234 | |
235 | === modified file 'debian/maas-region-controller-min.maas-regiond.service' |
236 | --- debian/maas-region-controller-min.maas-regiond.service 2015-03-20 23:06:34 +0000 |
237 | +++ debian/maas-region-controller-min.maas-regiond.service 2015-04-22 01:44:57 +0000 |
238 | @@ -3,7 +3,7 @@ |
239 | Requires=network-online.target |
240 | After=network-online.target |
241 | # This will go away one we support new config files. |
242 | -ConditionPathExists=/etc/maas/maas_local_settings.py |
243 | +ConditionPathExists=/etc/maas/regiond.conf |
244 | |
245 | [Service] |
246 | Restart=on-failure |
247 | |
248 | === modified file 'debian/maas-region-controller-min.postinst' |
249 | --- debian/maas-region-controller-min.postinst 2015-02-11 14:22:53 +0000 |
250 | +++ debian/maas-region-controller-min.postinst 2015-04-22 01:44:57 +0000 |
251 | @@ -8,22 +8,12 @@ |
252 | RELEASE=`lsb_release -rs` || RELEASE="" |
253 | |
254 | configure_region_http() { |
255 | - case $RELEASE in |
256 | - 12.04|12.10|13.04) |
257 | - # handle apache configs |
258 | - if [ -e /etc/maas/maas-http.conf -a \ |
259 | - ! -e /etc/apache2/conf.d/maas-http.conf ]; then |
260 | - ln -sf /etc/maas/maas-http.conf /etc/apache2/conf.d/maas-http.conf |
261 | - fi |
262 | - ;; |
263 | - *) |
264 | - # handle apache configs |
265 | - if [ -e /etc/maas/maas-http.conf -a \ |
266 | - ! -e /etc/apache2/conf-enabled/maas-http.conf ]; then |
267 | - ln -sf /etc/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf |
268 | - fi |
269 | - ;; |
270 | - esac |
271 | + # handle apache configs |
272 | + if [ -e /etc/maas/maas-http.conf -a \ |
273 | + ! -e /etc/apache2/conf-enabled/maas-http.conf ]; then |
274 | + ln -sf /etc/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf |
275 | + fi |
276 | + |
277 | # enable apache modules needed |
278 | a2enmod proxy_http |
279 | a2enmod expires |
280 | @@ -60,25 +50,6 @@ |
281 | ln -sf /var/log/apache2 /var/log/maas/ |
282 | } |
283 | |
284 | -configure_maas_default_url() { |
285 | - local ipaddr="$1" |
286 | - |
287 | - if grep -qs "^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$" /etc/maas/maas_local_settings.py; then |
288 | - sed -i "s/^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$/DEFAULT_MAAS_URL = \"http:\/\/$ipaddr\/MAAS\"/" /etc/maas/maas_local_settings.py |
289 | - fi |
290 | -} |
291 | - |
292 | -get_default_route_ip() { |
293 | - while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT; do |
294 | - [ "$Mask" = "00000000" ] && break |
295 | - done < /proc/net/route |
296 | - interface="$Iface" |
297 | - ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$interface" scope global) |
298 | - ipaddr=${ipaddr#* inet } |
299 | - ipaddr=${ipaddr%%/*} |
300 | - echo $ipaddr |
301 | -} |
302 | - |
303 | if [ "$1" = "configure" ] && [ -z "$2" ]; then |
304 | ######################################################### |
305 | ################ Folder Permissions #################### |
306 | @@ -86,47 +57,17 @@ |
307 | mkdir -p /var/lib/maas/media/storage |
308 | chown -R maas:maas /var/lib/maas/ |
309 | |
310 | - # Config will contain credentials, so should be readable |
311 | - # by the application but nobody else. |
312 | - chown root:maas /etc/maas/maas_local_settings.py |
313 | - chmod 0640 /etc/maas/maas_local_settings.py |
314 | - |
315 | ######################################################### |
316 | ################ Configure Apache2 #################### |
317 | ######################################################### |
318 | configure_region_http |
319 | |
320 | ######################################################### |
321 | - ########## Configure DEFAULT_MAAS_URL ################# |
322 | - ######################################################### |
323 | - |
324 | - # Obtain IP address of default route and change DEFAULT_MAAS_URL |
325 | - # if default-maas-url has not been preseeded. |
326 | - db_get maas/default-maas-url |
327 | - ipaddr="$RET" |
328 | - if [ -z "$RET" ]; then |
329 | - ipaddr=$(get_default_route_ip) |
330 | - fi |
331 | - # Set the IP address of the interface with default route |
332 | - if [ -n "$ipaddr" ]; then |
333 | - configure_maas_default_url "$ipaddr" |
334 | - db_set maas/default-maas-url "$ipaddr" |
335 | - fi |
336 | - |
337 | - ######################################################### |
338 | ################ Configure Logging #################### |
339 | ######################################################### |
340 | configure_logging |
341 | configure_third_party_log_symlinks |
342 | |
343 | -elif [ -n "$DEBCONF_RECONFIGURE" ]; then |
344 | - # Set the IP address of the interface with default route |
345 | - db_get maas/default-maas-url |
346 | - ipaddr="$RET" |
347 | - if [ -n "$ipaddr" ]; then |
348 | - configure_maas_default_url "$ipaddr" |
349 | - fi |
350 | - |
351 | elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then |
352 | # Logging changed at r2611, ensure it is set up. |
353 | configure_logging |
354 | @@ -138,10 +79,6 @@ |
355 | # make sure maas http config is symlinked |
356 | configure_region_http |
357 | |
358 | - # we need to regenerate the passwords and update configs. |
359 | - db_get maas/default-maas-url |
360 | - ipaddr="$RET" |
361 | - configure_maas_default_url "$ipaddr" |
362 | fi |
363 | |
364 | invoke-rc.d apache2 restart || true |
365 | |
366 | === modified file 'debian/maas-region-controller.config' |
367 | --- debian/maas-region-controller.config 2013-03-20 16:44:30 +0000 |
368 | +++ debian/maas-region-controller.config 2015-04-22 01:44:57 +0000 |
369 | @@ -37,7 +37,7 @@ |
370 | elif [ -n "$DEBCONF_RECONFIGURE" ]; then |
371 | db_get maas/default-maas-url || true |
372 | if [ -z "$RET" ]; then |
373 | - ipaddr=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"/")} END{print array[3] }' /etc/maas/maas_local_settings.py) |
374 | + ipaddr=$(awk '$1 == "maas_url:" { split($0,array,"/")} END{print array[3] }' /etc/maas/regiond.conf) |
375 | db_set maas/default-maas-url "$ipaddr" |
376 | fi |
377 | db_input low maas/default-maas-url || true |
378 | |
379 | === modified file 'debian/maas-region-controller.postinst' |
380 | --- debian/maas-region-controller.postinst 2015-04-08 22:14:39 +0000 |
381 | +++ debian/maas-region-controller.postinst 2015-04-22 01:44:57 +0000 |
382 | @@ -23,19 +23,12 @@ |
383 | |
384 | configure_maas_database() { |
385 | local dbc_dbpass="$1" |
386 | - if grep -qs "^\ \{1,\} 'PASSWORD': '[a-zA-Z0-9]\{0,\}',$" /etc/maas/maas_local_settings.py; then |
387 | - sed -i "s/^\ \{1,\} 'PASSWORD': '[a-zA-Z0-9]\{0,\}',$/ 'PASSWORD': '"$dbc_dbpass"',/" \ |
388 | - /etc/maas/maas_local_settings.py |
389 | - fi |
390 | + maas-region-admin config --dbpassword "$dbc_dbpass" |
391 | } |
392 | |
393 | configure_maas_default_url() { |
394 | local ipaddr="$1" |
395 | - |
396 | - if grep -qs "^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$" /etc/maas/maas_local_settings.py; then |
397 | - sed -i "s/^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$/DEFAULT_MAAS_URL = \"http:\/\/"$ipaddr"\/MAAS\"/" \ |
398 | - /etc/maas/maas_local_settings.py |
399 | - fi |
400 | + maas-region-admin config --default-url "http://${ipaddr}/MAAS" |
401 | } |
402 | |
403 | get_default_route_ip() { |
404 | @@ -57,11 +50,6 @@ |
405 | mkdir -p /var/lib/maas/media/storage |
406 | chown -R maas:maas /var/lib/maas/ |
407 | |
408 | - # Config will contain credentials, so should be readable |
409 | - # by the application but nobody else. |
410 | - chown root:maas /etc/maas/maas_local_settings.py |
411 | - chmod 0640 /etc/maas/maas_local_settings.py |
412 | - |
413 | ######################################################### |
414 | ########## Configure DEFAULT_MAAS_URL ################# |
415 | ######################################################### |
416 | @@ -89,7 +77,8 @@ |
417 | |
418 | # Create the database |
419 | dbc_go maas-region-controller $@ |
420 | - configure_maas_database "$dbc_dbpass" |
421 | + maas-region-admin config --dbhost "localhost" --dbname "$dbc_dbname" \ |
422 | + --dbuser "$dbc_dbuser" --dbpassword "$dbc_dbpass" |
423 | |
424 | # Only syncdb if we have selected to install it with dbconfig-common. |
425 | db_get maas-region-controller/dbconfig-install |
426 | @@ -116,20 +105,30 @@ |
427 | # make sure postgresql is running |
428 | restart_postgresql |
429 | |
430 | - # we need to regenerate the passwords and update configs. |
431 | - db_get maas/default-maas-url |
432 | - ipaddr="$RET" |
433 | - configure_maas_default_url "$ipaddr" |
434 | - # handle database upgrade |
435 | - if [ -f /etc/dbconfig-common/maas-region-controller.conf ]; then |
436 | - # source dbconfig-common db config for maas-region-controller |
437 | - # before upgrading database, otherwise a new config is written |
438 | - # but the password is no longer preserved. |
439 | - . /etc/dbconfig-common/maas-region-controller.conf |
440 | - else |
441 | - dbc_go maas-region-controller $@ |
442 | + # If the version we are upgrading from ("$2") is less than 1.8.0~alpha10+bzr3754-0ubuntu1 |
443 | + # then we need migrate to new config file. |
444 | + # TODO, we need to update this to the appropriate version |
445 | + if dpkg --compare-versions "$2" lt 1.8.0~alpha10+bzr3754-0ubuntu1 && [ -f /etc/maas/maas_local_settings.py ]; then |
446 | + # we need to regenerate the passwords and update configs. |
447 | + db_get maas/default-maas-url |
448 | + ipaddr="$RET" |
449 | + configure_maas_default_url "$ipaddr" |
450 | + # handle database upgrade |
451 | + if [ -f /etc/dbconfig-common/maas-region-controller.conf ]; then |
452 | + # source dbconfig-common db config for maas-region-controller |
453 | + # before upgrading database, otherwise a new config is written |
454 | + # but the password is no longer preserved. |
455 | + . /etc/dbconfig-common/maas-region-controller.conf |
456 | + else |
457 | + dbc_go maas-region-controller $@ |
458 | + fi |
459 | + |
460 | + # Reconfigure the config file. |
461 | + maas-region-admin config --dbhost "localhost" --dbname "$dbc_dbname" \ |
462 | + --dbuser "$dbc_dbuser" --dbpassword "$dbc_dbpass" |
463 | + |
464 | + mv /etc/maas/maas_local_settings.py /etc/maas/maas_local_settings.py.maas-old |
465 | fi |
466 | - configure_maas_database "$dbc_dbpass" |
467 | |
468 | maas_sync_migrate_db |
469 | |
470 | |
471 | === removed file 'debian/patches/01-fix-database-settings.patch' |
472 | --- debian/patches/01-fix-database-settings.patch 2015-01-23 14:56:56 +0000 |
473 | +++ debian/patches/01-fix-database-settings.patch 1970-01-01 00:00:00 +0000 |
474 | @@ -1,17 +0,0 @@ |
475 | -Index: maas-1.8.0~alpha1+bzr3486.orig/contrib/maas_local_settings.py |
476 | -=================================================================== |
477 | ---- maas-1.8.0~alpha1+bzr3486.orig.orig/contrib/maas_local_settings.py 2015-01-23 09:50:03.185579822 -0500 |
478 | -+++ maas-1.8.0~alpha1+bzr3486.orig/contrib/maas_local_settings.py 2015-01-23 09:50:03.181579822 -0500 |
479 | -@@ -14,9 +14,9 @@ |
480 | - 'default': { |
481 | - # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' etc. |
482 | - 'ENGINE': 'django.db.backends.postgresql_psycopg2', |
483 | -- 'NAME': '', |
484 | -- 'USER': '', |
485 | -- 'PASSWORD': '', |
486 | -+ 'NAME': 'maasdb', |
487 | -+ 'USER': 'maas', |
488 | -+ 'PASSWORD': 'maas', |
489 | - 'HOST': 'localhost', |
490 | - } |
491 | - } |
492 | |
493 | === removed file 'debian/patches/02-pserv-config.patch' |
494 | --- debian/patches/02-pserv-config.patch 2015-02-18 04:09:08 +0000 |
495 | +++ debian/patches/02-pserv-config.patch 1970-01-01 00:00:00 +0000 |
496 | @@ -1,19 +0,0 @@ |
497 | -Description: Use default settings for MAAS PSERV |
498 | - Use default settings for MAAS pserv. These default settings |
499 | - include port, logfile, oops directory, cobbler url and username |
500 | -Author: Andres Rodriguez <andreserl@ubuntu.com> |
501 | - |
502 | -=== modified file 'etc/maas/pserv.yaml' |
503 | -Index: maas-1.8.0~alpha1+bzr3523.orig/etc/maas/pserv.yaml |
504 | -=================================================================== |
505 | ---- maas-1.8.0~alpha1+bzr3523.orig.orig/etc/maas/pserv.yaml 2015-02-17 22:25:42.304015180 -0500 |
506 | -+++ maas-1.8.0~alpha1+bzr3523.orig/etc/maas/pserv.yaml 2015-02-17 22:25:42.300015180 -0500 |
507 | -@@ -18,8 +18,6 @@ |
508 | - # resource_root: /var/lib/maas/boot-resources/current/ |
509 | - |
510 | - # port: 69 |
511 | -- port: 5244 |
512 | - ## The URL to be contacted to generate PXE configurations. |
513 | - # generator: http://localhost/MAAS/api/1.0/pxeconfig/ |
514 | -- generator: http://localhost:5240/api/1.0/pxeconfig/ |
515 | - |
516 | |
517 | === modified file 'debian/patches/series' |
518 | --- debian/patches/series 2014-12-05 15:21:37 +0000 |
519 | +++ debian/patches/series 2015-04-22 01:44:57 +0000 |
520 | @@ -1,2 +0,0 @@ |
521 | -01-fix-database-settings.patch |
522 | -02-pserv-config.patch |