diff --git a/playbooks/multinode-overcloud-upgrade.yml b/playbooks/multinode-overcloud-upgrade.yml index e04084bd3..7e29d8130 100644 --- a/playbooks/multinode-overcloud-upgrade.yml +++ b/playbooks/multinode-overcloud-upgrade.yml @@ -14,7 +14,10 @@ when: containerized_overcloud_upgrade|default(false)|bool - role: build-test-packages - role: install-built-repo - when: hostvars['undercloud']['compressed_gating_repo'] is defined and mixed_upgrade|default(false)|bool + when: + - hostvars['undercloud']['compressed_gating_repo'] is defined + - hostvars['undercloud']['compressed_gating_repo'] + - mixed_upgrade|default(false)|bool - name: Prepare containers for Upgrade hosts: undercloud diff --git a/playbooks/multinode-standalone.yml b/playbooks/multinode-standalone.yml index d35498af0..aa47e45d4 100644 --- a/playbooks/multinode-standalone.yml +++ b/playbooks/multinode-standalone.yml @@ -22,7 +22,8 @@ artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz" roles: - build-test-packages - - { role: install-built-repo, when: compressed_gating_repo is defined } + - role: install-built-repo + when: compressed_gating_repo is defined and compressed_gating_repo tags: - build diff --git a/playbooks/multinode-undercloud-upgrade.yml b/playbooks/multinode-undercloud-upgrade.yml index 65a1ecd71..0deb4d15b 100644 --- a/playbooks/multinode-undercloud-upgrade.yml +++ b/playbooks/multinode-undercloud-upgrade.yml @@ -12,7 +12,8 @@ roles: - role: repo-setup - role: build-test-packages - - { role: install-built-repo, when: compressed_gating_repo is defined } + - role: install-built-repo + when: compressed_gating_repo is defined and compressed_gating_repo - name: Run tripleo-upgrade role to upgrade undercloud hosts: undercloud diff --git a/playbooks/multinode-undercloud.yml b/playbooks/multinode-undercloud.yml index f442fdef2..31303eae9 100644 --- a/playbooks/multinode-undercloud.yml +++ b/playbooks/multinode-undercloud.yml @@ -41,7 +41,8 @@ artg_compressed_gating_repo: "${HOME}/gating_repo.tar.gz" roles: - build-test-packages - - { role: install-built-repo, when: compressed_gating_repo is defined } + - role: install-built-repo + when: compressed_gating_repo is defined and compressed_gating_repo tags: - build @@ -53,7 +54,10 @@ - role: repo-setup when: not mixed_upgrade|default(false)|bool - role: install-built-repo - when: hostvars['undercloud']['compressed_gating_repo'] is defined and not mixed_upgrade|default(false)|bool + when: + - hostvars['undercloud']['compressed_gating_repo'] is defined + - hostvars['undercloud']['compressed_gating_repo'] + - not mixed_upgrade|default(false)|bool tags: - build diff --git a/playbooks/ovb-setup.yml b/playbooks/ovb-setup.yml index 42642569d..f3324c63a 100644 --- a/playbooks/ovb-setup.yml +++ b/playbooks/ovb-setup.yml @@ -43,8 +43,10 @@ artg_repos_dir: "{{ repo_clone_dir|default('/opt/stack/new') }}" ib_create_web_repo: "{{ to_build|bool }}" roles: - - { role: build-test-packages, when: build_test_packages|default(false)|bool } - - { role: install-built-repo, when: compressed_gating_repo is defined } + - role: build-test-packages + when: build_test_packages|default(false)|bool + - role: install-built-repo + when: compressed_gating_repo is defined and compressed_gating_repo tags: - build @@ -58,9 +60,29 @@ modify_image_vc_cpu: 4 modify_image_vc_verbose: true roles: - - { role: fetch-images, when: not to_build|bool } - - { role: repo-setup, repo_inject_image_path: "$HOME/overcloud-full.qcow2", repo_run_live: false, when: not to_build|bool } - - { role: repo-setup, repo_inject_image_path: "$HOME/ironic-python-agent.initramfs", repo_run_live: false, initramfs_image: true, libguestfs_mode: false, when: not to_build|bool } - - { role: install-built-repo, ib_repo_image_path: "$HOME/overcloud-full.qcow2", when: compressed_gating_repo is defined and not to_build|bool } - - { role: install-built-repo, ib_repo_image_path: "$HOME/ironic-python-agent.initramfs", initramfs_image: true, libguestfs_mode: false, when: compressed_gating_repo is defined and not to_build|bool } - + - role: fetch-images + when: not to_build|bool + - role: repo-setup + repo_inject_image_path: "$HOME/overcloud-full.qcow2" + repo_run_live: false + when: not to_build|bool + - role: repo-setup + repo_inject_image_path: "$HOME/ironic-python-agent.initramfs" + repo_run_live: false + initramfs_image: true + libguestfs_mode: false + when: not to_build|bool + - role: install-built-repo + ib_repo_image_path: "$HOME/overcloud-full.qcow2" + when: + - compressed_gating_repo is defined + - compressed_gating_repo + - not to_build|bool + - role: install-built-repo + ib_repo_image_path: "$HOME/ironic-python-agent.initramfs" + initramfs_image: true + libguestfs_mode: false + when: + - compressed_gating_repo is defined + - compressed_gating_repo + - not to_build|bool diff --git a/roles/build-test-packages/tasks/main.yml b/roles/build-test-packages/tasks/main.yml index 792565e4c..a45d4cec4 100644 --- a/roles/build-test-packages/tasks/main.yml +++ b/roles/build-test-packages/tasks/main.yml @@ -195,3 +195,9 @@ when: - repo_built is defined - repo_built.skipped is not defined + +- name: Don't trigger repo injection if nothing is built + set_fact: + compressed_gating_repo: "" + cacheable: true + when: repo_built is not defined or repo_built.skipped is defined