Merge ~andreserl/maas:lp1513775_fix_named_init_config_packaging into maas:master

Proposed by Andres Rodriguez
Status: Merged
Approved by: Andres Rodriguez
Approved revision: 9860f0c79cccedded8e9edd1de5add9aabfd0cca
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~andreserl/maas:lp1513775_fix_named_init_config_packaging
Merge into: maas:master
Diff against target: 177 lines (+79/-15)
4 files modified
debian/control (+14/-14)
debian/maas-region-api.dirs (+1/-0)
debian/maas-region-api.postinst (+46/-1)
debian/maas-region-api.postrm (+18/-0)
Reviewer Review Type Date Requested Status
Newell Jensen (community) Approve
MAAS Lander Approve
Review via email: mp+342371@code.launchpad.net

Commit message

LP: #1513775 - Merge maas-dns into maas-region-api

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp1513775_fix_named_init_config_packaging lp:~andreserl/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: e52ca12700f9c8a4cbf72a90b8f12f4e0341dbaa

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b lp1513775_fix_named_init_config_packaging lp:~andreserl/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: SUCCESS
COMMIT: 296322cf549f2880941503663c42a6d2b5c88e81

review: Approve
Revision history for this message
Newell Jensen (newell-jensen) wrote :

+1

review: Approve
Revision history for this message
Mike Pontillo (mpontillo) wrote :

Looks reasonable to me; just a couple questions below.

Revision history for this message
MAAS Lander (maas-lander) wrote :

LANDING
-b lp1513775_fix_named_init_config_packaging lp:~andreserl/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED BUILD
LOG: http://maas-ci-jenkins.internal:8080/job/maas/job/branch-tester/2235/consoleText

Revision history for this message
MAAS Lander (maas-lander) wrote :

LANDING
-b lp1513775_fix_named_init_config_packaging lp:~andreserl/maas/+git/maas into -b master lp:~maas-committers/maas

STATUS: FAILED BUILD
LOG: http://maas-ci-jenkins.internal:8080/job/maas/job/branch-tester/2238/consoleText

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/control b/debian/control
index 5281720..a68a402 100644
--- a/debian/control
+++ b/debian/control
@@ -67,7 +67,8 @@ Description: MAAS server common files
6767
68Package: maas-region-api68Package: maas-region-api
69Architecture: all69Architecture: all
70Depends: bind9utils,70Depends: bind9 (>= 1:9.10.3.dfsg.P2-5~),
71 bind9utils,
71 iproute2,72 iproute2,
72 libjs-angularjs,73 libjs-angularjs,
73 libjs-yui3-full,74 libjs-yui3-full,
@@ -88,9 +89,9 @@ Depends: bind9utils,
88 ubuntu-keyring,89 ubuntu-keyring,
89 ${misc:Depends},90 ${misc:Depends},
90 ${python3:Depends}91 ${python3:Depends}
91Conflicts: maas-region-controller-min, ntp92Conflicts: maas-region-controller-min, maas-dns, ntp
92Replaces: maas-region-controller-min93Replaces: maas-region-controller-min, maas-dns
93Provides: maas-region-controller-min94Provides: maas-region-controller-min, maas-dns
94Description: Region controller API service for MAAS95Description: Region controller API service for MAAS
95 The MAAS region controller consists of REST API services and a postgres96 The MAAS region controller consists of REST API services and a postgres
96 database. This package installs only the API services (maas-regiond).97 database. This package installs only the API services (maas-regiond).
@@ -101,7 +102,6 @@ Architecture: all
101Depends: avahi-utils,102Depends: avahi-utils,
102 dbconfig-pgsql,103 dbconfig-pgsql,
103 iputils-ping,104 iputils-ping,
104 maas-dns (= ${binary:Version}),
105 maas-region-api (= ${binary:Version}),105 maas-region-api (= ${binary:Version}),
106 postgresql (>= 9.1),106 postgresql (>= 9.1),
107 tcpdump,107 tcpdump,
@@ -275,15 +275,15 @@ Description: MAAS DHCP server
275 This package installs and configures a DHCP server that can be used by275 This package installs and configures a DHCP server that can be used by
276 MAAS, and enhances the overall MAAS user experience.276 MAAS, and enhances the overall MAAS user experience.
277277
278Package: maas-dns278#Package: maas-dns
279Architecture: all279#Architecture: all
280Depends: bind9 (>= 1:9.10.3.dfsg.P2-5~),280#Depends: bind9 (>= 1:9.10.3.dfsg.P2-5~),
281 maas-region-api (= ${binary:Version}),281# maas-region-api (= ${binary:Version}),
282 ${misc:Depends}282# ${misc:Depends}
283Conflicts: dnsmasq283#Conflicts: dnsmasq
284Description: MAAS DNS server284#Description: MAAS DNS server
285 This package installs and configures a DNS server that can be used by285# This package installs and configures a DNS server that can be used by
286 MAAS, and enhances the overall MAAS user experience.286# MAAS, and enhances the overall MAAS user experience.
287287
288Package: maas-proxy288Package: maas-proxy
289Architecture: all289Architecture: all
diff --git a/debian/maas-region-api.dirs b/debian/maas-region-api.dirs
290new file mode 100644290new file mode 100644
index 0000000..f49acc7
--- /dev/null
+++ b/debian/maas-region-api.dirs
@@ -0,0 +1 @@
1etc/bind/maas
diff --git a/debian/maas-region-api.postinst b/debian/maas-region-api.postinst
index 7e512c4..1f396d7 100644
--- a/debian/maas-region-api.postinst
+++ b/debian/maas-region-api.postinst
@@ -37,6 +37,40 @@ configure_libdir() {
37 fi37 fi
38}38}
3939
40edit_named_options() {
41 # Remove any existing MAAS-related include line from
42 # /etc/bind/named.conf.local, then re-add it.
43 sed -i '/^include\s.*maas/d' /etc/bind/named.conf.local
44 maas-region get_named_conf --edit --config_path /etc/bind/named.conf.local
45
46 # Add a line in /etc/bind/named.conf.options that includes the
47 # /etc/named/maas/named.conf.options.inside.maas file.
48 maas-region edit_named_options --config-path /etc/bind/named.conf.options
49}
50
51fix_dns_permissions() {
52 if [ -d /etc/bind/maas ]; then
53 chown maas:root /etc/bind/maas
54 chown -R maas:maas /etc/bind/maas/*
55 fi
56 if [ -f /etc/bind/maas/named.conf.maas ]; then
57 chown maas:maas /etc/bind/maas/named.conf.maas
58 chmod 644 /etc/bind/maas/named.conf.maas
59 fi
60 if [ -f /etc/bind/maas/named.conf.options.inside.maas ]; then
61 chown maas:maas /etc/bind/maas/named.conf.options.inside.maas
62 chmod 644 /etc/bind/maas/named.conf.options.inside.maas
63 fi
64 if [ -f /etc/bind/maas/rndc.conf.maas ]; then
65 chown maas:root /etc/bind/maas/rndc.conf.maas
66 chmod 600 /etc/bind/maas/rndc.conf.maas
67 fi
68 if [ -f /etc/bind/maas/named.conf.rndc.maas ]; then
69 chown maas:bind /etc/bind/maas/named.conf.rndc.maas
70 chmod 640 /etc/bind/maas/named.conf.rndc.maas
71 fi
72}
73
40# Unconditionally ensure that there is at least an empty configuration74# Unconditionally ensure that there is at least an empty configuration
41# file. This does *not* overwrite any existing configuration.75# file. This does *not* overwrite any existing configuration.
42maas-region local_config_set76maas-region local_config_set
@@ -44,14 +78,25 @@ maas-region local_config_set
44if [ "$1" = "configure" ] && [ -z "$2" ]; then78if [ "$1" = "configure" ] && [ -z "$2" ]; then
45 configure_logging79 configure_logging
46 configure_libdir80 configure_libdir
81 # Configure DNS
82 # If /etc/bind/maas is empty, set_up_dns.
83 if [ ! "$(ls -A /etc/bind/maas)" ]; then
84 maas-region set_up_dns
85 fi
86 fix_dns_permissions
87 edit_named_options
4788
48elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then89elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" gt 0.1+bzr266+dfsg-0ubuntu1; then
49 # Logging changed at r2611, ensure it is set up.90 # Logging changed at r2611, ensure it is set up.
50 configure_logging91 configure_logging
51 configure_libdir92 configure_libdir
5293 # Configure DNS
94 fix_dns_permissions
95 edit_named_options
53fi96fi
5497
98invoke-rc.d bind9 restart || true
99
55db_stop100db_stop
56101
57#DEBHELPER#102#DEBHELPER#
diff --git a/debian/maas-region-api.postrm b/debian/maas-region-api.postrm
index 9739968..c79533e 100644
--- a/debian/maas-region-api.postrm
+++ b/debian/maas-region-api.postrm
@@ -7,6 +7,14 @@ set -e
7RELEASE=`lsb_release -rs` || RELEASE=""7RELEASE=`lsb_release -rs` || RELEASE=""
88
9case "$1" in9case "$1" in
10 remove)
11 if [ -f /etc/bind/named.conf.local ]; then
12 sed -i '/^include.*\"\/etc\/bind\/maas\/named.conf.maas\"\;$/d' \
13 /etc/bind/named.conf.local
14 sed -i '/^include.*\"\/etc\/bind\/maas\/named.conf.options.inside.maas\"\;$/d' \
15 /etc/bind/named.conf.options
16 fi
17 ;;
10 purge)18 purge)
11 # Remove logging files & foldesr19 # Remove logging files & foldesr
12 rm -rf /var/log/maas/regiond.log*20 rm -rf /var/log/maas/regiond.log*
@@ -24,8 +32,18 @@ case "$1" in
24 rm -rf /usr/share/maas/maas/32 rm -rf /usr/share/maas/maas/
25 rm -rf /etc/maas/regiond.conf33 rm -rf /etc/maas/regiond.conf
26 rm -rf /etc/maas/templates.maas-old34 rm -rf /etc/maas/templates.maas-old
35
36 # Remove zone files
37 if [ -d /etc/bind/maas ]; then
38 rm -rf /etc/bind/maas
39 fi
40 ;;
27esac41esac
2842
43if [ -x /usr/sbin/invoke-rc.d ]; then
44 invoke-rc.d bind9 restart || true
45fi
46
29#DEBHELPER#47#DEBHELPER#
3048
31db_stop49db_stop

Subscribers

People subscribed via source and target branches