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) }}"