fix: unpack archive only if needed

main
Guido Grazioli 2022-01-28 15:18:49 +01:00
parent 99c14a79da
commit b73f187930
No known key found for this signature in database
GPG Key ID: 22C8C31EF2BC093B
1 changed files with 2 additions and 12 deletions

View File

@ -121,22 +121,12 @@
register: new_version_downloaded register: new_version_downloaded
become: yes become: yes
- name: "Check work directory: {{ keycloak_dest }}" - name: "Check target directory: {{ keycloak.home }}"
stat: stat:
path: "{{ keycloak_dest }}" path: "{{ keycloak.home }}"
register: path_to_workdir register: path_to_workdir
become: yes become: yes
- name: "Create work directory {{ keycloak_dest }}"
file:
path: "{{ keycloak_dest }}"
state: directory
owner: "{{ keycloak_service_user }}"
group: "{{ keycloak_service_group }}"
mode: 0750
become: yes
when: not path_to_workdir.stat.exists
- name: "Extract {{ 'Red Hat Single Sign-On' if keycloak_rhsso_enable else 'Keycloak' }} archive on target" - name: "Extract {{ 'Red Hat Single Sign-On' if keycloak_rhsso_enable else 'Keycloak' }} archive on target"
unarchive: unarchive:
remote_src: yes remote_src: yes