Skip to content

Commit

Permalink
Add hook file for federation configuration
Browse files Browse the repository at this point in the history
Add hook file for federation configuration
  • Loading branch information
Milana Levy committed Dec 15, 2024
1 parent 93de89d commit 47a647c
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions hooks/playbooks/OpenStackControlPlane-federationPatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
- name: Create kustomization to update Keystone to use Federation
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
tasks:
- name: Create file to customize keystone for Federation resources deployed in the control plane
ansible.builtin.copy:
dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/keystone_federation.yaml"
content: |-
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace: {{ namespace }}
patches:
- target:
kind: OpenStackControlPlane
name: .*
patch: |-
- op: add
path: /spec/tls/caBundleSecretName
value: keycloakca
- op: add
path: /spec/keystone/template/oidcFederation
value:
keystoneFederationIdentityProviderName: "{{ cifmw_keystone_OIDC_provider_name }}"
oidcCacheType: "{{ cifmw_keystone_OIDC_CacheType }}"
oidcClaimDelimiter: "{{ cifmw_keystone_OIDC_ClaimDelimiter }}"
oidcClaimPrefix: "{{ cifmw_keystone_OIDC_ClaimPrefix }}"
oidcClientID: "{{ cifmw_keystone_OIDC_ClientID }}"
oidcIntrospectionEndpoint: "{{ cifmw_keystone_OIDC_IntrospectionEndpoint }}"
oidcMemCacheServers: "{{ cifmw_keystone_OIDC_MemCacheServers }}"
oidcPassClaimsAs: "{{ cifmw_keystone_OIDC_PassClaimsAs }}"
oidcPassUserInfoAs: "{{ cifmw_keystone_OIDC_PassUserInfoAs }}"
oidcProviderMetadataURL: "{{ cifmw_keystone_OIDC_ProviderMetadataURL }}"
oidcResponseType: "{{ cifmw_keystone_OIDC_ResponseType }}"
oidcScope: "{{ cifmw_keystone_OIDC_Scope }}"
remoteIDAttribute: "{{ cifmw_keystone_OIDC_remoteIDAttribute }}"
- name: Add Keycloak CA secret
kubernetes.core.k8s:
state: present
definition:
apiVersion: v1
kind: Secret
type: Opaque
metadata:
name: keycloakca
namespace: "openstack"
data:
KeyCloakCA: "{{ keycloakCaCert }}"

0 comments on commit 47a647c

Please sign in to comment.