Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keycloak_clientscope_type: changes are not detected in check mode #9092

Closed
1 task done
witrdotnet opened this issue Oct 31, 2024 · 2 comments · Fixed by #9093
Closed
1 task done

keycloak_clientscope_type: changes are not detected in check mode #9092

witrdotnet opened this issue Oct 31, 2024 · 2 comments · Fixed by #9093
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)

Comments

@witrdotnet
Copy link
Contributor

Summary

community.general.keycloak_clientscope_type module detects and reports changes in non-check mode. Howerver, changes are not detected nor reported in check mode.

Issue Type

Bug Report

Component Name

keycloak_clientscope_type

Ansible Version

$ ansible --version
ansible [core 2.17.5]
  config file = None
  configured module search path = ['~/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = ~/.local/share/virtualenvs/general-YFeQnqo1/lib/python3.11/site-packages/ansible
  ansible collection location = ~/.ansible/collections:/usr/share/ansible/collections
  executable location = ~/.local/share/virtualenvs/general-YFeQnqo1/bin/ansible
  python version = 3.11.9 (main, Oct 31 2024, 23:17:42) [GCC 9.4.0] (~/.local/share/virtualenvs/general-YFeQnqo1/bin/python)
  jinja version = 3.1.4
  libyaml = True

Community.general Version

$ ansible-galaxy collection list community.general
Collection        Version
----------------- -------
community.general 9.5.0

Configuration

$ ansible-config dump --only-changed
CONFIG_FILE() = None
PAGER(env: PAGER) = less

OS / Environment

Observed under Ubuntu 22 and Debian 11.

Python installed with pyenv and ansible executed with pipenv.

Steps to Reproduce

- hosts: localhost

  vars:
    url: http://localhost:8080
    admin_realm: master
    admin_user: admin
    admin_password: password
    realm: clientscope-type-realm
    client_id: clientscope-type-client

  tasks:
  - name: adjust client-scope types in client
    community.general.keycloak_clientscope_type:
      auth_keycloak_url: "{{ url }}"
      auth_realm: "{{ admin_realm }}"
      auth_username: "{{ admin_user }}"
      auth_password: "{{ admin_password }}"
      realm: "{{ realm }}"
      client_id: "{{ client_id }}"
      default_clientscopes: ['scope1']
      optional_clientscopes: ['scope2']

Expected Results

Assuming client under test have no scopes, following standard output is expected in check mode :

TASK [adjust client-scope types in client] ****************************************
--- before
+++ after
@@ -1,4 +1,8 @@
 {
-    "default_clientscopes": [],
-    "optional_clientscopes": []
+    "default_clientscopes": [
+        "scope1"
+    ],
+    "optional_clientscopes": [
+        "scope2"
+    ]
 }

changed: [localhost]

Actual Results

TASK [adjust client-scope types in client] ****************************************
ok: [localhost]

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added bug This issue/PR relates to a bug module module plugins plugin (any type) labels Oct 31, 2024
witrdotnet added a commit to witrdotnet/community.general that referenced this issue Nov 1, 2024
witrdotnet added a commit to witrdotnet/community.general that referenced this issue Nov 1, 2024
witrdotnet added a commit to witrdotnet/community.general that referenced this issue Nov 1, 2024
felixfontein added a commit that referenced this issue Nov 3, 2024
* fix check_mode on set keycloak client scope type (#9092)

* add changelog fragment (#9092)

* update changelog fragment (#9092)

* compact code: make one line conditions with list comprehension and any()

Co-authored-by: Alexei Znamensky <[email protected]>

* fix syntax error: remove extra ')'

* fix changelog fragment type

Co-authored-by: Felix Fontein <[email protected]>

* add issue's link in changelog fragment

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Alexei Znamensky <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
patchback bot pushed a commit that referenced this issue Nov 3, 2024
* fix check_mode on set keycloak client scope type (#9092)

* add changelog fragment (#9092)

* update changelog fragment (#9092)

* compact code: make one line conditions with list comprehension and any()

Co-authored-by: Alexei Znamensky <[email protected]>

* fix syntax error: remove extra ')'

* fix changelog fragment type

Co-authored-by: Felix Fontein <[email protected]>

* add issue's link in changelog fragment

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Alexei Znamensky <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 8fc11fe)
felixfontein pushed a commit that referenced this issue Nov 3, 2024
…checkmode (#9095)

keycloak_clientscope_type fix checkmode (#9093)

* fix check_mode on set keycloak client scope type (#9092)

* add changelog fragment (#9092)

* update changelog fragment (#9092)

* compact code: make one line conditions with list comprehension and any()

Co-authored-by: Alexei Znamensky <[email protected]>

* fix syntax error: remove extra ')'

* fix changelog fragment type

Co-authored-by: Felix Fontein <[email protected]>

* add issue's link in changelog fragment

Co-authored-by: Felix Fontein <[email protected]>

---------

Co-authored-by: Alexei Znamensky <[email protected]>
Co-authored-by: Felix Fontein <[email protected]>
(cherry picked from commit 8fc11fe)

Co-authored-by: witrdotnet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug module module plugins plugin (any type)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants