Merge "Include P-Q changes into the upgrade script"

This commit is contained in:
Zuul 2018-01-22 12:28:45 +00:00 committed by Gerrit Code Review
commit bab51e2967
3 changed files with 48 additions and 20 deletions

View File

@ -38,6 +38,22 @@ From the ``openstack-ansible`` root directory, run the following commands:
# export SCRIPTS_PATH="${MAIN_PATH}/scripts" # export SCRIPTS_PATH="${MAIN_PATH}/scripts"
# export UPGRADE_PLAYBOOKS="${SCRIPTS_PATH}/upgrade-utilities/playbooks" # export UPGRADE_PLAYBOOKS="${SCRIPTS_PATH}/upgrade-utilities/playbooks"
Deal with existing OpenStack-Ansible artifacts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The deployment node may have previous branch artifacts.
Unset the following environment variables first:
.. code-block:: console
# unset ANSIBLE_INVENTORY
Optionally, take a backup of your environment:
.. code-block:: console
# tar zcf /openstack/previous-ansible_`date +%F_%H%M`.tar.gz /etc/openstack_deploy /etc/ansible/ /usr/local/bin/openstack-ansible.rc
Bootstrap Ansible again Bootstrap Ansible again
~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
@ -167,15 +183,6 @@ fashion.
# openstack-ansible "${UPGRADE_PLAYBOOKS}/galera-cluster-rolling-restart.yml" # openstack-ansible "${UPGRADE_PLAYBOOKS}/galera-cluster-rolling-restart.yml"
Update HAProxy configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Install and update any new or changed HAProxy service configurations.
.. code-block:: console
# openstack-ansible haproxy-install.yml
Update repository servers Update repository servers
~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~
@ -186,6 +193,24 @@ required by the |current_release_formal_name| release.
# openstack-ansible repo-install.yml # openstack-ansible repo-install.yml
Update HAProxy configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Install and update any new or changed HAProxy service configurations.
.. code-block:: console
# openstack-ansible haproxy-install.yml
Use the repository servers
~~~~~~~~~~~~~~~~~~~~~~~~~~
Now all containers can be pointed to the repo server's VIPs.
.. code-block:: console
# openstack-ansible repo-use.yml
Upgrade the MariaDB version Upgrade the MariaDB version
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -217,7 +217,6 @@ def _build_container_hosts(container_affinity, container_hosts, type_and_name,
du.append_if(array=container_mapping, item=host_type_containers) du.append_if(array=container_mapping, item=host_type_containers)
hostvars_options.update({ hostvars_options.update({
'properties': properties,
'ansible_host': address, 'ansible_host': address,
'container_address': address, 'container_address': address,
'container_name': container_host_name, 'container_name': container_host_name,
@ -225,6 +224,8 @@ def _build_container_hosts(container_affinity, container_hosts, type_and_name,
'physical_host_group': physical_host_type, 'physical_host_group': physical_host_type,
'component': assignment 'component': assignment
}) })
if 'properties' not in hostvars_options:
hostvars_options['properties'] = properties
def _append_container_types(inventory, host_type): def _append_container_types(inventory, host_type):
@ -810,7 +811,7 @@ def _ensure_inventory_uptodate(inventory, container_skel):
if hosts: if hosts:
for host in hosts: for host in hosts:
container = host_vars[host] container = host_vars[host]
if 'properties' in type_vars: if 'properties' in type_vars and 'properties' not in container:
logger.debug("Copied propeties for %s from skeleton", logger.debug("Copied propeties for %s from skeleton",
container) container)
container['properties'] = type_vars['properties'] container['properties'] = type_vars['properties']

View File

@ -162,13 +162,14 @@ function main {
pre_flight pre_flight
check_for_current check_for_current
"${SCRIPTS_PATH}/bootstrap-ansible.sh" # ANSIBLE_INVENTORY location has changed between P and Q, so we ensure
# we don't point to previous inventory.
unset ANSIBLE_INVENTORY
# Unset environment variables used by the override_folder # Archive previous version artifacts
# plugin to set paths for group and host vars since the tar zcf /openstack/previous-ansible_`date +%F_%H%M`.tar.gz /etc/openstack_deploy /etc/ansible/ /usr/local/bin/openstack-ansible.rc
# default locations have changed between Ocata and Pike.
unset GROUP_VARS_PATH "${SCRIPTS_PATH}/bootstrap-ansible.sh"
unset HOST_VARS_PATH
pushd ${MAIN_PATH}/playbooks pushd ${MAIN_PATH}/playbooks
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/ansible_fact_cleanup.yml") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/ansible_fact_cleanup.yml")
@ -180,15 +181,16 @@ function main {
RUN_TASKS+=("setup-hosts.yml --limit '!galera_all'") RUN_TASKS+=("setup-hosts.yml --limit '!galera_all'")
# add new container config to galera containers but don't restart # add new container config to galera containers but don't restart
RUN_TASKS+=("lxc-containers-create.yml -e 'lxc_container_allow_restarts=false' --limit galera_all") RUN_TASKS+=("lxc-containers-create.yml -e 'lxc_container_allow_restarts=false' --limit galera_all")
RUN_TASKS+=("haproxy-install.yml") # setup infra
# rebuild the repo servers RUN_TASKS+=("unbound-install.yml")
RUN_TASKS+=("repo-install.yml") RUN_TASKS+=("repo-install.yml")
RUN_TASKS+=("haproxy-install.yml")
RUN_TASKS+=("repo-use.yml")
# explicitly perform mariadb upgrade # explicitly perform mariadb upgrade
RUN_TASKS+=("galera-install.yml -e 'galera_upgrade=true'") RUN_TASKS+=("galera-install.yml -e 'galera_upgrade=true'")
# explicitly perform controlled galera cluster restart # explicitly perform controlled galera cluster restart
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/galera-cluster-rolling-restart.yml") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/galera-cluster-rolling-restart.yml")
# individually run each of the remaining plays from setup-infrastructure # individually run each of the remaining plays from setup-infrastructure
RUN_TASKS+=("unbound-install.yml")
RUN_TASKS+=("memcached-install.yml") RUN_TASKS+=("memcached-install.yml")
RUN_TASKS+=("rabbitmq-install.yml -e 'rabbitmq_upgrade=true'") RUN_TASKS+=("rabbitmq-install.yml -e 'rabbitmq_upgrade=true'")
RUN_TASKS+=("etcd-install.yml") RUN_TASKS+=("etcd-install.yml")