From f71d534afe1755375d8a93f8e5e2b77a8b96da7a Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Mon, 7 Nov 2022 18:38:08 +0100 Subject: [PATCH 1/3] Add Rallly --- group_vars/all/secrets.yml.contents | 1 + playbook.yml | 1 + roles/docker/defaults/main.yml | 7 +++- roles/docker/tasks/services/rallly.yml | 52 ++++++++++++++++++++++++++ 4 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 roles/docker/tasks/services/rallly.yml diff --git a/group_vars/all/secrets.yml.contents b/group_vars/all/secrets.yml.contents index 4dd87546..7188ffa0 100644 --- a/group_vars/all/secrets.yml.contents +++ b/group_vars/all/secrets.yml.contents @@ -12,6 +12,7 @@ postgres_passwords: ttrss: xxx keycloak: xxx mastodon: xxx + rallly: xxx membersystem: xxx fider_jwt_secret: xxx diff --git a/playbook.yml b/playbook.yml index 5d2e4302..fe577fc0 100644 --- a/playbook.yml +++ b/playbook.yml @@ -26,6 +26,7 @@ - mailu - portainer - mastodon + - rallly - membersystem smtp_host: "postfix" diff --git a/roles/docker/defaults/main.yml b/roles/docker/defaults/main.yml index 524cbb2c..e890544d 100644 --- a/roles/docker/defaults/main.yml +++ b/roles/docker/defaults/main.yml @@ -101,12 +101,17 @@ postfix: - "{{ passit.domain }}" - "{{ gitea.domain }}" - "{{ mastodon.domain }}" + - "{{ rallly.domain }}" - "{{ membersystem.domain }}" mastodon: domain: "social.{{ base_domain }}" volume_folder: "{{ volume_root_folder }}/mastodon" +rallly: + domain: "when.{{ base_domain }}" + volume_folder: "{{ volume_root_folder }}/rallly" + membersystem: domain: "member.{{ base_domain }}" django_admins: "Vidir:valberg@orn.li" @@ -114,4 +119,4 @@ membersystem: restic: user: "datacoop" domain: "restic.cannedtuna.org" - repository: "datacoop-hevonen" \ No newline at end of file + repository: "datacoop-hevonen" diff --git a/roles/docker/tasks/services/rallly.yml b/roles/docker/tasks/services/rallly.yml new file mode 100644 index 00000000..ab554e51 --- /dev/null +++ b/roles/docker/tasks/services/rallly.yml @@ -0,0 +1,52 @@ +- name: create rallly volume folders + file: + name: "{{ rallly.volume_folder }}/postgres" + state: directory + +- name: set up rallly + docker_compose: + project_name: "rallly" + pull: "yes" + definition: + version: "3.8" + services: + postgres: + image: "postgres:14-alpine" + restart: "unless-stopped" + shm_size: "256mb" + networks: + rallly_internal: + volumes: + - "{{ rallly.volume_folder }}/postgres:/var/lib/postgresql/data" + environment: + POSTGRES_PASSWORD: "{{ postgres_passwords.rallly }}" + POSTGRES_DB: "rallly_db" + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + labels: + com.centurylinklabs.watchtower.enable: "true" + + rallly: + image: "lukevella/rallly:latest" + restart: "unless-stopped" + networks: + rallly_internal: + external_services: + ports: + - "3000:3000" + environment: + DATABASE_URL: "postgres://postgres:{{ postgres_passwords.rallly }}@postgres:5432/rallly_db" + depends_on: + rallly_db: + condition: "service_healthy" + labels: + com.centurylinklabs.watchtower.enable: "true" + + networks: + rallly_internal: + internal: true + external_services: + external: true From dd6b29bccd9d56aa0084e29597eef4c51e835d26 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Mon, 7 Nov 2022 19:05:49 +0100 Subject: [PATCH 2/3] Add secrets and env file for Rally --- group_vars/all/secrets.yml.contents | 3 +++ roles/docker/files/configs/rallly/env_file | 9 +++++++++ roles/docker/tasks/services/rallly.yml | 16 ++++++++++++---- 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 roles/docker/files/configs/rallly/env_file diff --git a/group_vars/all/secrets.yml.contents b/group_vars/all/secrets.yml.contents index 7188ffa0..6aab9ffc 100644 --- a/group_vars/all/secrets.yml.contents +++ b/group_vars/all/secrets.yml.contents @@ -50,5 +50,8 @@ mastodon_secrets: vapid_private_key: xxx vapid_public_key: xxx +rallly_secrets: + secret_password: xxx + membersystem_secrets: secret_key: xxx diff --git a/roles/docker/files/configs/rallly/env_file b/roles/docker/files/configs/rallly/env_file new file mode 100644 index 00000000..a3ec36a7 --- /dev/null +++ b/roles/docker/files/configs/rallly/env_file @@ -0,0 +1,9 @@ +NEXT_PUBLIC_BASE_URL="https://:{{ rallly.domain }}" +DATABASE_URL="postgres://postgres:{{ postgres_passwords.rallly }}@postgres:5432/rallly_db" +SECRET_PASSWORD="{{ rallly_secrets.secret_password }}" +SUPPORT_EMAIL="noreply@{{ rallly.domain }}" +SMTP_HOST="{{ smtp_host }}" +SMTP_PORT="{{ smtp_port }}" +SMTP_SECURE="false" +SMTP_USER= +SMTP_PWD= diff --git a/roles/docker/tasks/services/rallly.yml b/roles/docker/tasks/services/rallly.yml index ab554e51..a671f5b2 100644 --- a/roles/docker/tasks/services/rallly.yml +++ b/roles/docker/tasks/services/rallly.yml @@ -1,9 +1,14 @@ -- name: create rallly volume folders +- name: Create rallly volume folders file: name: "{{ rallly.volume_folder }}/postgres" state: directory -- name: set up rallly +- name: Copy Rallly environment file + template: + src: files/configs/rallly/env_file + dest: "{{ rallly.volume_folder }}/env_file" + +- name: Set up rallly docker_compose: project_name: "rallly" pull: "yes" @@ -35,13 +40,14 @@ networks: rallly_internal: external_services: + postfix: ports: - "3000:3000" - environment: - DATABASE_URL: "postgres://postgres:{{ postgres_passwords.rallly }}@postgres:5432/rallly_db" depends_on: rallly_db: condition: "service_healthy" + env_file: + - "{{ rallly.volume_folder }}/env_file" labels: com.centurylinklabs.watchtower.enable: "true" @@ -50,3 +56,5 @@ internal: true external_services: external: true + postfix: + external: true From dc51b6287276562e31431c6f3ba309dd5f8bcf8f Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Mon, 7 Nov 2022 19:08:54 +0100 Subject: [PATCH 3/3] Capitalization fix --- roles/docker/tasks/services/rallly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/docker/tasks/services/rallly.yml b/roles/docker/tasks/services/rallly.yml index a671f5b2..86c25552 100644 --- a/roles/docker/tasks/services/rallly.yml +++ b/roles/docker/tasks/services/rallly.yml @@ -8,7 +8,7 @@ src: files/configs/rallly/env_file dest: "{{ rallly.volume_folder }}/env_file" -- name: Set up rallly +- name: Set up Rallly docker_compose: project_name: "rallly" pull: "yes"