Add role specific information to the service template
[apex-tripleo-heat-templates.git] / puppet / services / octavia-api.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Octavia API service.
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   OctaviaPassword:
30     description: The password for the Octavia's database account.
31     type: string
32     hidden: true
33   KeystoneRegion:
34     type: string
35     default: 'regionOne'
36     description: Keystone region for endpoint
37   MonitoringSubscriptionOctaviaApi:
38     default: 'overcloud-octavia-api'
39     type: string
40   OctaviaApiLoggingSource:
41     type: json
42     default:
43       tag: openstack.octavia.api
44       path: /var/log/octavia/api.log
45   OctaviaApiPolicies:
46     description: |
47       A hash of policies to configure for Octavia API.
48       e.g. { octavia-context_is_admin: { key: context_is_admin, value: 'role:admin' } }
49     default: {}
50     type: json
51
52 resources:
53
54   OctaviaBase:
55     type: ./octavia-base.yaml
56     properties:
57       ServiceNetMap: {get_param: ServiceNetMap}
58       DefaultPasswords: {get_param: DefaultPasswords}
59       EndpointMap: {get_param: EndpointMap}
60       RoleName: {get_param: RoleName}
61       RoleParameters: {get_param: RoleParameters}
62
63 outputs:
64   role_data:
65     description: Role data for the Octavia API service.
66     value:
67       service_name: octavia_api
68       monitoring_subscription: {get_param: MonitoringSubscriptionOctaviaApi}
69       logging_source: {get_param: OctaviaApiLoggingSource}
70       logging_groups:
71         - octavia
72       config_settings:
73         map_merge:
74           - get_attr: [OctaviaBase, role_data, config_settings]
75           - octavia::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri] }
76             octavia::policy::policies: {get_param: OctaviaApiPolicies}
77             octavia::db::database_connection:
78               make_url:
79                 scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
80                 username: octavia
81                 password: {get_param: OctaviaPassword}
82                 host: {get_param: [EndpointMap, MysqlInternal, host]}
83                 path: /octavia
84                 query:
85                   read_default_file: /etc/my.cnf.d/tripleo.cnf
86                   read_default_group: tripleo
87             octavia::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix]}
88             octavia::keystone::authtoken::project_name: 'service'
89             octavia::keystone::authtoken::password: {get_param: OctaviaPassword}
90             octavia::api::sync_db: true
91             tripleo.octavia_api.firewall_rules:
92               '120 octavia api':
93                 dport:
94                   - 9876
95                   - 13876
96             octavia::api::host: {get_param: [ServiceNetMap, OctaviaApiNetwork]}
97       step_config: |
98         include tripleo::profile::base::octavia::api
99       service_config_settings:
100         keystone:
101           octavia::keystone::auth::tenant: 'service'
102           octavia::keystone::auth::public_url: {get_param: [EndpointMap, OctaviaPublic, uri]}
103           octavia::keystone::auth::internal_url: { get_param: [ EndpointMap, OctaviaInternal, uri ] }
104           octavia::keystone::auth::admin_url: { get_param: [ EndpointMap, OctaviaAdmin, uri ] }
105           octavia::keystone::auth::password: {get_param: OctaviaPassword}
106           octavia::keystone::auth::region: {get_param: KeystoneRegion}
107         mysql:
108           octavia::db::mysql::password: {get_param: OctaviaPassword}
109           octavia::db::mysql::user: octavia
110           octavia::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
111           octavia::db::mysql::dbname: octavia
112           octavia::db::mysql::allowed_hosts:
113             - '%'
114             - "%{hiera('mysql_bind_host')}"
115         neutron_api:
116           neutron::server::service_providers: ['LOADBALANCERV2:Octavia:neutron_lbaas.drivers.octavia.driver.OctaviaDriver:default']