diff --git a/roles/gitops/post-install/keycloak/templates/argocd-redirectUris.yaml.j2 b/roles/gitops/post-install/keycloak/templates/argocd-redirectUris.yaml.j2 new file mode 100644 index 000000000..cbbff7709 --- /dev/null +++ b/roles/gitops/post-install/keycloak/templates/argocd-redirectUris.yaml.j2 @@ -0,0 +1,6 @@ +- https://{{ argocd_domain }}/auth/callback +{% if dsc.argocd.secondaryZones is defined and dsc.argocd.secondaryZones %} +{% for zone in dsc.argocd.secondaryZones %} +- https://{{ zone.domain }}/auth/callback +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/roles/gitops/post-install/keycloak/templates/argocd-webOrigins.yaml.j2 b/roles/gitops/post-install/keycloak/templates/argocd-webOrigins.yaml.j2 new file mode 100644 index 000000000..fca54b8dd --- /dev/null +++ b/roles/gitops/post-install/keycloak/templates/argocd-webOrigins.yaml.j2 @@ -0,0 +1,6 @@ +- https://{{ argocd_domain }} +{% if dsc.argocd.secondaryZones is defined and dsc.argocd.secondaryZones %} +{% for zone in dsc.argocd.secondaryZones %} +- https://{{ zone.domain }} +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/roles/gitops/post-install/keycloak/vars/main.yaml b/roles/gitops/post-install/keycloak/vars/main.yaml index 8aa3b0840..1111297bf 100644 --- a/roles/gitops/post-install/keycloak/vars/main.yaml +++ b/roles/gitops/post-install/keycloak/vars/main.yaml @@ -37,11 +37,8 @@ keycloak_clients: clientAuthenticatorType: client-secret standardFlowEnabled: true directAccessGrantsEnabled: true - redirectUris: - - https://{{ argocd_domain }}/auth/callback - - "*" - webOrigins: - - https://{{ argocd_domain }} + redirectUris: "{{ lookup('ansible.builtin.template', 'argocd-redirectUris.yaml.j2') | from_yaml }}" + webOrigins: "{{ lookup('ansible.builtin.template', 'argocd-webOrigins.yaml.j2') | from_yaml }}" defaultClientScopes: - basic - generic diff --git a/roles/socle-config/templates/crd-conf-dso.yaml b/roles/socle-config/templates/crd-conf-dso.yaml index d30bccc0b..e8fdee72b 100644 --- a/roles/socle-config/templates/crd-conf-dso.yaml +++ b/roles/socle-config/templates/crd-conf-dso.yaml @@ -160,6 +160,19 @@ spec: zoneChartVersion: description: Version of the Helm Chart to use to manage zone objects. See https://github.com/cloud-pi-native/helm-charts/tree/main/charts/dso-argocd-zone type: string + secondaryZones: + description: List of secondary zones each run an Argo CD instance to manage all applications deployed in the secondary zone. + type: array + default: [] + items: + type: object + properties: + name: + description: Name of the zone. + type: string + domain: + description: The fully qualified domain name of the Argo CD of the zone. + type: string required: - admin - installEnabled