Merge "Role Specific paramaeter support for neutron-ovs-dpdk-agent service"
[apex-tripleo-heat-templates.git] / puppet / services / mistral-api.yaml
1 heat_template_version: pike
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   RoleName:
17     default: ''
18     description: Role name on which the service is applied
19     type: string
20   RoleParameters:
21     default: {}
22     description: Parameters specific to the role
23     type: json
24   EndpointMap:
25     default: {}
26     description: Mapping of service endpoint -> protocol. Typically set
27                  via parameter_defaults in the resource registry.
28     type: json
29   MistralWorkers:
30     default: 1
31     description: The number of workers for the mistral-api.
32     type: number
33   MistralApiPolicies:
34     description: |
35       A hash of policies to configure for Mistral API.
36       e.g. { mistral-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
37     default: {}
38     type: json
39
40 resources:
41   MistralBase:
42     type: ./mistral-base.yaml
43     properties:
44       ServiceNetMap: {get_param: ServiceNetMap}
45       DefaultPasswords: {get_param: DefaultPasswords}
46       EndpointMap: {get_param: EndpointMap}
47       RoleName: {get_param: RoleName}
48       RoleParameters: {get_param: RoleParameters}
49
50 outputs:
51   role_data:
52     description: Role data for the Mistral API role.
53     value:
54       service_name: mistral_api
55       config_settings:
56         map_merge:
57           - get_attr: [MistralBase, role_data, config_settings]
58           - mistral::api::api_workers: {get_param: MistralWorkers}
59             mistral::api::bind_host: {get_param: [ServiceNetMap, MistralApiNetwork]}
60             mistral::policy::policies: {get_param: MistralApiPolicies}
61             tripleo.mistral_api.firewall_rules:
62               '133 mistral':
63                 dport:
64                   - 8989
65                   - 13989
66       service_config_settings:
67         get_attr: [MistralBase, role_data, service_config_settings]
68       step_config: |
69         include ::tripleo::profile::base::mistral::api
70       upgrade_tasks:
71         - name: Check if mistral api is deployed
72           command: systemctl is-enabled openstack-mistral-api
73           tags: common
74           ignore_errors: True
75           register: mistral_api_enabled
76         - name: "PreUpgrade step0,validation: Check if openstack-mistral-api is running"
77           shell: >
78             /usr/bin/systemctl show 'openstack-mistral-api' --property ActiveState |
79             grep '\bactive\b'
80           when: mistral_api_enabled.rc == 0
81           tags: step0,validation
82         - name: Stop mistral_api service
83           tags: step1
84           service: name=openstack-mistral-api state=stopped
85         - name: Install openstack-mistral-api package if it was disabled
86           tags: step3
87           yum: name=openstack-mistral-api state=latest
88           when: mistral_api_enabled.rc != 0