From 52477fd5c8d9f217b0607df8daa1c4dd207f505f Mon Sep 17 00:00:00 2001 From: gregharvey Date: Wed, 15 Mar 2023 10:17:37 +0100 Subject: [PATCH] Refactoring cachetool path setting to match other squashfs vars. --- roles/_init/tasks/main.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/roles/_init/tasks/main.yml b/roles/_init/tasks/main.yml index e939def3..7f28f3ff 100644 --- a/roles/_init/tasks/main.yml +++ b/roles/_init/tasks/main.yml @@ -21,6 +21,9 @@ - name: Define live_symlink dest. ansible.builtin.set_fact: live_symlink_dest: "{{ live_symlink_dest | default('{{ deploy_base_path }}/live.{{ project_name }}_{{ build_type }}') }}" +- name: Define opcache cachetool path. + ansible.builtin.set_fact: + cachetool_bin: "{{ cachetool_bin | default('{{ deploy_base_path }}/cachetool.phar') }}" # Manipulate variables for SquashFS builds. - name: Define image builds base path. @@ -47,6 +50,12 @@ when: - deploy_code.mount_type is defined - deploy_code.mount_type == "squashfs" +- name: Overwrite cachetool path if SquashFS deploy. + ansible.builtin.set_fact: + cachetool_bin: "{{ cachetool_bin | default('{{ build_base_path }}/cachetool.phar') }}" + when: + - deploy_code.mount_type is defined + - deploy_code.mount_type == "squashfs" # Gather last known good build directly from symlink. # This can happen: @@ -105,18 +114,6 @@ when: - _project_type_task_result.stat.exists -- name: Define opcache cachetool path. - ansible.builtin.set_fact: - cachetool_bin: "{{ cachetool_bin | default('{{ deploy_base_path }}/cachetool.phar') }}" - when: deploy_code.mount_type != "squashfs" - -- name: Define opcache cachetool path if SquashFS deploy. - ansible.builtin.set_fact: - cachetool_bin: "{{ cachetool_bin | default('{{ build_base_path }}/cachetool.phar') }}" - when: - - deploy_code.mount_type is defined - - deploy_code.mount_type == "squashfs" - - name: Ensure we have a cachetool binary. ansible.builtin.import_role: name: cli/cachetool