Merge "Adds upgrade tasks for OpenDaylight services"
[apex-tripleo-heat-templates.git] / puppet / services / mistral-engine.yaml
1 heat_template_version: ocata
2
3 description: >
4   Openstack Mistral Engine service configured with Puppet
5
6 parameters:
7   ServiceNetMap:
8     default: {}
9     description: Mapping of service_name -> network name. Typically set
10                  via parameter_defaults in the resource registry.  This
11                  mapping overrides those in ServiceNetMapDefaults.
12     type: json
13   DefaultPasswords:
14     default: {}
15     type: json
16   EndpointMap:
17     default: {}
18     description: Mapping of service endpoint -> protocol. Typically set
19                  via parameter_defaults in the resource registry.
20     type: json
21
22 resources:
23   MistralBase:
24     type: ./mistral-base.yaml
25     properties:
26       ServiceNetMap: {get_param: ServiceNetMap}
27       DefaultPasswords: {get_param: DefaultPasswords}
28       EndpointMap: {get_param: EndpointMap}
29
30 outputs:
31   role_data:
32     description: Role data for the Mistral Engine role.
33     value:
34       service_name: mistral_engine
35       config_settings:
36         get_attr: [MistralBase, role_data, config_settings]
37       step_config: |
38         include ::tripleo::profile::base::mistral::engine
39       upgrade_tasks:
40         - name: Check if mistral engine is deployed
41           command: systemctl is-enabled openstack-mistral-engine
42           tags: common
43           ignore_errors: True
44           register: mistral_engine_enabled
45         - name: "PreUpgrade step0,validation: Check if openstack-mistral-engine is running"
46           shell: >
47             /usr/bin/systemctl show 'openstack-mistral-engine' --property ActiveState |
48             grep '\bactive\b'
49           when: mistral_engine_enabled.rc == 0
50           tags: step0,validation
51         - name: Stop mistral_engine service
52           tags: step1
53           service: name=openstack-mistral-engine state=stopped
54         - name: Install openstack-mistral-engine package if it was disabled
55           tags: step3
56           yum: name=openstack-mistral-engine state=latest
57           when: mistral_engine_enabled.rc != 0