Merge "Make upgrade jobs get role relevant versions"

This commit is contained in:
Zuul 2020-08-15 03:17:24 +00:00 committed by Gerrit Code Review
commit 3be600185a
2 changed files with 9 additions and 3 deletions

View File

@ -213,6 +213,7 @@ if [[ "${ACTION}" == "upgrade" ]]; then
unset ANSIBLE_PACKAGE
unset UPPER_CONSTRAINTS_FILE
unset PIP_OPTS
unset UPGRADE_TARGET_BRANCH
load_nodepool_pip_opts
@ -221,6 +222,11 @@ if [[ "${ACTION}" == "upgrade" ]]; then
# We need this as in stein we were deploying custom
# /etc/openstack_deploy/env.d/aio_metal.yml for metal installs
export SKIP_CUSTOM_ENVD_CHECK=true
export DROP_ROLE_DIRS=true
# NOTE(noonedeadpunk): This might be moved to zuul.d/playbooks/run.yaml
export ZUUL_SRC_PATH="/home/zuul/src"
# Doing symlinking here, as bootstrap role won't be called
ln -s $ZUUL_SRC_PATH /openstack/src
# To execute the upgrade script we need to provide
# an affirmative response to the warning that the
# upgrade is irreversable.

View File

@ -24,8 +24,8 @@
path: "{{ item.path | default(role_path_default) }}/{{ item.name | default(item.src | basename) }}"
state: absent
when:
- item.scm == "git" or item.scm is undefined
- "(item.path | default(role_path_default) ~ '/' ~ item.name | default(item.src | basename) ~ '/.git') is not directory"
- ((item.path | default(role_path_default) ~ '/' ~ item.name | default(item.src | basename) ~ '/.git') is not directory) or
(lookup('env', 'DROP_ROLE_DIRS') | bool is true)
with_items: "{{ required_roles }}"
- name: Ensure the default roles directory exists
@ -95,7 +95,7 @@
when:
- "lookup('env', 'ZUUL_SRC_PATH') != ''"
- "lookup('env', 'UPGRADE_TARGET_BRANCH') == ''"
- name: Generate a list of user overridden roles
set_fact:
user_overridden_roles: "{{ user_roles | json_query('[*].name') }}"