Add FFU upgrade steps to Sahara services

Those steps should be enough to have Sahara properly working,
following the patterns established by other services:
- the non-containerized services are disabled between Ocata and Pike;
- the database is upgrades.

Closes-Bug: #1780134
Change-Id: I68c5e6c6dd969934c85409b8cee9919454e88474
This commit is contained in:
Luigi Toscano 2018-07-04 21:44:19 +02:00
parent 56dd8bd8a5
commit e38f6e9354
2 changed files with 50 additions and 0 deletions

View File

@ -185,3 +185,33 @@ outputs:
yum: name=openstack-sahara-api state=removed
ignore_errors: True
when: remove_sahara_api_package|bool
fast_forward_upgrade_tasks:
- name: FFU check openstack-sahara-api is enabled
command: systemctl is-enabled openstack-sahara-api
ignore_errors: True
register: sahara_api_enabled_result
when:
- step|int == 0
- release == 'ocata'
- name: Set fact sahara_api_enabled
set_fact:
sahara_api_enabled: "{{ sahara_api_enabled_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- name: FFU stop and disable openstack-sahara-api
service: name=openstack-sahara-api state=stopped enabled=no
when:
- step|int == 1
- release == 'ocata'
- sahara_api_enabled|bool
- name: FFU Sahara package update
shell: yum -y update openstack-sahara*
when:
- step|int == 6
- is_bootstrap_node|bool
- name: FFU Sahara db upgrade
command: sahara-db-manage --config-file /etc/sahara/sahara.conf upgrade head
when:
- step|int == 8
- is_bootstrap_node|bool

View File

@ -170,3 +170,23 @@ outputs:
yum: name=openstack-sahara-engine state=removed
ignore_errors: True
when: remove_sahara_engine_package|bool
fast_forward_upgrade_tasks:
- name: FFU check if openstack-sahara-engine is enabled
command: systemctl is-enabled --quiet openstack-sahara-engine
ignore_errors: True
register: sahara_engine_enabled_result
when:
- step|int == 0
- release == 'ocata'
- name: Set fact sahara_engine_enabled
set_fact:
sahara_engine_enabled: "{{ sahara_engine_enabled_result.rc == 0 }}"
when:
- step|int == 0
- release == 'ocata'
- name: FFU stop and disable openstack-sahara-engine service
when:
- step|int == 1
- release == 'ocata'
- sahara_engine_enabled|bool
service: name=openstack-sahara-engine state=stopped enabled=no