Closed Igortorrente closed 1 year ago
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.
cc @eikef @kris2kris @ndclt click here for bot help
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.
Kindly ping
@felixfontein
I don't use keycloak nor do I don't use these modules.
I don't use keycloak nor do I don't use these modules.
Do you know who's is maintaining these modules? Are they still being maintained?
The folks that are currently being listed as maintainers have been pinged by the bot. Also please note that this is not a support forum, but a bug tracker. Check out https://docs.ansible.com/ansible/latest/community/communication.html for better places for support questions.
I create this issue because I really thing these modules are broken. In the documentation they mention keycloak 8.0, and the current version is 20.
Hello @Igortorrente
I just run your script locally with the latest version of keycloak docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:20.0.2 start-dev
and it works
I think a bad gateway error is not an error of a up and running keycloak, it seems to be an error in your URL or in your configuration
Hi @kris2kris, I tried here, and I still having problem.
Example role
- name: The first run to setup the keycloak admin credentials.
community.docker.docker_container:
name: keycloak
image: quay.io/keycloak/keycloak:20.0.2
ports:
- "8080:8080/tcp"
- "8443:8443/tcp"
state: started
command: start-dev
env:
KEYCLOAK_ADMIN: "{{ keycloak['admin'] }}"
KEYCLOAK_ADMIN_PASSWORD: "{{ keycloak['admin_password'] }}"
docker_host: unix:///run/user/{{ ansible_user_uid }}/docker.sock
- name: Waits for keycloak.
ansible.builtin.wait_for:
host: 127.0.0.1
port: 8080
- name: Create or update main Keycloak realm
community.general.keycloak_realm:
auth_client_id: admin-cli
auth_keycloak_url: http://127.0.0.1:8080/auth
auth_realm: master
auth_username: "{{ keycloak['admin'] }}"
auth_password: "{{ keycloak['admin_password'] }}"
realm: main
id: main
state: present
TASK [roles/containers/infra/keycloak/ : The first run to setup the keycloak admin credentials.] ***
TASK [roles/containers/infra/keycloak/ : Create or update main Keycloak realm] ***
@Igortorrente you use /auth in Ansible url but you never set /auth as default url to keycloak
@Igortorrente you use /auth in Ansible url but you never set /auth as default url to keycloak
Do we configure it with KC_HOSTNAME_ADMIN_URL
? Can you provide an example how are you configuring the /auth
URL? Or paste your keycloak config and ansible playbook?
I tried several combinations but none of them worked.
Is this the same URL that we use to access the admin web interface?
I found the config. they are KC_HOSTNAME_PATH="/auth"
and KC_HTTP_RELATIVE_PATH="/auth"
. O we can simply use the base URL auth_keycloak_url: https://keycloak.example.com
Summary
I can't use
keycloak_realm
to configure my healm.I'm using Ansible to build and configure a custom
keycloak:19.0
to run behind a nginx reverse proxy (usingproxy=edge
). I'm using the official keycloak docker container.Everything runs fine, and I can access the admin console without any trouble. But for some reason I simply can't use the
keycloak_realm
to create and configure a newmain
healm.My proxy config:
According to the keycloak documentation
/admin
should work, and according to thekeycloak_realm
documentation/auth
should work, but both don't.Issue Type
Bug Report
Component Name
keycloak_realm
Ansible Version
Community.general Version
Configuration
OS / Environment
Debian testing
Steps to Reproduce
Expected Results
A successful tasks result.
Actual Results
The results of four different attempts
*200.0.0.1:10500 is the container loopback address and port
Code of Conduct