Added update option to update env.
This commit is contained in:
parent
7b362926e5
commit
250db48e09
|
@ -3,3 +3,4 @@ keycloak_home: "/opt/keycloak/keycloak-10.0.2"
|
||||||
keycloak_modules: "{{ keycloak_home }}/modules"
|
keycloak_modules: "{{ keycloak_home }}/modules"
|
||||||
keycloak_themes: "{{ keycloak_home }}/themes"
|
keycloak_themes: "{{ keycloak_home }}/themes"
|
||||||
keycloak_deployments: "{{ keycloak_home }}/standalone/deployments"
|
keycloak_deployments: "{{ keycloak_home }}/standalone/deployments"
|
||||||
|
update: false
|
||||||
|
|
|
@ -23,11 +23,17 @@
|
||||||
mode: "u=rwx,g=rwx,o="
|
mode: "u=rwx,g=rwx,o="
|
||||||
remote_src: "yes"
|
remote_src: "yes"
|
||||||
|
|
||||||
- name: "Check if the storage-module is already installed"
|
- name: "Check if the avatar-storage module is already installed"
|
||||||
stat:
|
stat:
|
||||||
path: "{{ keycloak_modules }}/org/gcube/keycloak/avatar-storage/main"
|
path: "{{ keycloak_modules }}/org/gcube/keycloak/avatar-storage/main"
|
||||||
register: storagemodule
|
register: storagemodule
|
||||||
|
|
||||||
|
- name "Remove old avatar-storage module"
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ keycloak_modules }}/org/gcube/keycloak/avatar-storage"
|
||||||
|
state: absent
|
||||||
|
when: storagemodule.stat.exists and update
|
||||||
|
|
||||||
- name: "Download avatar-storage JAR from Maven repo"
|
- name: "Download avatar-storage JAR from Maven repo"
|
||||||
maven_artifact:
|
maven_artifact:
|
||||||
group_id: org.gcube
|
group_id: org.gcube
|
||||||
|
@ -36,13 +42,13 @@
|
||||||
repository_url: 'https://maven.research-infrastructures.eu/nexus/content/repositories/gcube-staging-jenkins'
|
repository_url: 'https://maven.research-infrastructures.eu/nexus/content/repositories/gcube-staging-jenkins'
|
||||||
dest: "/tmp/avatar-storage.jar"
|
dest: "/tmp/avatar-storage.jar"
|
||||||
verify_checksum: "always"
|
verify_checksum: "always"
|
||||||
when: not storagemodule.stat.exists
|
when: not storagemodule.stat.exists or update
|
||||||
|
|
||||||
- name: "Install avatar-storage Keycloak module"
|
- name: "Install avatar-storage Keycloak module"
|
||||||
shell:
|
shell:
|
||||||
cmd: './bin/jboss-cli.sh --command="module add --name=org.gcube.keycloak.avatar-storage --resources=/tmp/avatar-storage.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-services,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.jboss.logging"'
|
cmd: './bin/jboss-cli.sh --command="module add --name=org.gcube.keycloak.avatar-storage --resources=/tmp/avatar-storage.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-services,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.jboss.logging"'
|
||||||
chdir: "{{ keycloak_home }}"
|
chdir: "{{ keycloak_home }}"
|
||||||
when: not storagemodule.stat.exists
|
when: not storagemodule.stat.exists or update
|
||||||
|
|
||||||
- name: "Switch ON Keycloak server instance"
|
- name: "Switch ON Keycloak server instance"
|
||||||
service:
|
service:
|
||||||
|
@ -58,6 +64,7 @@
|
||||||
shell:
|
shell:
|
||||||
cmd: './bin/jboss-cli.sh --connect --controller=localhost:9990 --command="/subsystem=keycloak-server:list-add(name=providers, value=module:org.gcube.keycloak.avatar-storage)"'
|
cmd: './bin/jboss-cli.sh --connect --controller=localhost:9990 --command="/subsystem=keycloak-server:list-add(name=providers, value=module:org.gcube.keycloak.avatar-storage)"'
|
||||||
chdir: "{{ keycloak_home }}"
|
chdir: "{{ keycloak_home }}"
|
||||||
|
when: not storagemodule.stat.exists
|
||||||
|
|
||||||
- name: "Restart Keycloak server instance to load new provider configuration"
|
- name: "Restart Keycloak server instance to load new provider configuration"
|
||||||
service:
|
service:
|
||||||
|
@ -89,7 +96,3 @@
|
||||||
mode: "u=rw,g=rw,o="
|
mode: "u=rw,g=rw,o="
|
||||||
remote_src: "yes"
|
remote_src: "yes"
|
||||||
|
|
||||||
- name: "Waiting for EAR deploy"
|
|
||||||
pause:
|
|
||||||
seconds: 15
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue