From cb137fb8909724135bf3f759e062b94853f38999 Mon Sep 17 00:00:00 2001 From: ace Date: Mon, 25 Jan 2021 21:24:14 +0300 Subject: [PATCH] update gitea role - separate external db values --- roles/gitea/defaults/main.yaml | 5 ++++- roles/gitea/tasks/main.yaml | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/roles/gitea/defaults/main.yaml b/roles/gitea/defaults/main.yaml index 4314504..5245567 100644 --- a/roles/gitea/defaults/main.yaml +++ b/roles/gitea/defaults/main.yaml @@ -69,7 +69,10 @@ gitea_default_values: USER: "{{ gitea_ldap_user | default('gitea') }}" PASSWD: "{{ gitea_ldap_pass | default(gitea_ldap_password) }}" MAILER_TYPE: "smtp" - + +gitea_external_db_values: + gitea: + config: database: DB_TYPE: postgres HOST: "{{ postgres_db_team | default(namespace) }}-postgres.{{ postgres_db_namespace | default(namespace) }}.svc.cluster.local:5432" diff --git a/roles/gitea/tasks/main.yaml b/roles/gitea/tasks/main.yaml index 15296e2..36096fa 100644 --- a/roles/gitea/tasks/main.yaml +++ b/roles/gitea/tasks/main.yaml @@ -7,6 +7,10 @@ - set_fact: gitea_combined_values: "{{ gitea_default_values | combine(gitea_values, recursive=true) }}" +- set_fact: + gitea_combined_values: "gitea_combined_values | combine(gitea_external_db_values, recursive=true) }}" + when: gitea_use_external_db + - set_fact: gitea_dns_combined_values: "{{ gitea_dns_default_values | combine(gitea_dns_values, recursive=true) }}"