From 40d196c100242b4eaa9e80dc7c1cb5cb89cb6ff4 Mon Sep 17 00:00:00 2001 From: Sam Al-Sapti Date: Thu, 28 Dec 2023 00:00:12 +0100 Subject: [PATCH] Fix stuff after testing --- group_vars/app_prod/vars.yml | 2 +- group_vars/app_stage/vars.yml | 2 +- roles/apps/templates/compose-files/nextcloud.yml.j2 | 4 ++-- roles/apps/templates/nginx/conf.d/ipfs.conf.j2 | 2 ++ roles/apps/templates/nginx/conf.d/monerod.conf.j2 | 1 + roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 | 1 + roles/postgresql/tasks/main.yml | 2 +- roles/postgresql/templates/postgresql.conf.j2 | 1 + 8 files changed, 10 insertions(+), 5 deletions(-) diff --git a/group_vars/app_prod/vars.yml b/group_vars/app_prod/vars.yml index 2e57025..5fe3df2 100644 --- a/group_vars/app_prod/vars.yml +++ b/group_vars/app_prod/vars.yml @@ -4,4 +4,4 @@ apps_base_domain: sapti.me db_inventory_hostname: sapt-labp-db01 -db_host: "{{ hostvars[db_inventory_hostname].fqdn }}" +db_host: "{{ hostvars[db_inventory_hostname].internal_ipv4 }}" diff --git a/group_vars/app_stage/vars.yml b/group_vars/app_stage/vars.yml index 85a6e24..4c361cf 100644 --- a/group_vars/app_stage/vars.yml +++ b/group_vars/app_stage/vars.yml @@ -4,4 +4,4 @@ apps_base_domain: staging.sapti.me db_inventory_hostname: sapt-labs-db01 -db_host: "{{ hostvars[db_inventory_hostname].fqdn }}" +db_host: "{{ hostvars[db_inventory_hostname].internal_ipv4 }}" diff --git a/roles/apps/templates/compose-files/nextcloud.yml.j2 b/roles/apps/templates/compose-files/nextcloud.yml.j2 index 5dd8e16..080806a 100644 --- a/roles/apps/templates/compose-files/nextcloud.yml.j2 +++ b/roles/apps/templates/compose-files/nextcloud.yml.j2 @@ -15,9 +15,9 @@ services: image: nextcloud:{{ apps_vars.nextcloud.version }} restart: always environment: - POSTGRES_HOST: "{{ db_host }}" + POSTGRES_HOST: {{ db_host }} POSTGRES_DB: nextcloud - POSTGRES_USER: "{{ databases.nextcloud.username }}" + POSTGRES_USER: {{ databases.nextcloud.username }} POSTGRES_PASSWORD: {{ databases.nextcloud.password }} REDIS_HOST: redis REDIS_HOST_PASSWORD: {{ redis_passwords.nextcloud }} diff --git a/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 b/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 index a1672e2..e5c858f 100644 --- a/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 +++ b/roles/apps/templates/nginx/conf.d/ipfs.conf.j2 @@ -6,6 +6,7 @@ server { server_name {{ apps_vars.ipfs.domain }}; location / { + resolver 127.0.0.11 valid=30s; set $upstream http://ipfs:5001; proxy_pass $upstream; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; @@ -18,6 +19,7 @@ server { server_name ~^([\w-]+\.(ipfs|ipns)\.)?{{ apps_vars.ipfs.gateway_domain }}$; location / { + resolver 127.0.0.11 valid=30s; set $upstream http://ipfs:8080; proxy_pass $upstream; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/roles/apps/templates/nginx/conf.d/monerod.conf.j2 b/roles/apps/templates/nginx/conf.d/monerod.conf.j2 index eddb7ae..7a1f4f7 100644 --- a/roles/apps/templates/nginx/conf.d/monerod.conf.j2 +++ b/roles/apps/templates/nginx/conf.d/monerod.conf.j2 @@ -6,6 +6,7 @@ server { server_name {{ apps_vars.monerod.domain }}; location / { + resolver 127.0.0.11 valid=30s; set $upstream http://monerod:18089; proxy_pass $upstream; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 b/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 index 3b718cf..0701059 100644 --- a/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 +++ b/roles/apps/templates/nginx/conf.d/nextcloud.conf.j2 @@ -6,6 +6,7 @@ server { server_name {{ apps_vars.nextcloud.domain }}; location / { + resolver 127.0.0.11 valid=30s; set $upstream http://nextcloud:80; proxy_pass $upstream; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; diff --git a/roles/postgresql/tasks/main.yml b/roles/postgresql/tasks/main.yml index cf74e7e..8bdfa35 100644 --- a/roles/postgresql/tasks/main.yml +++ b/roles/postgresql/tasks/main.yml @@ -46,7 +46,7 @@ ansible.builtin.file: path: "{{ postgresql_pgdata }}" owner: postgres - mode: u=rwx,g=rx,o=rx + mode: u=rwx,go= state: directory - name: Initialize database diff --git a/roles/postgresql/templates/postgresql.conf.j2 b/roles/postgresql/templates/postgresql.conf.j2 index 630af83..ceef539 100644 --- a/roles/postgresql/templates/postgresql.conf.j2 +++ b/roles/postgresql/templates/postgresql.conf.j2 @@ -9,6 +9,7 @@ dynamic_shared_memory_type = posix password_encryption = scram-sha-256 datestyle = 'iso, mdy' timezone = '{{ timezone }}' +logging_collector = on log_timezone = '{{ timezone }}' lc_messages = 'en_US.utf8' lc_monetary = 'en_US.utf8'