Merge "FQDN validation"
[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
26 resources:
27   MistralBase:
28     type: ./mistral-base.yaml
29     properties:
30       ServiceNetMap: {get_param: ServiceNetMap}
31       DefaultPasswords: {get_param: DefaultPasswords}
32       EndpointMap: {get_param: EndpointMap}
33
34 outputs:
35   role_data:
36     description: Role data for the Mistral API role.
37     value:
38       service_name: mistral_api
39       config_settings:
40         map_merge:
41           - get_attr: [MistralBase, role_data, config_settings]
42           - mistral::api::api_workers: {get_param: MistralWorkers}
43             mistral::api::bind_host: {get_param: [ServiceNetMap, MistralApiNetwork]}
44             tripleo.mistral_api.firewall_rules:
45               '133 mistral':
46                 dport:
47                   - 8989
48                   - 13989
49       service_config_settings:
50         get_attr: [MistralBase, role_data, service_config_settings]
51       step_config: |
52         include ::tripleo::profile::base::mistral::api
53       upgrade_tasks:
54         - name: Check if mistral api is deployed
55           command: systemctl is-enabled openstack-mistral-api
56           tags: common
57           ignore_errors: True
58           register: mistral_api_enabled
59         - name: "PreUpgrade step0,validation: Check if openstack-mistral-api is running"
60           shell: >
61             /usr/bin/systemctl show 'openstack-mistral-api' --property ActiveState |
62             grep '\bactive\b'
63           when: mistral_api_enabled.rc == 0
64           tags: step0,validation
65         - name: Stop mistral_api service
66           tags: step1
67           service: name=openstack-mistral-api state=stopped
68         - name: Install openstack-mistral-api package if it was disabled
69           tags: step3
70           yum: name=openstack-mistral-api state=latest
71           when: mistral_api_enabled.rc != 0