Access token lifespan is too short for ansible run

This commit is contained in:
Ranabir Chakraborty 2024-12-03 22:12:36 +05:30
parent 0d0e52f9ff
commit d1859aaff2
3 changed files with 18 additions and 1 deletions

View file

@ -16,4 +16,4 @@ jobs:
with:
fqcn: 'middleware_automation/keycloak'
molecule_tests: >-
[ "default", "overridexml", "https_revproxy", "quarkus", "quarkus-devmode", "quarkus_upgrade", "debian", "quarkus_ha" ]
[ "default", "overridexml", "https_revproxy", "quarkus", "quarkus-devmode", "quarkus_upgrade", "debian", "quarkus_ha" ]

View file

@ -110,3 +110,6 @@
loop_control:
loop_var: client
when: "'users' in client"
- name: Provide Access token lifespan
ansible.builtin.include_tasks: manage_token_lifespan.yml

View file

@ -0,0 +1,14 @@
---
- name: "Update Access token lifespan"
ansible.builtin.uri:
url: "{{ keycloak_url }}{{ keycloak_context }}/admin/realms/{{ keycloak_realm }}"
method: PUT
body:
accessTokenLifespan: 300
validate_certs: false
body_format: json
status_code:
- 200
- 204
headers:
Authorization: "Bearer {{ keycloak_auth_response.json.access_token }}"