From c5857d0ba8c73a36e72dbd520f62be711ca78c8d Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 9 Jul 2023 19:51:26 +0200 Subject: [PATCH 1/5] Don't put unnecessary executables in git --- roles/docker/files/byro_deploy_entrypoint.sh | 0 roles/docker/tasks/services/byro.yml | 15 +++++++-------- 2 files changed, 7 insertions(+), 8 deletions(-) mode change 100755 => 100644 roles/docker/files/byro_deploy_entrypoint.sh diff --git a/roles/docker/files/byro_deploy_entrypoint.sh b/roles/docker/files/byro_deploy_entrypoint.sh old mode 100755 new mode 100644 diff --git a/roles/docker/tasks/services/byro.yml b/roles/docker/tasks/services/byro.yml index 2d2eea9..266c9ca 100644 --- a/roles/docker/tasks/services/byro.yml +++ b/roles/docker/tasks/services/byro.yml @@ -1,29 +1,28 @@ +# vim: ft=yaml.ansible --- - -- name: ensure byro data folder exists +- name: Ensure byro data folder exists file: path: "{{ services.byro.volume_folder }}" state: directory -- name: create env file +- name: Create env file template: src: byro.env.j2 dest: "{{ services.byro.volume_folder }}/env" -- name: deploy entrypoint file +- name: Deploy entrypoint file copy: src: byro_deploy_entrypoint.sh dest: "{{ services.byro.volume_folder}}/data/deploy_entrypoint.sh" - mode: "preserve" + mode: u=rwx,g=rx,o=rx -- name: run byro +- name: Run byro docker_compose: - project_name: "byro member system" + project_name: byro_member_system" pull: yes definition: version: "3.8" services: - manage: image: ghcr.io/valberg/byro:add_missing_jquery_ui_images entrypoint: "/var/byro/data/deploy_entrypoint.sh" From 863b285b07fbc0c14e0b7627def15f9966548561 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 9 Jul 2023 20:27:32 +0200 Subject: [PATCH 2/5] 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 e37a19f..ad671dd 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 266c9ca..a3ed725 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 79c03b7..d8c2347 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 9450d6e..8160a66 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 e1181ef..77df546 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 654a32b..a99d92d 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 62df3f3..604bba6 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 819b22d..337a6ed 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 fbbad29..354d81c 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 1d092c5..1d3b481 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 25028e1..c803a8e 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 From ef7c00b748c96dc5f2a9bfbc75017c7d32b030c3 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 9 Jul 2023 20:39:07 +0200 Subject: [PATCH 3/5] Fix quote --- roles/docker/st | 30 ++++++++++++++++++++++++++++ roles/docker/tasks/services/byro.yml | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 roles/docker/st diff --git a/roles/docker/st b/roles/docker/st new file mode 100644 index 0000000..6ae8157 --- /dev/null +++ b/roles/docker/st @@ -0,0 +1,30 @@ +files/ +├── byro/ +│ └── deploy_entrypoint.sh +├── element/ +│ └── riot.im.conf +├── mastodon/ +│ └── postgresql.conf +├── matrix/ +│ └── log.config +├── privatebin/ +│ └── conf.php +├── sso/ +│ └── sso.data.coop.pem +└── vhost/ + ├── _root + ├── cloud + ├── docker + ├── element + ├── matrix + ├── social + └── www +templates/ +├── byro.env.j2 +├── element.config.json.j2 +├── mailu.env.j2 +├── mastodon.env.j2 +├── matrix.homeserver.yaml.j2 +├── rallly.env.j2 +├── restic.ssh.config.j2 +└── restic.ssh.known_hosts.j2 diff --git a/roles/docker/tasks/services/byro.yml b/roles/docker/tasks/services/byro.yml index a3ed725..96f117a 100644 --- a/roles/docker/tasks/services/byro.yml +++ b/roles/docker/tasks/services/byro.yml @@ -18,7 +18,7 @@ - name: Run byro docker_compose: - project_name: byro_member_system" + project_name: byro_member_system pull: yes definition: version: "3.8" From 7d13fc53029587ba2a3cfd775a5ebd20d6bdcc77 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sun, 9 Jul 2023 21:08:42 +0200 Subject: [PATCH 4/5] Use service names instead of subdomains for vhost file names --- .../docker/files/vhost/{_root => base_domain} | 0 .../files/vhost/{docker => docker_registry} | 0 roles/docker/files/vhost/{social => mastodon} | 0 roles/docker/files/vhost/{cloud => nextcloud} | 0 .../files/vhost/{www => www.base_domain} | 0 roles/docker/st | 30 ------------------- .../docker/tasks/services/docker_registry.yml | 2 +- roles/docker/tasks/services/mastodon.yml | 2 +- roles/docker/tasks/services/nextcloud.yml | 2 +- .../tasks/services/websites/data.coop.yml | 4 +-- 10 files changed, 5 insertions(+), 35 deletions(-) rename roles/docker/files/vhost/{_root => base_domain} (100%) rename roles/docker/files/vhost/{docker => docker_registry} (100%) rename roles/docker/files/vhost/{social => mastodon} (100%) rename roles/docker/files/vhost/{cloud => nextcloud} (100%) rename roles/docker/files/vhost/{www => www.base_domain} (100%) delete mode 100644 roles/docker/st diff --git a/roles/docker/files/vhost/_root b/roles/docker/files/vhost/base_domain similarity index 100% rename from roles/docker/files/vhost/_root rename to roles/docker/files/vhost/base_domain diff --git a/roles/docker/files/vhost/docker b/roles/docker/files/vhost/docker_registry similarity index 100% rename from roles/docker/files/vhost/docker rename to roles/docker/files/vhost/docker_registry diff --git a/roles/docker/files/vhost/social b/roles/docker/files/vhost/mastodon similarity index 100% rename from roles/docker/files/vhost/social rename to roles/docker/files/vhost/mastodon diff --git a/roles/docker/files/vhost/cloud b/roles/docker/files/vhost/nextcloud similarity index 100% rename from roles/docker/files/vhost/cloud rename to roles/docker/files/vhost/nextcloud diff --git a/roles/docker/files/vhost/www b/roles/docker/files/vhost/www.base_domain similarity index 100% rename from roles/docker/files/vhost/www rename to roles/docker/files/vhost/www.base_domain diff --git a/roles/docker/st b/roles/docker/st deleted file mode 100644 index 6ae8157..0000000 --- a/roles/docker/st +++ /dev/null @@ -1,30 +0,0 @@ -files/ -├── byro/ -│ └── deploy_entrypoint.sh -├── element/ -│ └── riot.im.conf -├── mastodon/ -│ └── postgresql.conf -├── matrix/ -│ └── log.config -├── privatebin/ -│ └── conf.php -├── sso/ -│ └── sso.data.coop.pem -└── vhost/ - ├── _root - ├── cloud - ├── docker - ├── element - ├── matrix - ├── social - └── www -templates/ -├── byro.env.j2 -├── element.config.json.j2 -├── mailu.env.j2 -├── mastodon.env.j2 -├── matrix.homeserver.yaml.j2 -├── rallly.env.j2 -├── restic.ssh.config.j2 -└── restic.ssh.known_hosts.j2 diff --git a/roles/docker/tasks/services/docker_registry.yml b/roles/docker/tasks/services/docker_registry.yml index d8c2347..3adee6d 100644 --- a/roles/docker/tasks/services/docker_registry.yml +++ b/roles/docker/tasks/services/docker_registry.yml @@ -2,7 +2,7 @@ --- - name: copy docker registry vhost configuration copy: - src: vhost/docker + src: vhost/docker_registry dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.docker_registry.domain }}" mode: "0644" diff --git a/roles/docker/tasks/services/mastodon.yml b/roles/docker/tasks/services/mastodon.yml index a99d92d..b6a623e 100644 --- a/roles/docker/tasks/services/mastodon.yml +++ b/roles/docker/tasks/services/mastodon.yml @@ -21,7 +21,7 @@ - name: Upload vhost config for root domain copy: - src: vhost/social + src: vhost/mastodon dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.mastodon.domain }}" - name: Copy PostgreSQL config diff --git a/roles/docker/tasks/services/nextcloud.yml b/roles/docker/tasks/services/nextcloud.yml index 337a6ed..f1d19b0 100644 --- a/roles/docker/tasks/services/nextcloud.yml +++ b/roles/docker/tasks/services/nextcloud.yml @@ -2,7 +2,7 @@ --- - name: upload vhost config for cloud.data.coop copy: - src: vhost/cloud + src: vhost/nextcloud dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ services.nextcloud.domain }}" notify: "restart nginx" diff --git a/roles/docker/tasks/services/websites/data.coop.yml b/roles/docker/tasks/services/websites/data.coop.yml index c803a8e..60dcab6 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: vhost/_root + src: vhost/base_domain dest: "{{ services.nginx_proxy.volume_folder }}/vhost/{{ base_domain }}" - name: Upload vhost config for WWW domain copy: - src: vhost/www + src: vhost/www.base_domain dest: "{{ services.nginx_proxy.volume_folder }}/vhost/www.{{ base_domain }}" - name: setup data.coop website docker container From 4e6f18311d05b20fe6c234da1a36175c491fb6be Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Sat, 5 Aug 2023 19:35:55 +0200 Subject: [PATCH 5/5] Use subfolders for templates as well --- roles/docker/tasks/services/byro.yml | 2 +- roles/docker/tasks/services/mailu.yml | 2 +- roles/docker/tasks/services/mastodon.yml | 2 +- roles/docker/tasks/services/matrix_element.yml | 4 ++-- roles/docker/tasks/services/rallly.yml | 2 +- roles/docker/tasks/services/restic_backup.yml | 4 ++-- roles/docker/templates/{byro.env.j2 => byro/env.j2} | 0 .../{element.config.json.j2 => element/config.json.j2} | 0 roles/docker/templates/{mailu.env.j2 => mailu/env.j2} | 0 roles/docker/templates/{mastodon.env.j2 => mastodon/env.j2} | 0 .../{matrix.homeserver.yaml.j2 => matrix/homeserver.yaml.j2} | 0 roles/docker/templates/{rallly.env.j2 => rallly/env.j2} | 0 .../templates/{restic.ssh.config.j2 => restic/ssh.config.j2} | 0 .../{restic.ssh.known_hosts.j2 => restic/ssh.known_hosts.j2} | 0 14 files changed, 8 insertions(+), 8 deletions(-) rename roles/docker/templates/{byro.env.j2 => byro/env.j2} (100%) rename roles/docker/templates/{element.config.json.j2 => element/config.json.j2} (100%) rename roles/docker/templates/{mailu.env.j2 => mailu/env.j2} (100%) rename roles/docker/templates/{mastodon.env.j2 => mastodon/env.j2} (100%) rename roles/docker/templates/{matrix.homeserver.yaml.j2 => matrix/homeserver.yaml.j2} (100%) rename roles/docker/templates/{rallly.env.j2 => rallly/env.j2} (100%) rename roles/docker/templates/{restic.ssh.config.j2 => restic/ssh.config.j2} (100%) rename roles/docker/templates/{restic.ssh.known_hosts.j2 => restic/ssh.known_hosts.j2} (100%) diff --git a/roles/docker/tasks/services/byro.yml b/roles/docker/tasks/services/byro.yml index 96f117a..f7a4141 100644 --- a/roles/docker/tasks/services/byro.yml +++ b/roles/docker/tasks/services/byro.yml @@ -7,7 +7,7 @@ - name: Create env file template: - src: byro.env.j2 + src: byro/env.j2 dest: "{{ services.byro.volume_folder }}/env" - name: Deploy entrypoint file diff --git a/roles/docker/tasks/services/mailu.yml b/roles/docker/tasks/services/mailu.yml index 77df546..168609a 100644 --- a/roles/docker/tasks/services/mailu.yml +++ b/roles/docker/tasks/services/mailu.yml @@ -25,7 +25,7 @@ - name: upload mailu.env file template: - src: mailu.env.j2 + src: mailu/env.j2 dest: "{{ services.mailu.volume_folder }}/mailu.env" - name: hard link to Let's Encrypt TLS certificate diff --git a/roles/docker/tasks/services/mastodon.yml b/roles/docker/tasks/services/mastodon.yml index 38f94a9..1c100ce 100644 --- a/roles/docker/tasks/services/mastodon.yml +++ b/roles/docker/tasks/services/mastodon.yml @@ -31,7 +31,7 @@ - name: Copy mastodon environment file template: - src: mastodon.env.j2 + src: mastodon/env.j2 dest: "{{ services.mastodon.volume_folder }}/env_file" - name: Upload vhost config for root domain diff --git a/roles/docker/tasks/services/matrix_element.yml b/roles/docker/tasks/services/matrix_element.yml index f65aa2d..b5a04b0 100644 --- a/roles/docker/tasks/services/matrix_element.yml +++ b/roles/docker/tasks/services/matrix_element.yml @@ -29,7 +29,7 @@ - name: Upload Element config.json template: - src: element.config.json.j2 + src: element/config.json.j2 dest: "{{ services.element.volume_folder }}/data/config.json" - name: Upload Element riot.im.conf @@ -50,7 +50,7 @@ - name: Upload homeserver.yaml template: - src: matrix.homeserver.yaml.j2 + src: matrix/homeserver.yaml.j2 dest: "{{ services.matrix.volume_folder }}/data/homeserver.yaml" - name: upload matrix logging config diff --git a/roles/docker/tasks/services/rallly.yml b/roles/docker/tasks/services/rallly.yml index 1d3b481..400073f 100644 --- a/roles/docker/tasks/services/rallly.yml +++ b/roles/docker/tasks/services/rallly.yml @@ -7,7 +7,7 @@ - name: Copy Rallly environment file template: - src: rallly.env.j2 + src: rallly/env.j2 dest: "{{ services.rallly.volume_folder }}/env_file" - name: Set up Rallly diff --git a/roles/docker/tasks/services/restic_backup.yml b/roles/docker/tasks/services/restic_backup.yml index 8fce1b5..df0c278 100644 --- a/roles/docker/tasks/services/restic_backup.yml +++ b/roles/docker/tasks/services/restic_backup.yml @@ -33,7 +33,7 @@ - name: Create SSH config template: - src: restic.ssh.config.j2 + src: restic/ssh.config.j2 dest: "{{ services.restic.volume_folder }}/ssh/config" owner: root group: root @@ -41,7 +41,7 @@ - name: Create SSH known_hosts file template: - src: restic.ssh.known_hosts.j2 + src: restic/ssh.known_hosts.j2 dest: "{{ services.restic.volume_folder }}/ssh/known_hosts" owner: root group: root diff --git a/roles/docker/templates/byro.env.j2 b/roles/docker/templates/byro/env.j2 similarity index 100% rename from roles/docker/templates/byro.env.j2 rename to roles/docker/templates/byro/env.j2 diff --git a/roles/docker/templates/element.config.json.j2 b/roles/docker/templates/element/config.json.j2 similarity index 100% rename from roles/docker/templates/element.config.json.j2 rename to roles/docker/templates/element/config.json.j2 diff --git a/roles/docker/templates/mailu.env.j2 b/roles/docker/templates/mailu/env.j2 similarity index 100% rename from roles/docker/templates/mailu.env.j2 rename to roles/docker/templates/mailu/env.j2 diff --git a/roles/docker/templates/mastodon.env.j2 b/roles/docker/templates/mastodon/env.j2 similarity index 100% rename from roles/docker/templates/mastodon.env.j2 rename to roles/docker/templates/mastodon/env.j2 diff --git a/roles/docker/templates/matrix.homeserver.yaml.j2 b/roles/docker/templates/matrix/homeserver.yaml.j2 similarity index 100% rename from roles/docker/templates/matrix.homeserver.yaml.j2 rename to roles/docker/templates/matrix/homeserver.yaml.j2 diff --git a/roles/docker/templates/rallly.env.j2 b/roles/docker/templates/rallly/env.j2 similarity index 100% rename from roles/docker/templates/rallly.env.j2 rename to roles/docker/templates/rallly/env.j2 diff --git a/roles/docker/templates/restic.ssh.config.j2 b/roles/docker/templates/restic/ssh.config.j2 similarity index 100% rename from roles/docker/templates/restic.ssh.config.j2 rename to roles/docker/templates/restic/ssh.config.j2 diff --git a/roles/docker/templates/restic.ssh.known_hosts.j2 b/roles/docker/templates/restic/ssh.known_hosts.j2 similarity index 100% rename from roles/docker/templates/restic.ssh.known_hosts.j2 rename to roles/docker/templates/restic/ssh.known_hosts.j2