diff --git a/roles/_init/tasks/main.yml b/roles/_init/tasks/main.yml index 676d97bd..21b48dc3 100644 --- a/roles/_init/tasks/main.yml +++ b/roles/_init/tasks/main.yml @@ -39,18 +39,6 @@ - cache_clear_opcache.cachetool_bin is defined - cache_clear_opcache.cachetool_bin | length > 0 -- name: Define path to clear cache. - ansible.builtin.set_fact: - cache_clear_base_path: "{{ deploy_path }}" - when: - - deploy_operation != 'cleanup' - -- name: Define path to clear cache. - ansible.builtin.set_fact: - cache_clear_base_path: "{{ cache_clear_base_path | default('{{ deploy_path_prefix }}{{ build_number }}') }}" - when: - - deploy_operation == 'cleanup' - - name: Manipulate variables for SquashFS builds. block: - name: Define image builds base path. @@ -83,6 +71,18 @@ - deploy_code.mount_type is defined - deploy_code.mount_type == "squashfs" +- name: Define path to clear cache for the deploy step. + ansible.builtin.set_fact: + cache_clear_base_path: "{{ deploy_path }}" + when: + - deploy_operation != 'cleanup' + +- name: Define path to clear cache for the cleanup step. + ansible.builtin.set_fact: + cache_clear_base_path: "{{ cache_clear_base_path | default('{{ deploy_path_prefix }}{{ build_number }}') }}" + when: + - deploy_operation == 'cleanup' + # Gather last known good build directly from symlink. # This can happen: # - when the first builds failed,