|
2 | 2 | - name: Create kustomization to update Keystone to use Federation |
3 | 3 | hosts: "{{ cifmw_target_hook_host | default('localhost') }}" |
4 | 4 | tasks: |
5 | | - - name: Set urls for install type uni |
| 5 | + - name: Set uni domain name var from federation role |
6 | 6 | ansible.builtin.set_fact: |
7 | | - cifmw_federation_keycloak_url: 'https://keycloak-openstack.apps.ocp.openstack.lab' |
8 | | - cifmw_federation_keystone_url: 'https://keystone-public-openstack.apps.ocp.openstack.lab' |
9 | | - cifmw_federation_horizon_url: 'https://horizon-openstack.apps.ocp.openstack.lab' |
| 7 | + cifmw_federation_domain: "apps.ocp.openstack.lab" |
10 | 8 | when: cifmw_federation_deploy_type == "uni" |
11 | 9 |
|
12 | | - - name: Set urls for install type crc |
| 10 | + - name: Set crc domain name var from federation role |
13 | 11 | ansible.builtin.set_fact: |
14 | | - cifmw_federation_keycloak_url: 'https://keycloak-openstack.apps-crc.testing' |
15 | | - cifmw_federation_keystone_url: 'https://keystone-public-openstack.apps-crc.testing' |
16 | | - cifmw_federation_horizon_url: 'https://horizon-openstack.apps-crc.testing' |
| 12 | + cifmw_federation_domain: "apps-crc.testing" |
17 | 13 | when: cifmw_federation_deploy_type == "crc" |
18 | 14 |
|
19 | | - - name: Create file to customize keystone for Federation resources deployed in the control plane |
20 | | - ansible.builtin.copy: |
21 | | - dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/keystone_federation.yaml" |
22 | | - content: |- |
23 | | - apiVersion: kustomize.config.k8s.io/v1beta1 |
24 | | - kind: Kustomization |
25 | | - resources: |
26 | | - - namespace: {{ namespace }} |
27 | | - patches: |
28 | | - - target: |
29 | | - kind: OpenStackControlPlane |
30 | | - name: .* |
31 | | - patch: |- |
32 | | - - op: add |
33 | | - path: /spec/tls |
34 | | - value: {} |
35 | | - - op: add |
36 | | - path: /spec/tls/caBundleSecretName |
37 | | - value: keycloakca |
38 | | - - op: add |
39 | | - path: /spec/keystone/template/httpdCustomization |
40 | | - value: |
41 | | - customConfigSecret: keystone-httpd-override |
42 | | - - op: add |
43 | | - path: /spec/keystone/template/customServiceConfig |
44 | | - value: | |
45 | | - [DEFAULT] |
46 | | - insecure_debug=true |
47 | | - debug=true |
48 | | - [federation] |
49 | | - trusted_dashboard={{ cifmw_federation_horizon_url }}/dashboard/auth/websso/ |
50 | | - sso_callback_template=/etc/keystone/sso_callback_template.html |
51 | | - [openid] |
52 | | - remote_id_attribute=HTTP_OIDC_ISS |
53 | | - [auth] |
54 | | - methods = password,token,oauth1,mapped,application_credential,openid |
55 | | - mode: "0644" |
56 | | - |
57 | | - - name: Get ingress operator CA cert |
58 | | - ansible.builtin.slurp: |
59 | | - src: "{{ [ ansible_user_dir, 'ci-framework-data', 'tmp', 'ingress-operator-ca.crt'] | path_join }}" |
60 | | - register: federation_sso_ca |
61 | | - |
62 | | - - name: Add Keycloak CA secret |
63 | | - kubernetes.core.k8s: |
64 | | - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
65 | | - state: present |
66 | | - definition: |
67 | | - apiVersion: v1 |
68 | | - kind: Secret |
69 | | - type: Opaque |
70 | | - metadata: |
71 | | - name: keycloakca |
72 | | - namespace: "openstack" |
73 | | - data: |
74 | | - KeyCloakCA: "{{ federation_sso_ca.content }}" |
75 | | - |
76 | | - - name: Create Keystone httpd override secret for Federation |
77 | | - kubernetes.core.k8s: |
78 | | - kubeconfig: "{{ cifmw_openshift_kubeconfig }}" |
79 | | - state: present |
80 | | - definition: |
81 | | - apiVersion: v1 |
82 | | - kind: Secret |
83 | | - metadata: |
84 | | - name: keystone-httpd-override |
85 | | - namespace: openstack |
86 | | - type: Opaque |
87 | | - stringData: |
88 | | - federation.conf: | |
89 | | - OIDCClaimPrefix "{{ cifmw_keystone_OIDC_ClaimPrefix }}" |
90 | | - OIDCResponseType "{{ cifmw_keystone_OIDC_ResponseType }}" |
91 | | - OIDCScope "{{ cifmw_keystone_OIDC_Scope }}" |
92 | | - OIDCClaimDelimiter "{{ cifmw_keystone_OIDC_ClaimDelimiter }}" |
93 | | - OIDCPassUserInfoAs "{{ cifmw_keystone_OIDC_PassUserInfoAs }}" |
94 | | - OIDCPassClaimsAs "{{ cifmw_keystone_OIDC_PassClaimsAs }}" |
95 | | - OIDCProviderMetadataURL "{{ cifmw_keystone_OIDC_ProviderMetadataURL }}" |
96 | | - OIDCClientID "{{ cifmw_keystone_OIDC_ClientID }}" |
97 | | - OIDCClientSecret "{{ cifmw_keystone_OIDC_ClientSecret }}" |
98 | | - OIDCCryptoPassphrase "{{ cifmw_keystone_OIDC_CryptoPassphrase }}" |
99 | | - OIDCOAuthClientID "{{ cifmw_keystone_OIDC_OAuthClientID }}" |
100 | | - OIDCOAuthClientSecret "{{ cifmw_keystone_OIDC_OAuthClientSecret }}" |
101 | | - OIDCOAuthIntrospectionEndpoint "{{ cifmw_keystone_OIDC_OAuthIntrospectionEndpoint }}" |
102 | | - OIDCRedirectURI "{{ cifmw_federation_keystone_url }}/v3/auth/OS-FEDERATION/identity_providers/{{ cifmw_keystone_OIDC_provider_name }}/protocols/openid/websso/" |
103 | | - LogLevel debug |
104 | | -
|
105 | | - <LocationMatch "/v3/auth/OS-FEDERATION/identity_providers/{{ cifmw_keystone_OIDC_provider_name }}/protocols/openid/websso"> |
106 | | - AuthType "openid-connect" |
107 | | - Require valid-user |
108 | | - </LocationMatch> |
109 | | -
|
110 | | - <Location ~ "/v3/OS-FEDERATION/identity_providers/{{ cifmw_keystone_OIDC_provider_name }}/protocols/openid/auth"> |
111 | | - AuthType oauth20 |
112 | | - Require valid-user |
113 | | - </Location> |
114 | | -
|
115 | | - <LocationMatch "/v3/auth/OS-FEDERATION/websso/openid"> |
116 | | - AuthType "openid-connect" |
117 | | - Require valid-user |
118 | | - </LocationMatch> |
| 15 | + - name: Run SSO controlplane setup |
| 16 | + ansible.builtin.import_role: |
| 17 | + name: federation |
| 18 | + tasks_from: hook_controlplane_config.yml |
0 commit comments