Enable internal TLS for Nova API
[apex-tripleo-heat-templates.git] / puppet / services / nova-api.yaml
1 heat_template_version: 2016-10-14
2
3 description: >
4   OpenStack Nova 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   NovaWorkers:
22     default: 0
23     description: Number of workers for Nova API service.
24     type: number
25   NovaPassword:
26     description: The password for the nova service and db account, used by nova-api.
27     type: string
28     hidden: true
29   KeystoneRegion:
30     type: string
31     default: 'regionOne'
32     description: Keystone region for endpoint
33   NeutronMetadataProxySharedSecret:
34     description: Shared secret to prevent spoofing
35     type: string
36     hidden: true
37   InstanceNameTemplate:
38     default: 'instance-%08x'
39     description: Template string to be used to generate instance names
40     type: string
41   NovaEnableDBPurge:
42     default: true
43     description: |
44         Whether to create cron job for purging soft deleted rows in Nova database.
45     type: boolean
46   MonitoringSubscriptionNovaApi:
47     default: 'overcloud-nova-api'
48     type: string
49   NovaApiLoggingSource:
50     type: json
51     default:
52       tag: openstack.nova.api
53       path: /var/log/nova/nova-api.log
54   EnableInternalTLS:
55     type: boolean
56     default: false
57
58 conditions:
59   nova_workers_zero: {equals : [{get_param: NovaWorkers}, 0]}
60
61 resources:
62   ApacheServiceBase:
63     type: ./apache.yaml
64     properties:
65       ServiceNetMap: {get_param: ServiceNetMap}
66       DefaultPasswords: {get_param: DefaultPasswords}
67       EndpointMap: {get_param: EndpointMap}
68       EnableInternalTLS: {get_param: EnableInternalTLS}
69
70   NovaBase:
71     type: ./nova-base.yaml
72     properties:
73       ServiceNetMap: {get_param: ServiceNetMap}
74       DefaultPasswords: {get_param: DefaultPasswords}
75       EndpointMap: {get_param: EndpointMap}
76
77 outputs:
78   role_data:
79     description: Role data for the Nova API service.
80     value:
81       service_name: nova_api
82       monitoring_subscription: {get_param: MonitoringSubscriptionNovaApi}
83       logging_source: {get_param: NovaApiLoggingSource}
84       logging_groups:
85         - nova
86       config_settings:
87         map_merge:
88         - get_attr: [NovaBase, role_data, config_settings]
89         - get_attr: [ApacheServiceBase, role_data, config_settings]
90         - nova::cron::archive_deleted_rows::hour: '"*/12"'
91           nova::cron::archive_deleted_rows::destination: '"/dev/null"'
92           tripleo.nova_api.firewall_rules:
93             '113 nova_api':
94               dport:
95                 - 6080
96                 - 13080
97                 - 8773
98                 - 3773
99                 - 8774
100                 - 13774
101                 - 8775
102           nova::keystone::authtoken::project_name: 'service'
103           nova::keystone::authtoken::password: {get_param: NovaPassword}
104           nova::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri] }
105           nova::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneAdmin, uri_no_suffix]}
106           nova::api::enabled: true
107           nova::api::default_floating_pool: 'public'
108           nova::api::sync_db_api: true
109           nova::api::enable_proxy_headers_parsing: true
110           nova::api::api_bind_address:
111             str_replace:
112               template:
113                 '"%{::fqdn_$NETWORK}"'
114               params:
115                 $NETWORK: {get_param: [ServiceNetMap, NovaApiNetwork]}
116           nova::api::service_name: 'httpd'
117           nova::wsgi::apache::ssl: {get_param: EnableInternalTLS}
118           # NOTE: bind IP is found in Heat replacing the network name with the local node IP
119           # for the given network; replacement examples (eg. for internal_api):
120           # internal_api -> IP
121           # internal_api_uri -> [IP]
122           # internal_api_subnet - > IP/CIDR
123           nova::wsgi::apache::bind_host: {get_param: [ServiceNetMap, NovaApiNetwork]}
124           nova::wsgi::apache::servername:
125             str_replace:
126               template:
127                 '"%{::fqdn_$NETWORK}"'
128               params:
129                 $NETWORK: {get_param: [ServiceNetMap, NovaApiNetwork]}
130           nova::api::neutron_metadata_proxy_shared_secret: {get_param: NeutronMetadataProxySharedSecret}
131           nova::api::instance_name_template: {get_param: InstanceNameTemplate}
132           nova_enable_db_purge: {get_param: NovaEnableDBPurge}
133         -
134           if:
135           - nova_workers_zero
136           - {}
137           - nova::api::osapi_compute_workers: {get_param: NovaWorkers}
138             nova::wsgi::apache::workers: {get_param: NovaWorkers}
139       step_config: |
140         include tripleo::profile::base::nova::api
141       service_config_settings:
142         keystone:
143           nova::keystone::auth::tenant: 'service'
144           nova::keystone::auth::public_url: {get_param: [EndpointMap, NovaPublic, uri]}
145           nova::keystone::auth::internal_url: {get_param: [EndpointMap, NovaInternal, uri]}
146           nova::keystone::auth::admin_url: {get_param: [EndpointMap, NovaAdmin, uri]}
147           nova::keystone::auth::password: {get_param: NovaPassword}
148           nova::keystone::auth::region: {get_param: KeystoneRegion}
149         mysql:
150           nova::db::mysql::password: {get_param: NovaPassword}
151           nova::db::mysql::user: nova
152           nova::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
153           nova::db::mysql::dbname: nova
154           nova::db::mysql::allowed_hosts:
155             - '%'
156             - "%{hiera('mysql_bind_host')}"
157           nova::db::mysql_api::password: {get_param: NovaPassword}
158           nova::db::mysql_api::user: nova_api
159           nova::db::mysql_api::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
160           nova::db::mysql_api::dbname: nova_api
161           nova::db::mysql_api::allowed_hosts:
162             - '%'
163             - "%{hiera('mysql_bind_host')}"