From 172f288573b04c8c9fe7d54303ad60268750f253 Mon Sep 17 00:00:00 2001 From: tim Date: Mon, 30 Jan 2023 15:53:57 +0200 Subject: [PATCH 1/2] previous_cachetool_remove_before_install_new --- roles/cli/cachetool/tasks/main.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/roles/cli/cachetool/tasks/main.yml b/roles/cli/cachetool/tasks/main.yml index 12cba942..b075cf80 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -1,17 +1,8 @@ --- -- name: Check if we already have cachetool. - stat: - path: "{{ cachetool_bin }}" - register: cachetool_global - when: - - deploy_operation == 'deploy' - -- name: Ensure bin directory exists. +- name: Remove previous cachetool if exists. file: - path: "{{ cachetool_bin | dirname }}" - state: directory - when: - - deploy_operation == 'deploy' + path: "{{ cachetool_bin }}" + state: absent - name: Download cachetool depending on latest php version installed. # If not specified manually, according to https://github.com/gordalina/cachetool#compatibility block: @@ -71,7 +62,6 @@ when: - deploy_operation == 'deploy' - - not cachetool_global.stat.exists - cachetool.version | length == 0 - name: "Download cachetool version {{ cachetool.version }} installer." @@ -81,6 +71,5 @@ mode: 0755 when: - deploy_operation == 'deploy' - - not cachetool_global.stat.exists - cachetool.version is defined - cachetool.version | length > 0 From 741bdef2a264a2a939a3918e83445f51877dae95 Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 31 Jan 2023 12:51:51 +0200 Subject: [PATCH 2/2] namespace fix --- 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 b075cf80..2e042957 100644 --- a/roles/cli/cachetool/tasks/main.yml +++ b/roles/cli/cachetool/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Remove previous cachetool if exists. - file: + ansible.builtin.file: path: "{{ cachetool_bin }}" state: absent