Work on starting the upgrade job

* Add a new variable UPGRADE_BASEBRANCH and use that to check out a
stable branch, then run the bootstrap process. This will require a
change to project-config so that the job names will add in the branch
name, so we can pick it up instead of providing a value when none is
present.

* Add a section to confd_overrides for the upgrade scenario to fix the
following error

    TASK [bootstrap-host : Deploy user conf.d configuration] ***********************
    fatal: [localhost]: FAILED! => {"failed":
    true, "msg": "{{ confd_overrides[scenario] }}: 'dict object' has no
    attribute u'upgrade'"}

Change-Id: Ia5fd197e81da0a1fd55327d155f181c8792bc199
This commit is contained in:
Sean M. Collins 2017-01-10 13:56:53 -05:00
parent 93412056dc
commit 3c8548b265
2 changed files with 42 additions and 0 deletions

View File

@ -32,6 +32,12 @@ export ANSIBLE_ROLE_FETCH_MODE="git-clone"
# Set the scenario to execute based on the first CLI parameter
export SCENARIO=${1:-"aio"}
# TODO(sc68cal) update the job configs to have the stable branch
# So we have job names like:
# gate-openstack-ansible-openstack-ansible-upgrade-newton-ubuntu-xenial-nv
export UPGRADE_BASEBRANCH=${2:-"newton"}
export SCENARIO_BACKUP=${SCENARIO_BACKUP:-''}
## Functions -----------------------------------------------------------------
info_block "Checking for required libraries." 2> /dev/null || source "$(dirname "${0}")/scripts-library.sh"
@ -42,6 +48,16 @@ trap gate_job_exit_tasks EXIT
# Log some data about the instance and the rest of the system
log_instance_info
if [[ "$SCENARIO" == "upgrade" ]]; then
# First, check out the base branch and build an AIO
git checkout origin/stable/$UPGRADE_BASEBRANCH
# Do a quick swap of SCENARIO since the newton branch doesn't know about the upgrade scenario
export SCENARIO_BACKUP=$SCENARIO
SCENARIO="aio"
fi
# Get minimum disk size
DATA_DISK_MIN_SIZE="$((1024**3 * $(awk '/bootstrap_host_data_disk_min_size/{print $2}' "$(dirname "${0}")/../tests/roles/bootstrap-host/defaults/main.yml") ))"
@ -106,4 +122,16 @@ bash "$(dirname "${0}")/run-playbooks.sh"
# Log some data about the instance and the rest of the system
log_instance_info
if [ ! -z $SCENARIO_BACKUP ]; then
# Restore the scenario from L56
SCENARIO=$SCENARIO_BACKUP
fi
if [[ "$SCENARIO" == "upgrade" ]]; then
# Hopefully we can re-check out the patch from Zuul.
git checkout FETCH_HEAD
export I_REALLY_KNOW_WHAT_I_AM_DOING=true
bash "$(dirname "${0}")/run-upgrade.sh"
fi
exit_success

View File

@ -46,6 +46,20 @@
- name: keystone.yml.aio
- name: neutron.yml.aio
- name: nova.yml.aio
upgrade:
# This starts as an AIO box, then an upgrade is run
- name: aodh.yml.aio
- name: cinder.yml.aio
- name: ceilometer.yml.aio
- name: designate.yml.aio
- name: glance.yml.aio
- name: gnocchi.yml.aio
- name: heat.yml.aio
- name: horizon.yml.aio
- name: keystone.yml.aio
- name: neutron.yml.aio
- name: nova.yml.aio
- name: swift.yml.aio
vars:
scenario: "{{ lookup('env','SCENARIO') | default('aio', true) }}"
sshd: