From 9a026a77b2730cc35bbde45bfb5b53e9d6cf7678 Mon Sep 17 00:00:00 2001 From: Isaac Prior Date: Mon, 10 Aug 2020 16:18:38 +0100 Subject: [PATCH] Allow custom elements by appending existing ELEMENTS_PATH var Change-Id: I98f9f7c307d69bf6dc741508cd78a9fa94bc0c15 Story: 2008068 --- playbooks/roles/bifrost-create-dib-image/tasks/main.yml | 9 ++++++++- .../notes/allow-custom-elements-05c9495c8fd840e8.yaml | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/allow-custom-elements-05c9495c8fd840e8.yaml diff --git a/playbooks/roles/bifrost-create-dib-image/tasks/main.yml b/playbooks/roles/bifrost-create-dib-image/tasks/main.yml index 8465bbd78..6452a6e6a 100644 --- a/playbooks/roles/bifrost-create-dib-image/tasks/main.yml +++ b/playbooks/roles/bifrost-create-dib-image/tasks/main.yml @@ -132,9 +132,16 @@ set_fact: dib_env_vars_final: "{{dib_env_vars_final | combine({'DIB_RELEASE':dib_os_release}) }}" when: dib_os_release is defined +- name: "Build ELEMENTS_PATH variable from IPA builder element folder" + set_fact: + dib_elements_path: "{{ [ ipa_builder_git_folder + '/dib' ] }}" +- name: "Add existing ELEMENTS_PATH value if present" + set_fact: + dib_elements_path: "{{ dib_elements_path + [dib_env_vars_final['ELEMENTS_PATH']] }}" + when: "'ELEMENTS_PATH' in dib_env_vars_final" - name: "Set the ELEMENTS_PATH environment variable" set_fact: - dib_env_vars_final: "{{dib_env_vars_final | combine({'ELEMENTS_PATH': ipa_builder_git_folder + '/dib'}) }}" + dib_env_vars_final: "{{ dib_env_vars_final | combine({'ELEMENTS_PATH': dib_elements_path | join(':') }) }}" - name: "Set the DIB_BLOCK_DEVICE_CONFIG variable if set" set_fact: dib_env_vars_final: "{{ dib_env_vars_final | combine({'DIB_BLOCK_DEVICE_CONFIG': dib_partitioning}) }}" diff --git a/releasenotes/notes/allow-custom-elements-05c9495c8fd840e8.yaml b/releasenotes/notes/allow-custom-elements-05c9495c8fd840e8.yaml new file mode 100644 index 000000000..22511c084 --- /dev/null +++ b/releasenotes/notes/allow-custom-elements-05c9495c8fd840e8.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixes an issue where the bifrost-create-dib-image role + overrides any existing ELEMENTS_PATH environment variable + value. This fix appends any existing ELEMENTS_PATH + value to the path set in the role.