Browse Source

Fix designate container

Fix designate-backend-bind9 image.
Create designate-worker image.
Create sudoers file to execute designate-rootwrap
command.

Closes-Bug: #1651524
Change-Id: I06de60a35bc2c046bbdf4f43df8bd7b4a98de34a
tags/4.0.0.0b3
Eduardo Gonzalez 2 years ago
parent
commit
48675e52cc

+ 0
- 1
docker/designate/designate-api/Dockerfile.j2 View File

@@ -16,6 +16,5 @@ MAINTAINER {{ maintainer }}
16 16
 
17 17
 {% block designate_api_footer %}{% endblock %}
18 18
 {% block footer %}{% endblock %}
19
-{{ include_footer }}
20 19
 
21 20
 USER designate

+ 6
- 5
docker/designate/designate-backend-bind9/Dockerfile.j2 View File

@@ -9,8 +9,6 @@ MAINTAINER {{ maintainer }}
9 9
    {% set designate_backend_bind9_packages = ['bind'] %}
10 10
 
11 11
 {{ macros.install_packages(designate_backend_bind9_packages | customizable("packages")) }}
12
-RUN mkdir -p /var/lib/kolla/ \
13
-    && cp -pr /var/named /var/lib/kolla/var-named
14 12
 
15 13
 {% elif base_distro in ['ubuntu'] %}
16 14
    {% set designate_backend_bind9_packages = ['bind9'] %}
@@ -19,8 +17,11 @@ RUN mkdir -p /var/lib/kolla/ \
19 17
 
20 18
 {% endif %}
21 19
 
20
+{% set designate_backend_bind_name = 'bind' if base_distro in ['ubuntu', 'debian'] else 'named' %}
21
+
22
+RUN mkdir -p /var/lib/kolla/ /var/lib/{{ designate_backend_bind_name }}/ /run/{{ designate_backend_bind_name }} \
23
+     && chown -R root: /var/lib/{{ designate_backend_bind_name }} /run/{{ designate_backend_bind_name }} \
24
+     && chmod 755 /run/{{ designate_backend_bind_name }} \
25
+
22 26
 {% block designate_backend_bind9_footer %}{% endblock %}
23 27
 {% block footer %}{% endblock %}
24
-{{ include_footer }}
25
-
26
-USER designate

+ 6
- 4
docker/designate/designate-base/Dockerfile.j2 View File

@@ -48,12 +48,14 @@ RUN ln -s designate-base-source/* designate \
48 48
     && sed -i 's|^exec_dirs.*|exec_dirs=/var/lib/kolla/venv/bin,/sbin,/usr/sbin,/bin,/usr/bin,/usr/local/bin,/usr/local/sbin|g' /etc/designate/rootwrap.conf
49 49
 {% endif %}
50 50
 
51
+COPY designate_sudoers /etc/sudoers.d/kolla_designate_sudoers
51 52
 COPY extend_start.sh /usr/local/bin/kolla_extend_start
52
-RUN touch /usr/local/bin/kolla_designate_extend_start \
53
+
54
+RUN usermod -a -G kolla designate \
55
+    && chmod 750 /etc/sudoers.d \
56
+    && chmod 640 /etc/sudoers.d/kolla_designate_sudoers \
57
+    && touch /usr/local/bin/kolla_designate_extend_start \
53 58
     && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_designate_extend_start
54 59
 
55 60
 {% block designate_base_footer %}{% endblock %}
56 61
 {% block footer %}{% endblock %}
57
-{{ include_footer }}
58
-
59
-RUN usermod -a -G kolla designate

+ 1
- 0
docker/designate/designate-base/designate_sudoers View File

@@ -0,0 +1 @@
1
+%kolla ALL=(root) NOPASSWD: /var/lib/kolla/venv/bin/designate-rootwrap /etc/designate/rootwrap.conf *

+ 0
- 1
docker/designate/designate-central/Dockerfile.j2 View File

@@ -19,6 +19,5 @@ RUN chmod 755 /usr/local/bin/kolla_designate_extend_start
19 19
 
20 20
 {% block designate_central_footer %}{% endblock %}
21 21
 {% block footer %}{% endblock %}
22
-{{ include_footer }}
23 22
 
24 23
 USER designate

+ 0
- 1
docker/designate/designate-mdns/Dockerfile.j2 View File

@@ -16,6 +16,5 @@ MAINTAINER {{ maintainer }}
16 16
 
17 17
 {% block designate_mdns_footer %}{% endblock %}
18 18
 {% block footer %}{% endblock %}
19
-{{ include_footer }}
20 19
 
21 20
 USER designate

+ 0
- 1
docker/designate/designate-pool-manager/Dockerfile.j2 View File

@@ -33,6 +33,5 @@ MAINTAINER {{ maintainer }}
33 33
 
34 34
 {% block designate_pool_manager_footer %}{% endblock %}
35 35
 {% block footer %}{% endblock %}
36
-{{ include_footer }}
37 36
 
38 37
 USER designate

+ 0
- 1
docker/designate/designate-sink/Dockerfile.j2 View File

@@ -22,6 +22,5 @@ MAINTAINER {{ maintainer }}
22 22
 
23 23
 {% block designate_sink_footer %}{% endblock %}
24 24
 {% block footer %}{% endblock %}
25
-{{ include_footer }}
26 25
 
27 26
 USER designate

+ 37
- 0
docker/designate/designate-worker/Dockerfile.j2 View File

@@ -0,0 +1,37 @@
1
+FROM {{ namespace }}/{{ image_prefix }}designate-base:{{ tag }}
2
+MAINTAINER {{ maintainer }}
3
+
4
+{% block designate_worker_header %}{% endblock %}
5
+
6
+{% import "macros.j2" as macros with context %}
7
+
8
+# The bind9 package here is only to provide the rndc binary.
9
+{% if install_type == 'binary' %}
10
+    {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
11
+       {% set designate_worker_packages = [
12
+            'bind',
13
+            'openstack-designate-worker'
14
+        ] %}
15
+    {% elif base_distro in ['ubuntu'] %}
16
+       {% set designate_worker_packages = [
17
+            'bind9',
18
+            'designate-worker'
19
+        ] %}
20
+    {% endif %}
21
+{% elif install_type == 'source' %}
22
+    {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
23
+       {% set designate_worker_packages = [
24
+            'bind'
25
+        ] %}
26
+    {% elif base_distro in ['ubuntu'] %}
27
+       {% set designate_worker_packages = [
28
+            'bind9'
29
+        ] %}
30
+    {% endif %}
31
+{% endif %}
32
+{{ macros.install_packages(designate_worker_packages | customizable("packages")) }}
33
+
34
+{% block designate_worker_footer %}{% endblock %}
35
+{% block footer %}{% endblock %}
36
+
37
+USER designate

Loading…
Cancel
Save