7c84a9b390
During upgrades, validation test if a service is running before the upgrade process starts. In some cases, servies doesn't exist yet so we don't want to run the validation. This patch makes sure we check if the service is actually present on the system before validating it's running correctly. Also it makes sure that services are enabled before trying to stop them. It allows use-cases where we want to add new services during an upgrade. Also install new packages of services added in Ocata, so we can validate upgrades on scenarios jobs. Change-Id: Ib48fb6b1557be43956557cbde4cbe26b53a50bd8
87 lines
3.6 KiB
YAML
87 lines
3.6 KiB
YAML
heat_template_version: ocata
|
|
|
|
description: >
|
|
Openstack Zaqar service. Shared for all Heat services.
|
|
|
|
parameters:
|
|
ServiceNetMap:
|
|
default: {}
|
|
description: Mapping of service_name -> network name. Typically set
|
|
via parameter_defaults in the resource registry. This
|
|
mapping overrides those in ServiceNetMapDefaults.
|
|
type: json
|
|
EndpointMap:
|
|
default: {}
|
|
description: Mapping of service endpoint -> protocol. Typically set
|
|
via parameter_defaults in the resource registry.
|
|
type: json
|
|
DefaultPasswords:
|
|
default: {}
|
|
type: json
|
|
Debug:
|
|
default: ''
|
|
description: Set to True to enable debugging on all services.
|
|
type: string
|
|
ZaqarPassword:
|
|
description: The password for Zaqar
|
|
type: string
|
|
hidden: true
|
|
KeystoneRegion:
|
|
type: string
|
|
default: 'regionOne'
|
|
description: Keystone region for endpoint
|
|
|
|
|
|
outputs:
|
|
role_data:
|
|
description: Shared role data for the Heat services.
|
|
value:
|
|
service_name: zaqar
|
|
config_settings:
|
|
zaqar::keystone::authtoken::password: {get_param: ZaqarPassword}
|
|
zaqar::keystone::authtoken::project_name: 'service'
|
|
zaqar::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
|
|
zaqar::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri]}
|
|
zaqar::debug: {get_param: Debug}
|
|
zaqar::transport::websocket::bind: {get_param: [EndpointMap, ZaqarInternal, host]}
|
|
zaqar::transport::wsgi::bind: {get_param: [ServiceNetMap, ZaqarApiNetwork]}
|
|
zaqar::message_pipeline: 'zaqar.notification.notifier'
|
|
zaqar::unreliable: true
|
|
service_config_settings:
|
|
keystone:
|
|
zaqar::keystone::auth::password: {get_param: ZaqarPassword}
|
|
zaqar::keystone::auth::public_url: {get_param: [EndpointMap, ZaqarPublic, uri]}
|
|
zaqar::keystone::auth::admin_url: {get_param: [EndpointMap, ZaqarAdmin, uri]}
|
|
zaqar::keystone::auth::internal_url: {get_param: [EndpointMap, ZaqarInternal, uri]}
|
|
zaqar::keystone::auth::region: {get_param: KeystoneRegion}
|
|
zaqar::keystone::auth::tenant: 'service'
|
|
zaqar::keystone::auth_websocket::password: {get_param: ZaqarPassword}
|
|
zaqar::keystone::auth_websocket::public_url: {get_param: [EndpointMap, ZaqarWebSocketPublic, uri]}
|
|
zaqar::keystone::auth_websocket::admin_url: {get_param: [EndpointMap, ZaqarWebSocketAdmin, uri]}
|
|
zaqar::keystone::auth_websocket::internal_url: {get_param: [EndpointMap, ZaqarWebSocketInternal, uri]}
|
|
zaqar::keystone::auth_websocket::region: {get_param: KeystoneRegion}
|
|
zaqar::keystone::auth_websocket::tenant: 'service'
|
|
|
|
step_config: |
|
|
include ::tripleo::profile::base::zaqar
|
|
upgrade_tasks:
|
|
- name: Check if zaqar is deployed
|
|
command: systemctl is-enabled openstack-zaqar
|
|
tags: common
|
|
ignore_errors: True
|
|
register: zaqar_enabled
|
|
- name: "PreUpgrade step0,validation: Check if openstack-zaqar is running"
|
|
shell: >
|
|
/usr/bin/systemctl show 'openstack-zaqar' --property ActiveState |
|
|
grep '\bactive\b'
|
|
when: zaqar_enabled.rc == 0
|
|
tags: step0,validation
|
|
- name: Stop zaqar service
|
|
tags: step1
|
|
when: zaqar_enabled.rc == 0
|
|
service: name=openstack-zaqar state=stopped
|
|
- name: Install openstack-zaqar package if it was disabled
|
|
tags: step3
|
|
yum: name=openstack-zaqar state=latest
|
|
when: zaqar_enabled.rc != 0
|