- name: add keystone fernet keys secret ansible.builtin.shell: | {{ shell_header }} {{ oc_header }} CONTROLLER1_SSH="{{ controller1_ssh }}" oc apply -f - </dev/null 2>&1; then oc create secret generic keycloakca --from-file=KeyCloakCA={{ federation_ingress_ca_path }} fi - name: Ensure Keystone httpd override secret exists when federation enabled when: - enable_federation | default(false) | bool ansible.builtin.shell: | {{ shell_header }} {{ oc_header }} cat < AuthType "openid-connect" Require valid-user AuthType oauth20 Require valid-user AuthType "openid-connect" Require valid-user EOF - name: Print session test token ansible.builtin.debug: var: before_adoption_token - name: Verify that pre-adoption token still works ansible.builtin.shell: | {{ shell_header }} {{ oc_header }} alias openstack="oc exec -t openstackclient -- env -u OS_CLOUD - OS_AUTH_URL={{ auth_url }} OS_AUTH_TYPE=token OS_TOKEN={{ before_adoption_token.stdout }} openstack" if ${BASH_ALIASES[openstack]} endpoint list 2>&1 | grep "Failed to validate token"; then exit 1 else exit 0 fi register: adoption_token_result - name: Verify that pre-adoption OIDC token still works when: - enable_federation | default(false) | bool - before_adoption_oidc_token is defined - before_adoption_oidc_token.stdout is defined ansible.builtin.shell: cmd: | {{ shell_header }} {{ oc_header }} alias openstack="oc exec -t openstackclient -- env -u OS_CLOUD - OS_AUTH_URL={{ auth_url }} OS_AUTH_TYPE=v3oidcaccesstoken OS_ACCESS_TOKEN={{ before_adoption_oidc_token.stdout }} openstack" ${BASH_ALIASES[openstack]} token issue -f json register: adoption_oidc_token_result - name: Print credentials test token ansible.builtin.debug: var: before_adoption_token - name: Verify that pre-adoption credential stills the same ansible.builtin.shell: | {{ shell_header }} {{ oc_header }} alias openstack="oc exec -t openstackclient -- openstack" ${BASH_ALIASES[openstack]} credential show {{ before_adoption_credential.stdout }} -f value -c blob register: after_adoption_credential failed_when: after_adoption_credential.stdout != 'test' - name: get ldap user token ansible.builtin.shell: | {{ shell_header }} {{ oc_header }} alias openstack="oc exec -t openstackclient -- openstack" auth_url=$(${BASH_ALIASES[openstack]} endpoint list --service keystone --interface public -f value -c URL) alias openstack="oc exec -t openstackclient -- env -u OS_CLOUD - OS_AUTH_URL=${auth_url} OS_USERNAME=ipauser1 OS_PASSWORD={{ ipa_user_password }} OS_PROJECT_DOMAIN_NAME=REDHAT OS_USER_DOMAIN_NAME=REDHAT openstack" ${BASH_ALIASES[openstack]} token issue -f json register: keystone_ldap_responding_result when: enable_keystone_ldap | default(false) | bool - name: Print ldap user token ansible.builtin.debug: var: keystone_ldap_responding_result when: enable_keystone_ldap | default(false) | bool