From 21bb3bac568e29e63ef0ecb217c1168863fc5460 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Fri, 15 Jun 2018 14:08:19 -0500 Subject: [PATCH] Make BIND /var dir persistent BIND stores dynamically created zones in /var/named by default, which means that this directory needs to be persistent across container restarts. However, we can't just bind mount /var/named into the container because /var/named is empty on the host, but in the container the BIND package populates some necessary initial files in it. To address this, we can point BIND at /var/named-persistent and copy all of the initial config from /var/named at container start, just like we do for other configs. Change-Id: Ic17fb812468f2eb66d9c348b51dfa73a1f216a70 --- docker/services/designate-worker.yaml | 11 ++++++++++- puppet/services/designate-worker.yaml | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docker/services/designate-worker.yaml b/docker/services/designate-worker.yaml index 3ec66bffed..e342a7b17a 100644 --- a/docker/services/designate-worker.yaml +++ b/docker/services/designate-worker.yaml @@ -113,11 +113,15 @@ outputs: dest: "/" merge: true preserve_properties: true + - source: "/var/named/*" + dest: "/var/named-persistent/" + merge: true + preserve_properties: true permissions: - path: /var/log/designate owner: designate:designate recurse: true - - path: /var/named + - path: /var/named-persistent owner: root:named perm: '0770' docker_config: @@ -152,6 +156,7 @@ outputs: - /var/lib/kolla/config_files/designate_backend_bind9.json:/var/lib/kolla/config_files/config.json:ro - /var/lib/config-data/puppet-generated/designate/:/var/lib/kolla/config_files/src:ro - /var/log/containers/designate:/var/log/designate + - /var/named-persistent:/var/named-persistent environment: - KOLLA_CONFIG_STRATEGY=COPY_ALWAYS host_prep_tasks: @@ -166,3 +171,7 @@ outputs: Log files from designate containers can be found under /var/log/containers/designate. ignore_errors: true + - name: create persistent named directory + file: + path: /var/named-persistent + state: directory diff --git a/puppet/services/designate-worker.yaml b/puppet/services/designate-worker.yaml index c76f0abb0d..db96ca22c6 100644 --- a/puppet/services/designate-worker.yaml +++ b/puppet/services/designate-worker.yaml @@ -69,6 +69,7 @@ outputs: map_merge: - get_attr: [DesignateBase, role_data, config_settings] - designate::worker::worker_notify: true + dns::vardir: /var/named-persistent dns::additional_options: listen-on: str_replace: