From 4f78fa96565364950e5b876f75cb8a40acb8aea8 Mon Sep 17 00:00:00 2001 From: Stefan Haun Date: Wed, 29 Jun 2022 00:15:43 +0200 Subject: [PATCH] Introduce a data_dir variable for pottwal 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. --- pottwal.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pottwal.yml b/pottwal.yml index 45406d7..c6cc998 100644 --- a/pottwal.yml +++ b/pottwal.yml @@ -5,8 +5,11 @@ vars: ansible_python_interpreter: /usr/bin/python3 + data_dir: "/srv/data" + + openhab_image: openhab/openhab:2.5.11 - openhab_data: /srv/data/openhab + openhab_data: "{{ data_dir }}/openhab" openhab_host_port: 8081 openhab_configuration_source: https://github.com/netz39/n39-openhab.git openhab_configuration_version: master @@ -30,7 +33,7 @@ - name: Check if gitea data dir exists ansible.builtin.stat: - path: "/srv/data/gitea" + path: "{{ data_dir }}/gitea" register: gitea_dir - name: Fail if gitea data dir does not exist ansible.builtin.fail: @@ -62,7 +65,7 @@ USER_UID=1000 USER_GID=1000 volumes: - - "/srv/data/gitea:/data:rw" + - "{{ data_dir }}/gitea:/data:rw" - name: Setup proxy site gitea.n39.eu include_role: @@ -187,7 +190,7 @@ - name: Check if hedgedoc data dir exists ansible.builtin.stat: - path: "/srv/data/hedgedoc" + path: "{{ data_dir }}/hedgedoc" register: hedgedoc_dir - name: Fail if hedgedoc data dir does not exist ansible.builtin.fail: @@ -199,8 +202,8 @@ path: "{{ item }}" state: directory with_items: - - "/srv/data/hedgedoc/data/database" - - "/srv/data/hedgedoc/data/uploads" + - "{{ data_dir }}/hedgedoc/data/database" + - "{{ data_dir }}/hedgedoc/data/uploads" - name: Setup docker network docker_network: @@ -221,7 +224,7 @@ POSTGRES_PASSWORD: "{{ hedgedoc_postgres_password }}" POSTGRES_DB: "hedgedoc" volumes: - - "/srv/data/hedgedoc/data/database:/var/lib/postgresql/data" + - "{{ data_dir }}/hedgedoc/data/database:/var/lib/postgresql/data" networks: - name: hedgedocnet @@ -247,7 +250,7 @@ CMD_DB_USERNAME: "hedgedoc" CMD_DB_PASSWORD: "{{ hedgedoc_postgres_password }}" volumes: - - /srv/data/hedgedoc/data/uploads:/hedgedoc/public/uploads + - "{{ data_dir }}/hedgedoc/data/uploads:/hedgedoc/public/uploads" networks: - name: hedgedocnet