diff --git a/roles/_init/tasks/main.yml b/roles/_init/tasks/main.yml index 53be27d3..effa2790 100644 --- a/roles/_init/tasks/main.yml +++ b/roles/_init/tasks/main.yml @@ -26,19 +26,27 @@ - name: Define image builds base path. ansible.builtin.set_fact: build_base_path: "/home/{{ deploy_user }}/builds/{{ project_name }}_{{ build_type }}" - when: deploy_code.mount_type == "squashfs" + when: + - deploy_code.mount_type is defined + - deploy_code.mount_type == "squashfs" - name: Define image builds build path prefix. ansible.builtin.set_fact: build_path_prefix: "{{ build_base_path }}/{{ project_name }}_{{ build_type }}_build_" - when: deploy_code.mount_type == "squashfs" + when: + - deploy_code.mount_type is defined + - deploy_code.mount_type == "squashfs" - name: Define live_symlink dest for image builds. ansible.builtin.set_fact: live_symlink_build_dest: "{{ live_symlink_build_dest | default('{{ build_base_path }}/live.{{ project_name }}_{{ build_type }}') }}" - when: deploy_code.mount_type == "squashfs" + when: + - deploy_code.mount_type is defined + - deploy_code.mount_type == "squashfs" - name: Overwrite deploy and live_symlink paths if SquashFS deploy. ansible.builtin.set_fact: deploy_path: "{{ build_path | default('{{ build_path_prefix }}{{ build_number }}') }}" - when: deploy_code.mount_type == "squashfs" + when: + - deploy_code.mount_type is defined + - deploy_code.mount_type == "squashfs" # Gather last known good build directly from symlink. # This can happen: @@ -80,7 +88,9 @@ ansible.builtin.file: path: "{{ build_base_path }}" state: directory - when: deploy_code.mount_type == "squashfs" + when: + - deploy_code.mount_type is defined + - deploy_code.mount_type == "squashfs" # Check for project specific init tasks. - name: Check that {{ project_type }}.yml exists.