From 863b285b07fbc0c14e0b7627def15f9966548561 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 9 Jul 2023 20:27:32 +0200 Subject: [PATCH] Move files to their correct directories (files in files, Jinja2 templates in templates) --- .../deploy_entrypoint.sh} | 0 .../files/{configs => }/element/riot.im.conf | 0 .../{configs => }/mastodon/postgresql.conf | 0 .../log.config} | 0 .../conf.php} | 0 .../matrix/vhost-root => vhost/_root} | 0 .../matrix/vhost-element => vhost/cloud} | 0 .../nginx.conf => vhost/docker} | 0 .../nextcloud/vhost => vhost/element} | 0 .../matrix/vhost-matrix => vhost/matrix} | 0 .../mastodon/vhost-mastodon => vhost/social} | 0 .../files/{configs/vhost-www => vhost/www} | 0 roles/docker/handlers/main.yml | 1 - roles/docker/tasks/services/byro.yml | 2 +- .../docker/tasks/services/docker_registry.yml | 6 +++--- roles/docker/tasks/services/hedgedoc.yml | 6 +++--- roles/docker/tasks/services/mailu.yml | 2 +- roles/docker/tasks/services/mastodon.yml | 8 ++++---- .../docker/tasks/services/matrix_element.yml | 20 +++++++++---------- roles/docker/tasks/services/nextcloud.yml | 18 ++++++++--------- roles/docker/tasks/services/privatebin.yml | 4 ++-- roles/docker/tasks/services/rallly.yml | 4 ++-- .../tasks/services/websites/data.coop.yml | 4 ++-- .../element.config.json.j2} | 0 .../env_file.j2 => templates/mastodon.env.j2} | 0 .../matrix.homeserver.yaml.j2} | 0 .../env_file.j2 => templates/rallly.env.j2} | 0 27 files changed, 37 insertions(+), 38 deletions(-) rename roles/docker/files/{byro_deploy_entrypoint.sh => byro/deploy_entrypoint.sh} (100%) rename roles/docker/files/{configs => }/element/riot.im.conf (100%) rename roles/docker/files/{configs => }/mastodon/postgresql.conf (100%) rename roles/docker/files/{configs/matrix/matrix.data.coop.log.config => matrix/log.config} (100%) rename roles/docker/files/{configs/privatebin-conf.php => privatebin/conf.php} (100%) rename roles/docker/files/{configs/matrix/vhost-root => vhost/_root} (100%) rename roles/docker/files/{configs/matrix/vhost-element => vhost/cloud} (100%) rename roles/docker/files/{configs/docker_registry/nginx.conf => vhost/docker} (100%) rename roles/docker/files/{configs/nextcloud/vhost => vhost/element} (100%) rename roles/docker/files/{configs/matrix/vhost-matrix => vhost/matrix} (100%) rename roles/docker/files/{configs/mastodon/vhost-mastodon => vhost/social} (100%) rename roles/docker/files/{configs/vhost-www => vhost/www} (100%) rename roles/docker/{files/configs/element/config.json => templates/element.config.json.j2} (100%) rename roles/docker/{files/configs/mastodon/env_file.j2 => templates/mastodon.env.j2} (100%) rename roles/docker/{files/configs/matrix/homeserver.yaml.j2 => templates/matrix.homeserver.yaml.j2} (100%) rename roles/docker/{files/configs/rallly/env_file.j2 => templates/rallly.env.j2} (100%) diff --git a/roles/docker/files/byro_deploy_entrypoint.sh b/roles/docker/files/byro/deploy_entrypoint.sh similarity index 100% rename from roles/docker/files/byro_deploy_entrypoint.sh rename to roles/docker/files/byro/deploy_entrypoint.sh diff --git a/roles/docker/files/configs/element/riot.im.conf b/roles/docker/files/element/riot.im.conf similarity index 100% rename from roles/docker/files/configs/element/riot.im.conf rename to roles/docker/files/element/riot.im.conf diff --git a/roles/docker/files/configs/mastodon/postgresql.conf b/roles/docker/files/mastodon/postgresql.conf similarity index 100% rename from roles/docker/files/configs/mastodon/postgresql.conf rename to roles/docker/files/mastodon/postgresql.conf diff --git a/roles/docker/files/configs/matrix/matrix.data.coop.log.config b/roles/docker/files/matrix/log.config similarity index 100% rename from roles/docker/files/configs/matrix/matrix.data.coop.log.config rename to roles/docker/files/matrix/log.config diff --git a/roles/docker/files/configs/privatebin-conf.php b/roles/docker/files/privatebin/conf.php similarity index 100% rename from roles/docker/files/configs/privatebin-conf.php rename to roles/docker/files/privatebin/conf.php diff --git a/roles/docker/files/configs/matrix/vhost-root b/roles/docker/files/vhost/_root similarity index 100% rename from roles/docker/files/configs/matrix/vhost-root rename to roles/docker/files/vhost/_root diff --git a/roles/docker/files/configs/matrix/vhost-element b/roles/docker/files/vhost/cloud similarity index 100% rename from roles/docker/files/configs/matrix/vhost-element rename to roles/docker/files/vhost/cloud diff --git a/roles/docker/files/configs/docker_registry/nginx.conf b/roles/docker/files/vhost/docker similarity index 100% rename from roles/docker/files/configs/docker_registry/nginx.conf rename to roles/docker/files/vhost/docker diff --git a/roles/docker/files/configs/nextcloud/vhost b/roles/docker/files/vhost/element similarity index 100% rename from roles/docker/files/configs/nextcloud/vhost rename to roles/docker/files/vhost/element diff --git a/roles/docker/files/configs/matrix/vhost-matrix b/roles/docker/files/vhost/matrix similarity index 100% rename from roles/docker/files/configs/matrix/vhost-matrix rename to roles/docker/files/vhost/matrix diff --git a/roles/docker/files/configs/mastodon/vhost-mastodon b/roles/docker/files/vhost/social similarity index 100% rename from roles/docker/files/configs/mastodon/vhost-mastodon rename to roles/docker/files/vhost/social diff --git a/roles/docker/files/configs/vhost-www b/roles/docker/files/vhost/www similarity index 100% rename from roles/docker/files/configs/vhost-www rename to roles/docker/files/vhost/www diff --git a/roles/docker/handlers/main.yml b/roles/docker/handlers/main.yml index e37a19f9..ad671dd8 100644 --- a/roles/docker/handlers/main.yml +++ b/roles/docker/handlers/main.yml @@ -5,4 +5,3 @@ name: "nginx-proxy" restart: "yes" state: "started" - diff --git a/roles/docker/tasks/services/byro.yml b/roles/docker/tasks/services/byro.yml index 266c9cab..a3ed7250 100644 --- a/roles/docker/tasks/services/byro.yml +++ b/roles/docker/tasks/services/byro.yml @@ -12,7 +12,7 @@ - name: Deploy entrypoint file copy: - src: byro_deploy_entrypoint.sh + src: byro/deploy_entrypoint.sh dest: "{{ services.byro.volume_folder}}/data/deploy_entrypoint.sh" mode: u=rwx,g=rx,o=rx diff --git a/roles/docker/tasks/services/docker_registry.yml b/roles/docker/tasks/services/docker_registry.yml index 79c03b7f..d8c2347d 100644 --- a/roles/docker/tasks/services/docker_registry.yml +++ b/roles/docker/tasks/services/docker_registry.yml @@ -1,9 +1,9 @@ # vim: ft=yaml.ansible --- -- name: copy docker registry nginx configuration +- name: copy docker registry vhost configuration copy: - src: "files/configs/docker_registry/nginx.conf" - dest: "/docker-volumes/nginx/vhost/{{ services.docker_registry.domain }}" + src: vhost/docker + dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.docker_registry.domain }}" mode: "0644" - name: docker registry container diff --git a/roles/docker/tasks/services/hedgedoc.yml b/roles/docker/tasks/services/hedgedoc.yml index 9450d6eb..8160a66c 100644 --- a/roles/docker/tasks/services/hedgedoc.yml +++ b/roles/docker/tasks/services/hedgedoc.yml @@ -12,7 +12,7 @@ - name: copy sso public certificate copy: - src: "files/sso/sso.data.coop.pem" + src: sso/sso.data.coop.pem dest: "{{ services.hedgedoc.volume_folder }}/sso.data.coop.pem" mode: "0644" @@ -33,7 +33,7 @@ - "hedgedoc" volumes: - "{{ services.hedgedoc.volume_folder }}/db:/var/lib/postgresql/data" - + app: image: "quay.io/hedgedoc/hedgedoc:{{ services.hedgedoc.version }}" environment: @@ -55,7 +55,7 @@ - "{{ services.hedgedoc.volume_folder }}/hedgedoc/uploads:/hedgedoc/public/uploads" - "{{ services.hedgedoc.volume_folder }}/sso.data.coop.pem:/sso.data.coop.pem" restart: "unless-stopped" - networks: + networks: - "hedgedoc" - "external_services" depends_on: diff --git a/roles/docker/tasks/services/mailu.yml b/roles/docker/tasks/services/mailu.yml index e1181ef1..77df546a 100644 --- a/roles/docker/tasks/services/mailu.yml +++ b/roles/docker/tasks/services/mailu.yml @@ -106,7 +106,7 @@ admin: image: ghcr.io/mailu/admin:{{ services.mailu.version }} restart: always - env_file: "{{ services.mailu.volume_folder}}/mailu.env" + env_file: "{{ services.mailu.volume_folder }}/mailu.env" volumes: - "{{ services.mailu.volume_folder }}/data:/data" - "{{ services.mailu.volume_folder }}/dkim:/dkim" diff --git a/roles/docker/tasks/services/mastodon.yml b/roles/docker/tasks/services/mastodon.yml index 654a32b7..a99d92db 100644 --- a/roles/docker/tasks/services/mastodon.yml +++ b/roles/docker/tasks/services/mastodon.yml @@ -16,17 +16,17 @@ - name: Copy mastodon environment file template: - src: files/configs/mastodon/env_file.j2 + src: mastodon.env.j2 dest: "{{ services.mastodon.volume_folder }}/env_file" - name: Upload vhost config for root domain - template: - src: files/configs/mastodon/vhost-mastodon + copy: + src: vhost/social dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.mastodon.domain }}" - name: Copy PostgreSQL config copy: - src: files/configs/mastodon/postgresql.conf + src: mastodon/postgresql.conf dest: "{{ services.mastodon.volume_folder }}/postgres_config/postgresql.conf" - name: Set up Mastodon diff --git a/roles/docker/tasks/services/matrix_element.yml b/roles/docker/tasks/services/matrix_element.yml index 62df3f3e..604bba6b 100644 --- a/roles/docker/tasks/services/matrix_element.yml +++ b/roles/docker/tasks/services/matrix_element.yml @@ -29,33 +29,33 @@ - name: Upload Element config.json template: - src: files/configs/element/config.json + src: element.config.json.j2 dest: "{{ services.element.volume_folder }}/data/config.json" - name: Upload Element riot.im.conf - template: - src: files/configs/element/riot.im.conf + copy: + src: element/riot.im.conf dest: "{{ services.element.volume_folder }}/data/riot.im.conf" - name: upload vhost config for matrix domain - template: - src: files/configs/matrix/vhost-matrix + copy: + src: vhost/matrix dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.matrix.domain }}" - name: Upload vhost config for Element domain - template: - src: files/configs/matrix/vhost-element + copy: + src: vhost/element dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ item }}" loop: "{{ services.element.domains }}" - name: Upload homeserver.yaml template: - src: "files/configs/matrix/homeserver.yaml.j2" + src: matrix.homeserver.yaml.j2 dest: "{{ services.matrix.volume_folder }}/data/homeserver.yaml" - name: upload matrix logging config - template: - src: "files/configs/matrix/matrix.data.coop.log.config" + copy: + src: matrix/log.config dest: "{{ services.matrix.volume_folder }}/data/matrix.data.coop.log.config" - name: Set up Matrix and Element diff --git a/roles/docker/tasks/services/nextcloud.yml b/roles/docker/tasks/services/nextcloud.yml index 819b22d9..337a6eda 100644 --- a/roles/docker/tasks/services/nextcloud.yml +++ b/roles/docker/tasks/services/nextcloud.yml @@ -1,8 +1,8 @@ # vim: ft=yaml.ansible --- - name: upload vhost config for cloud.data.coop - template: - src: files/configs/nextcloud/vhost + copy: + src: vhost/cloud dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.nextcloud.domain }}" notify: "restart nginx" @@ -19,7 +19,7 @@ - "nextcloud" volumes: - "{{ services.nextcloud.volume_folder }}/postgres:/var/lib/postgresql/data" - environment: + environment: POSTGRES_DB: "nextcloud" POSTGRES_PASSWORD: "{{ postgres_passwords.nextcloud }}" POSTGRES_USER: "nextcloud" @@ -44,7 +44,7 @@ depends_on: - "postgres" - "redis" - + app: image: "nextcloud:{{ services.nextcloud.version }}" restart: "unless-stopped" @@ -69,8 +69,8 @@ - "redis" networks: - nextcloud: - postfix: - external: true - external_services: - external: true + nextcloud: + postfix: + external: true + external_services: + external: true diff --git a/roles/docker/tasks/services/privatebin.yml b/roles/docker/tasks/services/privatebin.yml index fbbad291..354d81cb 100644 --- a/roles/docker/tasks/services/privatebin.yml +++ b/roles/docker/tasks/services/privatebin.yml @@ -11,8 +11,8 @@ loop_var: volume - name: upload privatebin config - template: - src: files/configs/privatebin-conf.php + copy: + src: privatebin/conf.php dest: "{{ services.privatebin.volume_folder }}/cfg/conf.php" - name: privatebin app container diff --git a/roles/docker/tasks/services/rallly.yml b/roles/docker/tasks/services/rallly.yml index 1d092c51..1d3b481c 100644 --- a/roles/docker/tasks/services/rallly.yml +++ b/roles/docker/tasks/services/rallly.yml @@ -1,13 +1,13 @@ # vim: ft=yaml.ansible --- -- name: Create rallly volume folders +- name: Create Rallly volume folders file: name: "{{ services.rallly.volume_folder }}/postgres" state: directory - name: Copy Rallly environment file template: - src: files/configs/rallly/env_file.j2 + src: rallly.env.j2 dest: "{{ services.rallly.volume_folder }}/env_file" - name: Set up Rallly diff --git a/roles/docker/tasks/services/websites/data.coop.yml b/roles/docker/tasks/services/websites/data.coop.yml index 25028e11..c803a8ec 100644 --- a/roles/docker/tasks/services/websites/data.coop.yml +++ b/roles/docker/tasks/services/websites/data.coop.yml @@ -2,12 +2,12 @@ --- - name: Upload vhost config for root domain copy: - src: files/configs/matrix/vhost-root + src: vhost/_root dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ base_domain }}" - name: Upload vhost config for WWW domain copy: - src: files/configs/vhost-www + src: vhost/www dest: "{{ services.nginx_proxy.volume_folder }}/vhost/www.{{ base_domain }}" - name: setup data.coop website docker container diff --git a/roles/docker/files/configs/element/config.json b/roles/docker/templates/element.config.json.j2 similarity index 100% rename from roles/docker/files/configs/element/config.json rename to roles/docker/templates/element.config.json.j2 diff --git a/roles/docker/files/configs/mastodon/env_file.j2 b/roles/docker/templates/mastodon.env.j2 similarity index 100% rename from roles/docker/files/configs/mastodon/env_file.j2 rename to roles/docker/templates/mastodon.env.j2 diff --git a/roles/docker/files/configs/matrix/homeserver.yaml.j2 b/roles/docker/templates/matrix.homeserver.yaml.j2 similarity index 100% rename from roles/docker/files/configs/matrix/homeserver.yaml.j2 rename to roles/docker/templates/matrix.homeserver.yaml.j2 diff --git a/roles/docker/files/configs/rallly/env_file.j2 b/roles/docker/templates/rallly.env.j2 similarity index 100% rename from roles/docker/files/configs/rallly/env_file.j2 rename to roles/docker/templates/rallly.env.j2