Merge lp:~andreserl/maas/packaging_clusterd_conf into lp:~maas-maintainers/maas/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
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.

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
=== modified file 'debian/maas-cluster-controller.config'
--- debian/maas-cluster-controller.config 2013-03-19 19:44:20 +0000
+++ debian/maas-cluster-controller.config 2015-04-22 01:44:57 +0000
@@ -12,8 +12,8 @@
12 db_get maas-cluster-controller/maas-url || true12 db_get maas-cluster-controller/maas-url || true
13 if [ -z "$RET" ]; then13 if [ -z "$RET" ]; then
14 # Attempt to pre-populate if installing on the region controller.14 # Attempt to pre-populate if installing on the region controller.
15 if [ -e /etc/maas/maas_local_settings.py ]; then15 if [ -e /etc/maas/regiond.conf ]; then
16 url=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"\"")} END{print array[2] }' /etc/maas/maas_local_settings.py)16 url=$(awk '$1 == "maas_url:" { split($0,array," ")} END{print array[2] }' /etc/maas/regiond.conf)
17 # If the URL doesn't end in /MAAS then add it. This helps upgrades from17 # If the URL doesn't end in /MAAS then add it. This helps upgrades from
18 # precise for which the URL didn't contain /MAAS, which is now required18 # precise for which the URL didn't contain /MAAS, which is now required
19 if ! echo $url | grep -qs "/MAAS$"; then19 if ! echo $url | grep -qs "/MAAS$"; then
@@ -22,7 +22,7 @@
22 db_set maas-cluster-controller/maas-url "$url"22 db_set maas-cluster-controller/maas-url "$url"
23 else23 else
24 # Will only get here if dbconf value not already set, or24 # Will only get here if dbconf value not already set, or
25 # /etc/maas/maas_local_settings.py doesn't exist.25 # /etc/maas/regiond.conf doesn't exist.
26 db_input medium maas-cluster-controller/maas-url || true26 db_input medium maas-cluster-controller/maas-url || true
27 db_go27 db_go
28 fi28 fi
2929
=== modified file 'debian/maas-cluster-controller.install'
--- debian/maas-cluster-controller.install 2015-03-25 16:35:38 +0000
+++ debian/maas-cluster-controller.install 2015-04-22 01:44:57 +0000
@@ -1,12 +1,6 @@
1# Install twisted plugins1# Install twisted plugins
2twisted/plugins/maasclusterd.py usr/share/pyshared/twisted/plugins2twisted/plugins/maasclusterd.py usr/share/pyshared/twisted/plugins
33
4# Install PSERV config file
5debian/tmp/etc/maas/pserv.yaml
6
7# Install cluster config file
8debian/tmp/etc/maas/maas_cluster.conf
9
10# Install templates4# Install templates
11debian/tmp/etc/maas/templates/dhcp5debian/tmp/etc/maas/templates/dhcp
12debian/tmp/etc/maas/templates/power6debian/tmp/etc/maas/templates/power
137
=== modified file 'debian/maas-cluster-controller.maas-clusterd.service'
--- debian/maas-cluster-controller.maas-clusterd.service 2015-03-17 20:12:30 +0000
+++ debian/maas-cluster-controller.maas-clusterd.service 2015-04-22 01:44:57 +0000
@@ -5,16 +5,15 @@
5ConditionPathExists=/etc/maas/maas_cluster.conf5ConditionPathExists=/etc/maas/maas_cluster.conf
6# This (pserv.yaml) will go away once streamline6# This (pserv.yaml) will go away once streamline
7# config files or move to sqlite.7# config files or move to sqlite.
8ConditionPathExists=/etc/maas/pserv.yaml8ConditionPathExists=/etc/maas/clusterd.conf
9ConditionPathExists=/var/lib/maas/secret9ConditionPathExists=/var/lib/maas/secret
1010
11[Service]11[Service]
12Restart=on-failure12Restart=on-failure
13EnvironmentFile=/etc/maas/maas_cluster.conf
14ExecStart=/bin/sh -ec '\13ExecStart=/bin/sh -ec '\
15 exec /usr/bin/authbind --deep /usr/bin/twistd \14 exec /usr/bin/authbind --deep /usr/bin/twistd \
16 --nodaemon --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid \15 --nodaemon --uid=maas --gid=maas --pidfile=/run/maas-cluster.pid \
17 maas-clusterd --config-file=/etc/maas/pserv.yaml > \16 maas-clusterd --config-file=/etc/maas/clusterd.conf > \
18 /var/log/maas/clusterd.log 2>&1'17 /var/log/maas/clusterd.log 2>&1'
1918
20[Install]19[Install]
2120
=== modified file 'debian/maas-cluster-controller.maas-clusterd.upstart'
--- debian/maas-cluster-controller.maas-clusterd.upstart 2015-01-23 14:56:56 +0000
+++ debian/maas-cluster-controller.maas-clusterd.upstart 2015-04-22 01:44:57 +0000
@@ -6,7 +6,7 @@
66
7respawn7respawn
88
9env CONFIG_FILE=/etc/maas/maas_cluster.conf9env CONFIG_FILE=/etc/maas/clusterd.conf
10env LOGFILE=/var/log/maas/clusterd.log10env LOGFILE=/var/log/maas/clusterd.log
1111
12pre-start script12pre-start script
1313
=== modified file 'debian/maas-cluster-controller.postinst'
--- debian/maas-cluster-controller.postinst 2015-03-17 17:15:56 +0000
+++ debian/maas-cluster-controller.postinst 2015-04-22 01:44:57 +0000
@@ -39,7 +39,8 @@
39extract_cluster_uuid(){39extract_cluster_uuid(){
40 # Extract ClUSTER_UUID setting from config file $1. This will work40 # Extract ClUSTER_UUID setting from config file $1. This will work
41 # the cluster config (which is shell).41 # the cluster config (which is shell).
42 sed -n -e "s/^CLUSTER_UUID *= *[\"']\([^\"']*\).*/\1/p" "$1"42 #awk '$1 == "cluster_uuid:" { split($0,array," ")} END{print array[2] }' "$1"
43 awk '{ split($1,array,"\"")} END{print array[2] }' "$1"
43}44}
4445
45configure_cluster_uuid(){46configure_cluster_uuid(){
@@ -48,23 +49,13 @@
48 # we want to generate one.49 # we want to generate one.
49 local uuid50 local uuid
5051
51 if [ -n "$(extract_cluster_uuid /etc/maas/maas_cluster.conf)" ]; then52 uuid=$(awk '$1 == "cluster_uuid:" { split($0,array," ")} END{print array[2] }' "/etc/maas/clusterd.conf")
53 if [ -n "$uuid" ]; then
52 # UUID is already set up. Wonderful.54 # UUID is already set up. Wonderful.
53 return55 return
54 else56 else
55 # No UUID at all yet. Generate one.57 # No UUID at all yet. Generate one.
56 uuid="$(uuidgen)"58 maas-provision config --init
57 fi
58
59 # Write the uuid to maas_cluster.conf
60 # There is no initial placeholder in this file, so just append the setting.
61 echo "CLUSTER_UUID=\"$uuid\"" >>/etc/maas/maas_cluster.conf
62}
63
64enable_apache_version_mod(){
65 COMMON_STATE=$(dpkg-query -f '${Status}' -W 'apache2.2-common' 2>/dev/null | awk '{print $3}' || true)
66 if [ "$COMMON_STATE" = "installed" ] || [ "$COMMON_STATE" = "unpacked" ] ; then
67 a2enmod version
68 fi59 fi
69}60}
7061
@@ -83,19 +74,11 @@
83 chmod 700 /etc/authbind/byuid/$MAAS_UID74 chmod 700 /etc/authbind/byuid/$MAAS_UID
84}75}
8576
86restart_apache2(){
87 if [ -x /usr/sbin/invoke-rc.d ]; then
88 invoke-rc.d apache2 restart || true
89 else
90 /etc/init.d/apache2 restart || true
91 fi
92}
93
94configure_maas_url(){77configure_maas_url(){
95 # Get the MAAS_URL on configure/reconfigure and write it to the conf files.78 # Get the MAAS_URL on configure/reconfigure and write it to the conf files.
96 db_get maas-cluster-controller/maas-url || true79 db_get maas-cluster-controller/maas-url || true
97 if [ -n "$RET" ]; then80 if [ -n "$RET" ]; then
98 maas-provision configure-maas-url "$RET"81 maas-provision config --region-url "$RET"
99 fi82 fi
100}83}
10184
@@ -108,36 +91,35 @@
108 fi91 fi
109}92}
11093
111
112if [ "$1" = "configure" ] && [ -z "$2" ]; then94if [ "$1" = "configure" ] && [ -z "$2" ]; then
113 create_log_dir95 create_log_dir
114 configure_maas_tgt96 configure_maas_tgt
115fi97 configure_maas_url
11698 configure_cluster_uuid
117if [ "$1" = "configure" ]; then99 configure_cluster_authbind
118 if dpkg --compare-versions "$2" lt 0.1+bzr1239+dfsg-0ubuntu1; then100 maas-provision upgrade-cluster
119 create_log_dir101
120 fi102elif [ -n "$DEBCONF_RECONFIGURE" ]; then
121
122 configure_maas_tgt
123 configure_maas_url103 configure_maas_url
124 # Only ask for a shared secret when the region is not installed104 # Only ask for a shared secret when the region is not installed
125 # on the same system.105 # on the same system.
126 if [ -n "$DEBCONF_RECONFIGURE" ] && [ ! -f /usr/sbin/maas-region-admin ]; then106 if [ ! -f /usr/sbin/maas-region-admin ]; then
127 db_input high maas-cluster-controller/shared-secret107 db_input high maas-cluster-controller/shared-secret
128 db_go108 db_go
129 fi109 fi
130 configure_shared_secret110 configure_shared_secret
131111
132 # This config file may contain a private cluster UUID. Only maas112elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
133 # can read it; only root can write it.113 # If we are upgrading from an older version, then we need
134 chown root:maas /etc/maas/maas_cluster.conf114 # to obtain the *old* CLUSTER UUID and set it.
135 chmod 0640 /etc/maas/maas_cluster.conf115 if [ -f /etc/maas/maas_cluster.conf ]; then
116 uuid=$(extract_cluster_uuid)
117 maas-provision config --uuid "$uuid"
118 mv /etc/maas/maas_cluster.conf /etc/maas/maas_cluster.conf.maas-old
119 mv /etc/maas/pserv.yaml /etc/maas/pserv.yaml.maas-old
120 fi
136121
137 configure_cluster_uuid
138 configure_cluster_authbind122 configure_cluster_authbind
139 enable_apache_version_mod
140 restart_apache2
141 maas-provision upgrade-cluster123 maas-provision upgrade-cluster
142fi124fi
143125
144126
=== modified file 'debian/maas-region-controller-min.apport'
--- debian/maas-region-controller-min.apport 2015-01-21 16:24:16 +0000
+++ debian/maas-region-controller-min.apport 2015-04-22 01:44:57 +0000
@@ -21,7 +21,7 @@
2121
22def add_info(report, ui):22def add_info(report, ui):
23 response = ui.yesno(23 response = ui.yesno(
24 "The contents of your /etc/maas/maas_local_settings.py, "24 "The contents of your /etc/maas/regiond.conf, "
25 "/etc/maas/pserv.yaml files may help developers diagnose your bug "25 "/etc/maas/pserv.yaml files may help developers diagnose your bug "
26 "more quickly. However, it may contain sensitive information. Do "26 "more quickly. However, it may contain sensitive information. Do "
27 "you want to include it in your bug report?")27 "you want to include it in your bug report?")
@@ -30,6 +30,8 @@
30 raise StopIteration30 raise StopIteration
31 elif response is True:31 elif response is True:
32 attach_conffiles(report, 'maas')32 attach_conffiles(report, 'maas')
33 attach_file_if_exists(
34 report, '/etc/maas/regiond.conf', 'MAASRegionConfig')
3335
34 # Attaching log files36 # Attaching log files
35 attach_file_if_exists(37 attach_file_if_exists(
3638
=== modified file 'debian/maas-region-controller-min.install'
--- debian/maas-region-controller-min.install 2014-11-05 16:38:22 +0000
+++ debian/maas-region-controller-min.install 2015-04-22 01:44:57 +0000
@@ -7,9 +7,6 @@
7# Install Apache Config7# Install Apache Config
8debian/tmp/etc/maas/maas-http.conf8debian/tmp/etc/maas/maas-http.conf
99
10# Install MAAS local settings
11debian/tmp/etc/maas/maas_local_settings.py
12
13# Install new preseed files10# Install new preseed files
14debian/tmp/etc/maas/preseeds11debian/tmp/etc/maas/preseeds
1512
1613
=== removed file 'debian/maas-region-controller-min.links'
--- debian/maas-region-controller-min.links 2014-09-25 20:19:36 +0000
+++ debian/maas-region-controller-min.links 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
1etc/maas/maas_local_settings.py usr/share/maas/maas_local_settings.py
20
=== modified file 'debian/maas-region-controller-min.maas-regiond.service'
--- debian/maas-region-controller-min.maas-regiond.service 2015-03-20 23:06:34 +0000
+++ debian/maas-region-controller-min.maas-regiond.service 2015-04-22 01:44:57 +0000
@@ -3,7 +3,7 @@
3Requires=network-online.target3Requires=network-online.target
4After=network-online.target4After=network-online.target
5# This will go away one we support new config files.5# This will go away one we support new config files.
6ConditionPathExists=/etc/maas/maas_local_settings.py6ConditionPathExists=/etc/maas/regiond.conf
77
8[Service]8[Service]
9Restart=on-failure9Restart=on-failure
1010
=== modified file 'debian/maas-region-controller-min.postinst'
--- debian/maas-region-controller-min.postinst 2015-02-11 14:22:53 +0000
+++ debian/maas-region-controller-min.postinst 2015-04-22 01:44:57 +0000
@@ -8,22 +8,12 @@
8RELEASE=`lsb_release -rs` || RELEASE=""8RELEASE=`lsb_release -rs` || RELEASE=""
99
10configure_region_http() {10configure_region_http() {
11 case $RELEASE in11 # handle apache configs
12 12.04|12.10|13.04)12 if [ -e /etc/maas/maas-http.conf -a \
13 # handle apache configs13 ! -e /etc/apache2/conf-enabled/maas-http.conf ]; then
14 if [ -e /etc/maas/maas-http.conf -a \14 ln -sf /etc/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf
15 ! -e /etc/apache2/conf.d/maas-http.conf ]; then15 fi
16 ln -sf /etc/maas/maas-http.conf /etc/apache2/conf.d/maas-http.conf16
17 fi
18 ;;
19 *)
20 # handle apache configs
21 if [ -e /etc/maas/maas-http.conf -a \
22 ! -e /etc/apache2/conf-enabled/maas-http.conf ]; then
23 ln -sf /etc/maas/maas-http.conf /etc/apache2/conf-enabled/maas-http.conf
24 fi
25 ;;
26 esac
27 # enable apache modules needed17 # enable apache modules needed
28 a2enmod proxy_http18 a2enmod proxy_http
29 a2enmod expires19 a2enmod expires
@@ -60,25 +50,6 @@
60 ln -sf /var/log/apache2 /var/log/maas/50 ln -sf /var/log/apache2 /var/log/maas/
61}51}
6252
63configure_maas_default_url() {
64 local ipaddr="$1"
65
66 if grep -qs "^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$" /etc/maas/maas_local_settings.py; then
67 sed -i "s/^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$/DEFAULT_MAAS_URL = \"http:\/\/$ipaddr\/MAAS\"/" /etc/maas/maas_local_settings.py
68 fi
69}
70
71get_default_route_ip() {
72 while read Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT; do
73 [ "$Mask" = "00000000" ] && break
74 done < /proc/net/route
75 interface="$Iface"
76 ipaddr=$(LC_ALL=C /sbin/ip -4 addr list dev "$interface" scope global)
77 ipaddr=${ipaddr#* inet }
78 ipaddr=${ipaddr%%/*}
79 echo $ipaddr
80}
81
82if [ "$1" = "configure" ] && [ -z "$2" ]; then53if [ "$1" = "configure" ] && [ -z "$2" ]; then
83 #########################################################54 #########################################################
84 ################ Folder Permissions ####################55 ################ Folder Permissions ####################
@@ -86,47 +57,17 @@
86 mkdir -p /var/lib/maas/media/storage57 mkdir -p /var/lib/maas/media/storage
87 chown -R maas:maas /var/lib/maas/58 chown -R maas:maas /var/lib/maas/
8859
89 # Config will contain credentials, so should be readable
90 # by the application but nobody else.
91 chown root:maas /etc/maas/maas_local_settings.py
92 chmod 0640 /etc/maas/maas_local_settings.py
93
94 #########################################################60 #########################################################
95 ################ Configure Apache2 ####################61 ################ Configure Apache2 ####################
96 #########################################################62 #########################################################
97 configure_region_http63 configure_region_http
9864
99 #########################################################65 #########################################################
100 ########## Configure DEFAULT_MAAS_URL #################
101 #########################################################
102
103 # Obtain IP address of default route and change DEFAULT_MAAS_URL
104 # if default-maas-url has not been preseeded.
105 db_get maas/default-maas-url
106 ipaddr="$RET"
107 if [ -z "$RET" ]; then
108 ipaddr=$(get_default_route_ip)
109 fi
110 # Set the IP address of the interface with default route
111 if [ -n "$ipaddr" ]; then
112 configure_maas_default_url "$ipaddr"
113 db_set maas/default-maas-url "$ipaddr"
114 fi
115
116 #########################################################
117 ################ Configure Logging ####################66 ################ Configure Logging ####################
118 #########################################################67 #########################################################
119 configure_logging68 configure_logging
120 configure_third_party_log_symlinks69 configure_third_party_log_symlinks
12170
122elif [ -n "$DEBCONF_RECONFIGURE" ]; then
123 # Set the IP address of the interface with default route
124 db_get maas/default-maas-url
125 ipaddr="$RET"
126 if [ -n "$ipaddr" ]; then
127 configure_maas_default_url "$ipaddr"
128 fi
129
130elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then71elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
131 # Logging changed at r2611, ensure it is set up.72 # Logging changed at r2611, ensure it is set up.
132 configure_logging73 configure_logging
@@ -138,10 +79,6 @@
138 # make sure maas http config is symlinked79 # make sure maas http config is symlinked
139 configure_region_http80 configure_region_http
14081
141 # we need to regenerate the passwords and update configs.
142 db_get maas/default-maas-url
143 ipaddr="$RET"
144 configure_maas_default_url "$ipaddr"
145fi82fi
14683
147invoke-rc.d apache2 restart || true84invoke-rc.d apache2 restart || true
14885
=== modified file 'debian/maas-region-controller.config'
--- debian/maas-region-controller.config 2013-03-20 16:44:30 +0000
+++ debian/maas-region-controller.config 2015-04-22 01:44:57 +0000
@@ -37,7 +37,7 @@
37elif [ -n "$DEBCONF_RECONFIGURE" ]; then37elif [ -n "$DEBCONF_RECONFIGURE" ]; then
38 db_get maas/default-maas-url || true38 db_get maas/default-maas-url || true
39 if [ -z "$RET" ]; then39 if [ -z "$RET" ]; then
40 ipaddr=$(awk '$1 == "DEFAULT_MAAS_URL" { split($0,array,"/")} END{print array[3] }' /etc/maas/maas_local_settings.py)40 ipaddr=$(awk '$1 == "maas_url:" { split($0,array,"/")} END{print array[3] }' /etc/maas/regiond.conf)
41 db_set maas/default-maas-url "$ipaddr"41 db_set maas/default-maas-url "$ipaddr"
42 fi42 fi
43 db_input low maas/default-maas-url || true43 db_input low maas/default-maas-url || true
4444
=== modified file 'debian/maas-region-controller.postinst'
--- debian/maas-region-controller.postinst 2015-04-08 22:14:39 +0000
+++ debian/maas-region-controller.postinst 2015-04-22 01:44:57 +0000
@@ -23,19 +23,12 @@
2323
24configure_maas_database() {24configure_maas_database() {
25 local dbc_dbpass="$1"25 local dbc_dbpass="$1"
26 if grep -qs "^\ \{1,\} 'PASSWORD': '[a-zA-Z0-9]\{0,\}',$" /etc/maas/maas_local_settings.py; then26 maas-region-admin config --dbpassword "$dbc_dbpass"
27 sed -i "s/^\ \{1,\} 'PASSWORD': '[a-zA-Z0-9]\{0,\}',$/ 'PASSWORD': '"$dbc_dbpass"',/" \
28 /etc/maas/maas_local_settings.py
29 fi
30}27}
3128
32configure_maas_default_url() {29configure_maas_default_url() {
33 local ipaddr="$1"30 local ipaddr="$1"
3431 maas-region-admin config --default-url "http://${ipaddr}/MAAS"
35 if grep -qs "^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$" /etc/maas/maas_local_settings.py; then
36 sed -i "s/^DEFAULT_MAAS_URL\ \= \"[a-zA-Z0-9:/.]\{0,\}\"$/DEFAULT_MAAS_URL = \"http:\/\/"$ipaddr"\/MAAS\"/" \
37 /etc/maas/maas_local_settings.py
38 fi
39}32}
4033
41get_default_route_ip() {34get_default_route_ip() {
@@ -57,11 +50,6 @@
57 mkdir -p /var/lib/maas/media/storage50 mkdir -p /var/lib/maas/media/storage
58 chown -R maas:maas /var/lib/maas/51 chown -R maas:maas /var/lib/maas/
5952
60 # Config will contain credentials, so should be readable
61 # by the application but nobody else.
62 chown root:maas /etc/maas/maas_local_settings.py
63 chmod 0640 /etc/maas/maas_local_settings.py
64
65 #########################################################53 #########################################################
66 ########## Configure DEFAULT_MAAS_URL #################54 ########## Configure DEFAULT_MAAS_URL #################
67 #########################################################55 #########################################################
@@ -89,7 +77,8 @@
8977
90 # Create the database78 # Create the database
91 dbc_go maas-region-controller $@79 dbc_go maas-region-controller $@
92 configure_maas_database "$dbc_dbpass"80 maas-region-admin config --dbhost "localhost" --dbname "$dbc_dbname" \
81 --dbuser "$dbc_dbuser" --dbpassword "$dbc_dbpass"
9382
94 # Only syncdb if we have selected to install it with dbconfig-common.83 # Only syncdb if we have selected to install it with dbconfig-common.
95 db_get maas-region-controller/dbconfig-install84 db_get maas-region-controller/dbconfig-install
@@ -116,20 +105,30 @@
116 # make sure postgresql is running105 # make sure postgresql is running
117 restart_postgresql106 restart_postgresql
118107
119 # we need to regenerate the passwords and update configs.108 # If the version we are upgrading from ("$2") is less than 1.8.0~alpha10+bzr3754-0ubuntu1
120 db_get maas/default-maas-url109 # then we need migrate to new config file.
121 ipaddr="$RET"110 # TODO, we need to update this to the appropriate version
122 configure_maas_default_url "$ipaddr"111 if dpkg --compare-versions "$2" lt 1.8.0~alpha10+bzr3754-0ubuntu1 && [ -f /etc/maas/maas_local_settings.py ]; then
123 # handle database upgrade112 # we need to regenerate the passwords and update configs.
124 if [ -f /etc/dbconfig-common/maas-region-controller.conf ]; then113 db_get maas/default-maas-url
125 # source dbconfig-common db config for maas-region-controller114 ipaddr="$RET"
126 # before upgrading database, otherwise a new config is written115 configure_maas_default_url "$ipaddr"
127 # but the password is no longer preserved.116 # handle database upgrade
128 . /etc/dbconfig-common/maas-region-controller.conf117 if [ -f /etc/dbconfig-common/maas-region-controller.conf ]; then
129 else118 # source dbconfig-common db config for maas-region-controller
130 dbc_go maas-region-controller $@119 # before upgrading database, otherwise a new config is written
120 # but the password is no longer preserved.
121 . /etc/dbconfig-common/maas-region-controller.conf
122 else
123 dbc_go maas-region-controller $@
124 fi
125
126 # Reconfigure the config file.
127 maas-region-admin config --dbhost "localhost" --dbname "$dbc_dbname" \
128 --dbuser "$dbc_dbuser" --dbpassword "$dbc_dbpass"
129
130 mv /etc/maas/maas_local_settings.py /etc/maas/maas_local_settings.py.maas-old
131 fi131 fi
132 configure_maas_database "$dbc_dbpass"
133132
134 maas_sync_migrate_db133 maas_sync_migrate_db
135134
136135
=== removed file 'debian/patches/01-fix-database-settings.patch'
--- debian/patches/01-fix-database-settings.patch 2015-01-23 14:56:56 +0000
+++ debian/patches/01-fix-database-settings.patch 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1Index: maas-1.8.0~alpha1+bzr3486.orig/contrib/maas_local_settings.py
2===================================================================
3--- maas-1.8.0~alpha1+bzr3486.orig.orig/contrib/maas_local_settings.py 2015-01-23 09:50:03.185579822 -0500
4+++ maas-1.8.0~alpha1+bzr3486.orig/contrib/maas_local_settings.py 2015-01-23 09:50:03.181579822 -0500
5@@ -14,9 +14,9 @@
6 'default': {
7 # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' etc.
8 'ENGINE': 'django.db.backends.postgresql_psycopg2',
9- 'NAME': '',
10- 'USER': '',
11- 'PASSWORD': '',
12+ 'NAME': 'maasdb',
13+ 'USER': 'maas',
14+ 'PASSWORD': 'maas',
15 'HOST': 'localhost',
16 }
17 }
180
=== removed file 'debian/patches/02-pserv-config.patch'
--- debian/patches/02-pserv-config.patch 2015-02-18 04:09:08 +0000
+++ debian/patches/02-pserv-config.patch 1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
1Description: Use default settings for MAAS PSERV
2 Use default settings for MAAS pserv. These default settings
3 include port, logfile, oops directory, cobbler url and username
4Author: Andres Rodriguez <andreserl@ubuntu.com>
5
6=== modified file 'etc/maas/pserv.yaml'
7Index: maas-1.8.0~alpha1+bzr3523.orig/etc/maas/pserv.yaml
8===================================================================
9--- maas-1.8.0~alpha1+bzr3523.orig.orig/etc/maas/pserv.yaml 2015-02-17 22:25:42.304015180 -0500
10+++ maas-1.8.0~alpha1+bzr3523.orig/etc/maas/pserv.yaml 2015-02-17 22:25:42.300015180 -0500
11@@ -18,8 +18,6 @@
12 # resource_root: /var/lib/maas/boot-resources/current/
13
14 # port: 69
15- port: 5244
16 ## The URL to be contacted to generate PXE configurations.
17 # generator: http://localhost/MAAS/api/1.0/pxeconfig/
18- generator: http://localhost:5240/api/1.0/pxeconfig/
19
200
=== modified file 'debian/patches/series'
--- debian/patches/series 2014-12-05 15:21:37 +0000
+++ debian/patches/series 2015-04-22 01:44:57 +0000
@@ -1,2 +0,0 @@
101-fix-database-settings.patch
202-pserv-config.patch

Subscribers

People subscribed via source and target branches

to all changes: