From e0664d53a9abb051a3736724a6d01e069dfb5ae0 Mon Sep 17 00:00:00 2001 From: Guido Grazioli Date: Wed, 9 Feb 2022 15:06:40 +0100 Subject: [PATCH] fix: copy from local only if target not existing --- roles/keycloak/tasks/install.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/roles/keycloak/tasks/install.yml b/roles/keycloak/tasks/install.yml index c5e5179..a5fd1eb 100644 --- a/roles/keycloak/tasks/install.yml +++ b/roles/keycloak/tasks/install.yml @@ -110,6 +110,12 @@ - not keycloak_offline_install - not keycloak_rhn_url in keycloak_rhsso_download_url +- name: Check downloaded archive + stat: + path: "{{ local_path.stat.path }}/{{ keycloak.bundle }}" + register: local_archive_path + delegate_to: localhost + ## copy and unpack - name: Copy archive to target nodes copy: @@ -119,6 +125,10 @@ group: "{{ keycloak_service_group }}" mode: 0750 register: new_version_downloaded + when: + - not archive_path.stat.exists + - local_archive_path.stat is defined + - local_archive_path.stat.exists become: yes - name: "Check target directory: {{ keycloak.home }}"