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.
This commit is contained in:
Stefan Haun 2022-06-29 00:15:43 +02:00
parent db91a7afa5
commit 4f78fa9656

View file

@ -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