Change flat network name for nosdn fdio scenario
[apex-tripleo-heat-templates.git] / puppet / services / sahara-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Sahara API service configured with Puppet
5
6 parameters:
7   ServiceData:
8     default: {}
9     description: Dictionary packing service data
10     type: json
11   ServiceNetMap:
12     default: {}
13     description: Mapping of service_name -> network name. Typically set
14                  via parameter_defaults in the resource registry.  This
15                  mapping overrides those in ServiceNetMapDefaults.
16     type: json
17   DefaultPasswords:
18     default: {}
19     type: json
20   RoleName:
21     default: ''
22     description: Role name on which the service is applied
23     type: string
24   RoleParameters:
25     default: {}
26     description: Parameters specific to the role
27     type: json
28   EndpointMap:
29     default: {}
30     description: Mapping of service endpoint -> protocol. Typically set
31                  via parameter_defaults in the resource registry.
32     type: json
33   SaharaPassword:
34     description: The password for the sahara service account, used by sahara-api.
35     type: string
36     hidden: true
37   SaharaWorkers:
38     default: 0
39     description: The number of workers for the sahara-api.
40     type: number
41   KeystoneRegion:
42     type: string
43     default: 'regionOne'
44     description: Keystone region for endpoint
45   MonitoringSubscriptionSaharaApi:
46     default: 'overcloud-sahara-api'
47     type: string
48   SaharaApiLoggingSource:
49     type: json
50     default:
51       tag: openstack.sahara.api
52       path: /var/log/sahara/sahara-api.log
53   SaharaApiPolicies:
54     description: |
55       A hash of policies to configure for Sahara API.
56       e.g. { sahara-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
57     default: {}
58     type: json
59
60 resources:
61   SaharaBase:
62     type: ./sahara-base.yaml
63     properties:
64       ServiceData: {get_param: ServiceData}
65       ServiceNetMap: {get_param: ServiceNetMap}
66       DefaultPasswords: {get_param: DefaultPasswords}
67       EndpointMap: {get_param: EndpointMap}
68       RoleName: {get_param: RoleName}
69       RoleParameters: {get_param: RoleParameters}
70
71 outputs:
72   role_data:
73     description: Role data for the Sahara API role.
74     value:
75       service_name: sahara_api
76       monitoring_subscription: {get_param: MonitoringSubscriptionSaharaApi}
77       logging_source: {get_param: SaharaApiLoggingSource}
78       logging_groups:
79         - sahara
80       config_settings:
81         map_merge:
82           - get_attr: [SaharaBase, role_data, config_settings]
83           - sahara::port: {get_param: [EndpointMap, SaharaInternal, port]}
84             sahara::policy::policies: {get_param: SaharaApiPolicies}
85             sahara::service::api::api_workers: {get_param: SaharaWorkers}
86             # NOTE: bind IP is found in Heat replacing the network name with the local node IP
87             # for the given network; replacement examples (eg. for internal_api):
88             # internal_api -> IP
89             # internal_api_uri -> [IP]
90             # internal_api_subnet - > IP/CIDR
91             sahara::host: {get_param: [ServiceNetMap, SaharaApiNetwork]}
92             tripleo.sahara_api.firewall_rules:
93               '132 sahara':
94                 dport:
95                   - 8386
96                   - 13386
97       step_config: |
98         include ::tripleo::profile::base::sahara::api
99       service_config_settings:
100         keystone:
101           sahara::keystone::auth::tenant: 'service'
102           sahara::keystone::auth::public_url: {get_param: [EndpointMap, SaharaPublic, uri]}
103           sahara::keystone::auth::internal_url: {get_param: [EndpointMap, SaharaInternal, uri]}
104           sahara::keystone::auth::admin_url: {get_param: [EndpointMap, SaharaAdmin, uri]}
105           sahara::keystone::auth::password: {get_param: SaharaPassword }
106           sahara::keystone::auth::region: {get_param: KeystoneRegion}
107         mysql:
108           sahara::db::mysql::password: {get_param: SaharaPassword}
109           sahara::db::mysql::user: sahara
110           sahara::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
111           sahara::db::mysql::dbname: sahara
112           sahara::db::mysql::allowed_hosts:
113             - '%'
114             - "%{hiera('mysql_bind_host')}"
115       upgrade_tasks:
116         - name: Stop sahara_api service
117           tags: step1
118           service: name=openstack-sahara-api state=stopped