ffu: Introduce Swift fast-forward upgrade tasks

fast_forward_upgrade_tasks for swift covering Ocata and Pike.
- Service status check
- Stop service when updating from Ocata to Pike
- Update swift packages

bp fast-forward-upgrades
Change-Id: I66879669cead2f7b5b2cd1398f344c063d771628
This commit is contained in:
Lee Yarwood 2017-12-04 12:10:33 +00:00 committed by Marius Cornea
parent 65b05c03d4
commit b627ccb686
2 changed files with 49 additions and 0 deletions

View File

@ -180,3 +180,18 @@ outputs:
- remove_swift_proxy_package|bool
metadata_settings:
get_attr: [SwiftProxyBase, role_data, metadata_settings]
fast_forward_upgrade_tasks:
- name: Check if swift-proxy or swift-object-expirer are deployed
command: systemctl is-enabled --quiet "{{ item }}"
register: swift_proxy_services_enabled
with_items:
- openstack-swift-proxy
- openstack-swift-object-expirer
ignore_errors: True
- name: Stop swift-proxy and swift-object-expirer services
service: name={{ item.item }} state=stopped enabled=no
with_items: "{{ swift_proxy_services_enabled.results }}"
when:
- step|int == 2
- release == 'ocata'
- item.rc == 0

View File

@ -538,3 +538,37 @@ outputs:
file:
path: /var/run/rsyncd.pid
state: absent
fast_forward_upgrade_tasks:
- name: Check if swift storage services are deployed
command: systemctl is-enabled --quiet "{{ item }}"
register: swift_services_enabled
with_items:
- openstack-swift-account-auditor
- openstack-swift-account-reaper
- openstack-swift-account-replicator
- openstack-swift-account
- openstack-swift-container-auditor
- openstack-swift-container-replicator
- openstack-swift-container-updater
- openstack-swift-container
- openstack-swift-object-auditor
- openstack-swift-object-replicator
- openstack-swift-object-updater
- openstack-swift-object
ignore_errors: True
- name: Stop swift storage services
service: name={{ item.item }} state=stopped enabled=no
with_items: "{{ swift_services_enabled.results }}"
when:
- step|int == 2
- release == 'ocata'
- item.rc == 0
- name: Update swift storage services
yum: name={{ item }} state=latest
with_items:
- openstack-swift-container
- openstack-swift-object
- openstack-swift-account
when:
- step|int == 6
- is_bootstrap_node|bool