openstack-ansible/scripts/upgrade-utilities/galera-cluster-rolling-restart.yml
Jesse Pretorius 3fb15ad780 Clean-up and simplify the major upgrade
The major upgrade procedure has been collecting new bits over time,
but has not really had bits cleaned out of it when unnecessary. Some
parts have also never been used.

This patch does the following:

1.  Consolidates the basic deploy node changes into a single playbook
    which is tagged, and therefore easy to run stand alone and use
    with skip-tags if necessary.
2.  Removes the ceph-galaxy-removal playbook which was for the P->Q
    upgrade only.
3.  Removes the ansible_fact_cleanup playbook and script - the first
    ran the second which was a bit pointless, given it could be done
    in a playbook task instead. This has been rolled into the
    deploy-config-changes playbook.
4.  Removes the memcached-flush playbook which was only actually
    required for the N->O upgrade. The functionality to enable the
    flush more surgically was enabled via a var in the keystone role
    in [a], so that can be used in the future if need be.
5.  Consolidates user-secrets-adjustment into the
    deploy-config-changes playbook, and also removes the var renames
    which were only appropriate for the Q->R upgrade.
6.  Removes the make_rst_table, migrate_openstack_vars and
    test_migrate_openstack_vars scripts which do not ever appear to
    have been used.
7.  Changes the limited playbook run for galera_all/rabbitmq_all from
    only doing lxc-containers-create.yml to all of setup_hosts to
    ensure that any hosts missed out in the previous step is handled
    in that step. This is useful if rabbitmq/galera are installed on
    hosts instead of in containers.
8.  Removed the extra backup of the /etc/openstack_deploy directory
    given that it is already archived by the run-upgrade script.
9.  Made the backup of the OSA configuration done in run-upgrade
    idempotent.
10. Removes the reference content for upgrades, given that most of
    it is duplicated and the simplified structure negates the need
    for a reference guide.
11. Change the infrastructure part of the upgrade to be simpler,
    and use the setup-infrastructure playbook.

[a] https://review.openstack.org/#/q/topic:bug/1793389
Related-Bug: #1808041
Change-Id: I58732dc181ee985364e97aa890987a98544ed06c
2019-01-23 10:45:09 +00:00

59 lines
1.7 KiB
YAML

---
# Copyright 2016, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Gracefully restart mariadb/galera cluster
hosts: galera_all
serial: 1
max_fail_percentage: 0
gather_facts: false
user: root
tasks:
- name: Stop mariadb
service:
name: mysql
state: stopped
retries: 5
delay: 10
- name: Stop container
lxc_container:
name: "{{ inventory_hostname }}"
state: "stopped"
delegate_to: "{{ physical_host }}"
- name: Start container
lxc_container:
name: "{{ inventory_hostname }}"
state: "started"
delegate_to: "{{ physical_host }}"
post_tasks:
- name: Wait for mariadb port 3306 to be available
wait_for:
port: "3306"
host: "{{ ansible_host | default(ansible_ssh_host | default(inventory_hostname)) }}"
retries: 10
delay: 10
delegate_to: "{{ groups['utility_all'][0] }}"
- name: Check that WSREP is ready and Synced
shell: "/usr/bin/mysqladmin extended-status | egrep '(wsrep_local_state_comment)'"
register: mysql_ready
until:
- mysql_ready.rc == 0
- (mysql_ready.stdout).find("Synced") != -1
retries: 60
delay: 1