Skip to content

Commit

Permalink
Merge pull request #250 from world-direct/feature/249
Browse files Browse the repository at this point in the history
Rebuild config and restart service for local providers
  • Loading branch information
guidograzioli authored Nov 25, 2024
2 parents 333d55a + 68a0f88 commit 0d0e52f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion roles/keycloak_quarkus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ keycloak_quarkus_providers:
- id: http-client # required; "{{ id }}.jar" identifies the file name on RHBK
spi: connections # required if neither url, local_path nor maven are specified; required for setting properties
default: true # optional, whether to set default for spi, default false
restart: true # optional, whether to restart, default true
restart: true # optional, whether to rebuild config and restart the service after deploying, default true
url: https://.../.../custom_spi.jar # optional, url for download via http
local_path: my_theme_spi.jar # optional, path on local controller for SPI to be uploaded
maven: # optional, for download using maven
Expand Down
7 changes: 4 additions & 3 deletions roles/keycloak_quarkus/tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
become: true
loop: "{{ keycloak_quarkus_providers }}"
when: item.url is defined and item.url | length > 0
notify: "{{ ['rebuild keycloak config', 'restart keycloak'] if not item.restart is defined or not item.restart else [] }}"
notify: "{{ ['rebuild keycloak config', 'restart keycloak'] if not item.restart is defined or item.restart else [] }}"

# this requires the `lxml` package to be installed; we redirect this step to localhost such that we do need to install it on the remote hosts
- name: "Download custom providers to localhost using maven"
Expand All @@ -235,7 +235,7 @@
loop: "{{ keycloak_quarkus_providers }}"
when: item.maven is defined
no_log: "{{ item.maven.password is defined and item.maven.password | length > 0 | default(false) }}"
notify: "{{ ['rebuild keycloak config', 'restart keycloak'] if not item.restart is defined or not item.restart else [] }}"
notify: "{{ ['rebuild keycloak config', 'restart keycloak'] if not item.restart is defined or item.restart else [] }}"

- name: "Copy maven providers"
ansible.builtin.copy:
Expand All @@ -249,7 +249,7 @@
when: item.maven is defined
no_log: "{{ item.maven.password is defined and item.maven.password | length > 0 | default(false) }}"

- name: "Copy providers"
- name: "Copy local providers"
ansible.builtin.copy:
src: "{{ item.local_path }}"
dest: "{{ keycloak.home }}/providers/{{ item.id }}.jar"
Expand All @@ -259,6 +259,7 @@
become: true
loop: "{{ keycloak_quarkus_providers }}"
when: item.local_path is defined
notify: "{{ ['rebuild keycloak config', 'restart keycloak'] if not item.restart is defined or item.restart else [] }}"

- name: Ensure required folder structure for policies exists
ansible.builtin.file:
Expand Down

0 comments on commit 0d0e52f

Please sign in to comment.