Don't run sync in upgrades

When running a rolling upgrade, each swift node is addressed
individually. This can result in undefined variables when a node doesn't
have the necessary SSH and ring information.

For minor upgrades, these changes are not necessary. They are only
necessary in fresh installs, or modifying storage capacity. Thus, this
patch checks to see if it's a new install (no swift venv_tag previously
defined) or it's the same version (current venv tag matches the previous
one) and only does syncs in those cases.

Change-Id: Ice3b4526609f5a5fd4472c8408de9ed08aea29e6
This commit is contained in:
Nolan Brubaker 2017-06-29 14:55:29 -04:00
parent 52228ba571
commit 176452bebf

View File

@ -84,15 +84,32 @@
tags:
- swift-config
# When doing rolling upgrades, we addres a single node at a time
# In these instances, the variables necessary to do sync/key work aren't available,
# nor is the sync/key updating necessary. Thus, skip that work on upgrade.
- name: Check if installing or upgrading
set_fact:
need_sync: True
when:
- ansible_local is defined
- ('swift' not in ansible_local['openstack_ansible'] or
'venv_tag' not in ansible_local['openstack_ansible']['swift'] or
ansible_local['openstack_ansible']['swift']['venv_tag'] == swift_venv_tag)
tags: swift-config
- include: swift_key_setup.yml
static: no
when: swift_do_sync | bool
when:
- swift_do_sync | bool
- need_sync is defined
tags:
- swift-config
- include: swift_rings.yml
static: no
when: swift_do_sync | bool
when:
- swift_do_sync | bool
- need_sync is defined
tags:
- swift-config
- swift-rings