From db91a7afa5a96603d9d996d51e92607699a06779 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Wed, 29 Jun 2022 00:14:44 +0200 Subject: [PATCH] Introduce a data_dir variable for tau We've had too many confusions about the actual data directory and unfortunately there are also inconsistencies. So use the data_dir variable to mask host specific settings. --- tau.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tau.yml b/tau.yml index dcb374f..2faaaaa 100644 --- a/tau.yml +++ b/tau.yml @@ -5,6 +5,8 @@ vars: ansible_python_interpreter: /usr/bin/python3 + data_dir: "/srv/docker" + docker_registry_port: 5000 # this is the reg standard port docker_registry_domain: "docker.n39.eu" @@ -75,7 +77,7 @@ - name: Check if Docker Registry auth dir exists ansible.builtin.stat: - path: "/srv/docker/registry/auth" + path: "{{ data_dir }}/registry/auth" register: docker_dir - name: Fail if docker registry data dir does not exist ansible.builtin.fail: @@ -84,7 +86,7 @@ - name: Ensure the Docker Registry data directory exists # This may not be part of the backup file: - path: "/srv/docker/registry/data" + path: "{{ data_dir }}/registry/data" state: directory - name: Setup Docker Registry Container @@ -102,8 +104,8 @@ REGISTRY_AUTH_HTPASSWD_REALM: "Netz39 Docker Registry" REGISTRY_AUTH_HTPASSWD_PATH: "/auth/htpasswd" volumes: - - "/srv/docker/registry/data:/var/lib/registry:rw" - - "/srv/docker/registry/auth:/auth:rw" + - "{{ data_dir }}/registry/data:/var/lib/registry:rw" + - "{{ data_dir }}/registry/auth:/auth:rw" - name: Setup proxy site for the Docker Registry include_role: @@ -115,7 +117,7 @@ - name: Check if Dokuwiki data dir exists ansible.builtin.stat: - path: "/srv/docker/dokuwiki" + path: "{{ data_dir }}/dokuwiki" register: dokuwiki_dir - name: Fail if Dokuwiki data dir does not exist ansible.builtin.fail: @@ -124,7 +126,7 @@ - name: Set correct user for Dokuwiki data ansible.builtin.file: - path: "/srv/docker/dokuwiki" + path: "{{ data_dir }}/dokuwiki" owner: "1001" # According to container config recurse: yes @@ -141,7 +143,7 @@ # env: No env here, because we copy the data # and the container will never be created from scratch. volumes: - - "/srv/docker/dokuwiki:/bitnami/dokuwiki:rw" + - "{{ data_dir }}/dokuwiki:/bitnami/dokuwiki:rw" - name: Setup proxy site for Dokuwiki include_role: