d9f2115a7c7e234dc947c277bf0a6c6152eb1def
[apex-tripleo-heat-templates.git] / puppet / services / sahara-api.yaml
1 heat_template_version: ocata
2
3 description: >
4   OpenStack Sahara 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   SaharaPassword:
22     description: The password for the sahara service account, used by sahara-api.
23     type: string
24     hidden: true
25   SaharaWorkers:
26     default: 0
27     description: The number of workers for the sahara-api.
28     type: number
29   KeystoneRegion:
30     type: string
31     default: 'regionOne'
32     description: Keystone region for endpoint
33   MonitoringSubscriptionSaharaApi:
34     default: 'overcloud-sahara-api'
35     type: string
36   SaharaApiLoggingSource:
37     type: json
38     default:
39       tag: openstack.sahara.api
40       path: /var/log/sahara/sahara-api.log
41   SaharaApiPolicies:
42     description: |
43       A hash of policies to configure for Sahara API.
44       e.g. { sahara-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
45     default: {}
46     type: json
47
48 resources:
49   SaharaBase:
50     type: ./sahara-base.yaml
51     properties:
52       ServiceNetMap: {get_param: ServiceNetMap}
53       DefaultPasswords: {get_param: DefaultPasswords}
54       EndpointMap: {get_param: EndpointMap}
55
56 outputs:
57   role_data:
58     description: Role data for the Sahara API role.
59     value:
60       service_name: sahara_api
61       monitoring_subscription: {get_param: MonitoringSubscriptionSaharaApi}
62       logging_source: {get_param: SaharaApiLoggingSource}
63       logging_groups:
64         - sahara
65       config_settings:
66         map_merge:
67           - get_attr: [SaharaBase, role_data, config_settings]
68           - sahara::port: {get_param: [EndpointMap, SaharaInternal, port]}
69             sahara::policy::policies: {get_param: SaharaApiPolicies}
70             sahara::service::api::api_workers: {get_param: SaharaWorkers}
71             # NOTE: bind IP is found in Heat replacing the network name with the local node IP
72             # for the given network; replacement examples (eg. for internal_api):
73             # internal_api -> IP
74             # internal_api_uri -> [IP]
75             # internal_api_subnet - > IP/CIDR
76             sahara::host: {get_param: [ServiceNetMap, SaharaApiNetwork]}
77             tripleo.sahara_api.firewall_rules:
78               '132 sahara':
79                 dport:
80                   - 8386
81                   - 13386
82       step_config: |
83         include ::tripleo::profile::base::sahara::api
84       service_config_settings:
85         keystone:
86           sahara::keystone::auth::tenant: 'service'
87           sahara::keystone::auth::public_url: {get_param: [EndpointMap, SaharaPublic, uri]}
88           sahara::keystone::auth::internal_url: {get_param: [EndpointMap, SaharaInternal, uri]}
89           sahara::keystone::auth::admin_url: {get_param: [EndpointMap, SaharaAdmin, uri]}
90           sahara::keystone::auth::password: {get_param: SaharaPassword }
91           sahara::keystone::auth::region: {get_param: KeystoneRegion}
92         mysql:
93           sahara::db::mysql::password: {get_param: SaharaPassword}
94           sahara::db::mysql::user: sahara
95           sahara::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
96           sahara::db::mysql::dbname: sahara
97           sahara::db::mysql::allowed_hosts:
98             - '%'
99             - "%{hiera('mysql_bind_host')}"
100       upgrade_tasks:
101         - name: Stop sahara_api service
102           tags: step1
103           service: name=openstack-sahara-api state=stopped