mirror of
https://github.com/ansible-middleware/keycloak.git
synced 2025-08-05 21:54:30 -07:00
molecule test for keycloakx with proxy
This commit is contained in:
parent
41c1306602
commit
e5f0a3efe1
7 changed files with 166 additions and 2 deletions
39
molecule/https_revproxy/verify.yml
Normal file
39
molecule/https_revproxy/verify.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
- name: Verify
|
||||
hosts: all
|
||||
tasks:
|
||||
- name: Populate service facts
|
||||
ansible.builtin.service_facts:
|
||||
|
||||
- name: Check if keycloak service started
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- ansible_facts.services["keycloak.service"]["state"] == "running"
|
||||
- ansible_facts.services["keycloak.service"]["status"] == "enabled"
|
||||
|
||||
- name: Set internal envvar
|
||||
ansible.builtin.set_fact:
|
||||
hera_home: "{{ lookup('env', 'HERA_HOME') }}"
|
||||
|
||||
- name: Verify openid config
|
||||
block:
|
||||
- name: Fetch openID config # noqa blocked_modules command-instead-of-module
|
||||
ansible.builtin.shell: |
|
||||
set -o pipefail
|
||||
curl https://localhost:443/realms/master/.well-known/openid-configuration -k | jq .
|
||||
args:
|
||||
executable: /bin/bash
|
||||
register: openid_config
|
||||
changed_when: False
|
||||
delegate_to: localhost
|
||||
- name: Verify endpoint URLs
|
||||
ansible.builtin.assert:
|
||||
that:
|
||||
- (openid_config.stdout | from_json)["backchannel_authentication_endpoint"] == 'https://proxy/realms/master/protocol/openid-connect/ext/ciba/auth'
|
||||
- (openid_config.stdout | from_json)['issuer'] == 'https://proxy/realms/master'
|
||||
- (openid_config.stdout | from_json)['authorization_endpoint'] == 'https://proxy/realms/master/protocol/openid-connect/auth'
|
||||
- (openid_config.stdout | from_json)['token_endpoint'] == 'https://proxy/realms/master/protocol/openid-connect/token'
|
||||
delegate_to: localhost
|
||||
when:
|
||||
- hera_home is defined
|
||||
- hera_home | length == 0
|
Loading…
Add table
Add a link
Reference in a new issue