From 528c795f4cd007960614c47fdf2f4d7f537179a3 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 31 Jan 2023 14:01:53 +0200 Subject: [PATCH 1/4] fix_cachetool_removal_step --- roles/cli/cachetool/tasks/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index 2e042957..a4a7d078 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -3,6 +3,8 @@ ansible.builtin.file: path: "{{ cachetool_bin }}" state: absent + when: + - deploy_operation == 'deploy' - name: Download cachetool depending on latest php version installed. # If not specified manually, according to https://github.com/gordalina/cachetool#compatibility block: From a81488c786adb4535e05d5fad10251cd4be7d512 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 31 Jan 2023 14:09:36 +0200 Subject: [PATCH 2/4] fix task name --- roles/cli/cachetool/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index a4a7d078..499b9ebd 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -66,7 +66,7 @@ - deploy_operation == 'deploy' - cachetool.version | length == 0 -- name: "Download cachetool version {{ cachetool.version }} installer." +- name: "Download the specified {{ cachetool.version }} cachetool version installer." ansible.builtin.get_url: url: "http://gordalina.github.io/cachetool/downloads/cachetool-{{ cachetool.version }}.phar" dest: "{{ cachetool_bin }}" From 80b403947b59a4fbb807d2062f0c3f619a879bd0 Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 1 Feb 2023 17:20:14 +0200 Subject: [PATCH 3/4] fix_cachetool_removal_task --- roles/cli/cachetool/tasks/main.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index 499b9ebd..f0b99576 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -1,4 +1,11 @@ --- +- name: Ensure bin directory exists. + ansible.builtin.file: + path: "{{ cachetool_bin | dirname }}" + state: directory + when: + - deploy_operation == 'deploy' + - name: Remove previous cachetool if exists. ansible.builtin.file: path: "{{ cachetool_bin }}" From 6fff3176f672d0720fffdf59d6ff983337839afe Mon Sep 17 00:00:00 2001 From: tim Date: Wed, 1 Feb 2023 17:24:46 +0200 Subject: [PATCH 4/4] fix_cachetool_removal_task --- roles/cli/cachetool/tasks/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index f0b99576..f0f05b28 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -1,15 +1,15 @@ --- -- name: Ensure bin directory exists. +- name: Remove previous cachetool if exists. ansible.builtin.file: - path: "{{ cachetool_bin | dirname }}" - state: directory + path: "{{ cachetool_bin }}" + state: absent when: - deploy_operation == 'deploy' -- name: Remove previous cachetool if exists. +- name: Ensure bin directory exists. ansible.builtin.file: - path: "{{ cachetool_bin }}" - state: absent + path: "{{ cachetool_bin | dirname }}" + state: directory when: - deploy_operation == 'deploy'