community.general/tests/integration/targets/keycloak_clientsecret_info/tasks/main.yml
patchback[bot] c39deafa32
[PR #9727/910c57aa backport][stable-8] keycloak: repair integration tests by removing jinja2 templating from conditionals (#9726) (#9746)
keycloak: repair integration tests by removing jinja2 templating from conditionals (#9726) (#9727)

* fix: remove jinja2 templating from conditionals in keycloak_role module integration tests (#9726)

* fix: remove jinja2 templating in conditional in keycloak clientsecret info integration test (#9726)

This test needs a further fix; see #9744. Left for a future PR for now.

* fix: remove jinja2 templating in conditional in keycloak clientsecret regenerate integration test (#9726)

* chore: remove jinja2 templating in conditional in keycloak user federation integration test (#9726)

These instances of templating were not causing failures,
but this removes the warnings.

* chore: remove jinja2 templating in conditional in keycloak user rolemapping integration test (#9726)

These instances of templating were not causing failures,
but this removes the warnings.

* docs: add changelog fragment (#9726)

* docs: repair changelog fragment yaml (#9726)

* docs: actually repair changelog fragment yaml (#9726)

* chore: remove changelog fragment for test only pr (#9726)

(cherry picked from commit 910c57aaa0)

Co-authored-by: Mark Armstrong <markparmstrong@gmail.com>
2025-02-15 12:31:34 +01:00

48 lines
1.5 KiB
YAML

---
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
- name: Create realm
community.general.keycloak_realm: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
id: "{{ realm }}"
realm: "{{ realm }}"
state: present
- name: Keycloak Client
community.general.keycloak_client: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
realm: "{{ realm }}"
client_id: "{{ client_id }}"
state: present
register: client
- name: Keycloak Client fetch clientsecret by client_id
community.general.keycloak_clientsecret_info: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
realm: "{{ realm }}"
client_id: "{{ client_id }}"
register: fetch_by_client_id_result
- name: Assert that the client secret was retrieved
assert:
that:
- fetch_by_client_id_result.clientsecret_info.type == "secret"
- fetch_by_client_id_result.clientsecret_info.value | length >= 32
- name: Keycloak Client fetch clientsecret by id
community.general.keycloak_clientsecret_info: "{{ auth_args | combine(call_args) }}"
vars:
call_args:
realm: "{{ realm }}"
id: "{{ client.end_state.id }}"
register: fetch_by_id_result
- name: Assert that the same client secret was retrieved both times
assert:
that:
- fetch_by_id_result.clientsecret_info.value == fetch_by_client_id_result.clientsecret_info.value