02c693922aaf30bea1ebd1c5498153444d0ec292
[apex-tripleo-heat-templates.git] / puppet / services / mistral-api.yaml
1 heat_template_version: ocata
2
3 description: >
4   Openstack Mistral API 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   MistralWorkers:
22     default: 1
23     description: The number of workers for the mistral-api.
24     type: number
25   MistralApiPolicies:
26     description: |
27       A hash of policies to configure for Mistral API.
28       e.g. { mistral-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
29     default: {}
30     type: json
31
32 resources:
33   MistralBase:
34     type: ./mistral-base.yaml
35     properties:
36       ServiceNetMap: {get_param: ServiceNetMap}
37       DefaultPasswords: {get_param: DefaultPasswords}
38       EndpointMap: {get_param: EndpointMap}
39
40 outputs:
41   role_data:
42     description: Role data for the Mistral API role.
43     value:
44       service_name: mistral_api
45       config_settings:
46         map_merge:
47           - get_attr: [MistralBase, role_data, config_settings]
48           - mistral::api::api_workers: {get_param: MistralWorkers}
49             mistral::api::bind_host: {get_param: [ServiceNetMap, MistralApiNetwork]}
50             mistral::policy::policies: {get_param: MistralApiPolicies}
51             tripleo.mistral_api.firewall_rules:
52               '133 mistral':
53                 dport:
54                   - 8989
55                   - 13989
56       service_config_settings:
57         get_attr: [MistralBase, role_data, service_config_settings]
58       step_config: |
59         include ::tripleo::profile::base::mistral::api
60       upgrade_tasks:
61         - name: Check if mistral api is deployed
62           command: systemctl is-enabled openstack-mistral-api
63           tags: common
64           ignore_errors: True
65           register: mistral_api_enabled
66         - name: "PreUpgrade step0,validation: Check if openstack-mistral-api is running"
67           shell: >
68             /usr/bin/systemctl show 'openstack-mistral-api' --property ActiveState |
69             grep '\bactive\b'
70           when: mistral_api_enabled.rc == 0
71           tags: step0,validation
72         - name: Stop mistral_api service
73           tags: step1
74           service: name=openstack-mistral-api state=stopped
75         - name: Install openstack-mistral-api package if it was disabled
76           tags: step3
77           yum: name=openstack-mistral-api state=latest
78           when: mistral_api_enabled.rc != 0