From 8af5d6e55605928028600002c945dd6dafa649fa Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Mon, 13 Nov 2023 18:10:40 +0100 Subject: [PATCH] ci: https_revproxy molecule verify step --- molecule/https_revproxy/verify.yml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/molecule/https_revproxy/verify.yml b/molecule/https_revproxy/verify.yml index 2f31ec3..2c8befb 100644 --- a/molecule/https_revproxy/verify.yml +++ b/molecule/https_revproxy/verify.yml @@ -11,29 +11,23 @@ - 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 + run_once: True 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 -H "Host: proxy" -k -s | jq . - args: - executable: /bin/bash + ansible.builtin.uri: + url: https://localhost:443/realms/master/.well-known/openid-configuration + validate_certs: false + headers: + Host: proxy 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' + - openid_config.json["backchannel_authentication_endpoint"] == 'https://proxy/realms/master/protocol/openid-connect/ext/ciba/auth' + - openid_config.json['issuer'] == 'https://proxy/realms/master' + - openid_config.json['authorization_endpoint'] == 'https://proxy/realms/master/protocol/openid-connect/auth' + - openid_config.json['token_endpoint'] == 'https://proxy/realms/master/protocol/openid-connect/token' delegate_to: localhost - when: - - hera_home is defined - - hera_home | length == 0