diff --git a/roles/repo_setup/tasks/artifacts.yml b/roles/repo_setup/tasks/artifacts.yml index ebca6bf94b..204be70a1c 100644 --- a/roles/repo_setup/tasks/artifacts.yml +++ b/roles/repo_setup/tasks/artifacts.yml @@ -32,13 +32,25 @@ - name: Dump current-podified hash when using with component repo when: cifmw_repo_setup_component_name | length > 0 - ansible.builtin.get_url: - url: "{{ cifmw_repo_setup_dlrn_uri }}/{{ cifmw_repo_setup_os_release }}{{ cifmw_repo_setup_dist_major_version }}-{{ cifmw_repo_setup_branch }}/current-podified/delorean.repo.md5" - dest: "{{ cifmw_repo_setup_basedir }}/artifacts/repositories/delorean.repo.md5" + block: + - name: Dump current-podified hash + ansible.builtin.get_url: + url: "{{ cifmw_repo_setup_dlrn_uri }}/{{ cifmw_repo_setup_os_release }}{{ cifmw_repo_setup_dist_major_version }}-{{ cifmw_repo_setup_branch }}/current-podified/delorean.repo.md5" + dest: "{{ cifmw_repo_setup_basedir }}/artifacts/repositories/delorean.repo.md5" + + - name: Slurp current podified hash + ansible.builtin.slurp: + src: "{{ cifmw_repo_setup_basedir }}/artifacts/repositories/delorean.repo.md5" + register: _current_podified_hash - name: Export hashes facts for further use ansible.builtin.set_fact: - cifmw_repo_setup_full_hash: "{{ _repo_setup_json['full_hash'] }}" + cifmw_repo_setup_full_hash: >- + {% if cifmw_repo_setup_component_name | length > 0 -%} + "{{ _current_podified_hash['content'] | b64decode | trim }}" + {% else -%} + "{{ _repo_setup_json['full_hash'] }}" + {% endif -%} cifmw_repo_setup_commit_hash: "{{ _repo_setup_json['commit_hash'] }}" cifmw_repo_setup_distro_hash: "{{ _repo_setup_json['distro_hash'] }}" cifmw_repo_setup_extended_hash: "{{ _repo_setup_json['extended_hash'] }}"