Merge "TLS everywhere: configure mongodb's TLS settings"
[apex-tripleo-heat-templates.git] / puppet / services / nova-placement.yaml
1 heat_template_version: pike
2
3 description: >
4   OpenStack Nova Placement 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   NovaWorkers:
30     default: 0
31     description: Number of workers for Nova Placement API service.
32     type: number
33   NovaPassword:
34     description: The password for the nova service and db account, used by nova-placement.
35     type: string
36     hidden: true
37   KeystoneRegion:
38     type: string
39     default: 'regionOne'
40     description: Keystone region for endpoint
41   MonitoringSubscriptionNovaPlacement:
42     default: 'overcloud-nova-placement'
43     type: string
44   NovaPlacementLoggingSource:
45     type: json
46     default:
47       tag: openstack.nova.placement
48       path: /var/log/httpd/nova_placement_wsgi_error_ssl.log
49   EnableInternalTLS:
50     type: boolean
51     default: false
52
53 conditions:
54   nova_workers_zero: {equals : [{get_param: NovaWorkers}, 0]}
55
56 resources:
57   ApacheServiceBase:
58     type: ./apache.yaml
59     properties:
60       ServiceNetMap: {get_param: ServiceNetMap}
61       DefaultPasswords: {get_param: DefaultPasswords}
62       EndpointMap: {get_param: EndpointMap}
63       RoleName: {get_param: RoleName}
64       RoleParameters: {get_param: RoleParameters}
65       EnableInternalTLS: {get_param: EnableInternalTLS}
66
67   NovaBase:
68     type: ./nova-base.yaml
69     properties:
70       ServiceNetMap: {get_param: ServiceNetMap}
71       DefaultPasswords: {get_param: DefaultPasswords}
72       EndpointMap: {get_param: EndpointMap}
73       RoleName: {get_param: RoleName}
74       RoleParameters: {get_param: RoleParameters}
75
76 outputs:
77   role_data:
78     description: Role data for the Nova Placement API service.
79     value:
80       service_name: nova_placement
81       monitoring_subscription: {get_param: MonitoringSubscriptionNovaPlacement}
82       logging_source: {get_param: NovaPlacementLoggingSource}
83       logging_groups:
84         - nova
85       config_settings:
86         map_merge:
87         - get_attr: [NovaBase, role_data, config_settings]
88         - get_attr: [ApacheServiceBase, role_data, config_settings]
89         - tripleo.nova_placement.firewall_rules:
90             '138 nova_placement':
91               dport:
92                 - 8778
93                 - 13778
94           nova::keystone::authtoken::project_name: 'service'
95           nova::keystone::authtoken::password: {get_param: NovaPassword}
96           nova::keystone::authtoken::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri] }
97           nova::keystone::authtoken::auth_url: {get_param: [EndpointMap, KeystoneAdmin, uri_no_suffix]}
98           nova::wsgi::apache_placement::api_port: '8778'
99           nova::wsgi::apache_placement::ssl: {get_param: EnableInternalTLS}
100           # NOTE: bind IP is found in Heat replacing the network name with the local node IP
101           # for the given network; replacement examples (eg. for internal_api):
102           # internal_api -> IP
103           # internal_api_uri -> [IP]
104           # internal_api_subnet - > IP/CIDR
105           nova::wsgi::apache_placement::bind_host: {get_param: [ServiceNetMap, NovaPlacementNetwork]}
106           nova::wsgi::apache_placement::servername:
107             str_replace:
108               template:
109                 "%{hiera('fqdn_$NETWORK')}"
110               params:
111                 $NETWORK: {get_param: [ServiceNetMap, NovaPlacementNetwork]}
112         -
113           if:
114           - nova_workers_zero
115           - {}
116           - nova::wsgi::apache_placement::workers: {get_param: NovaWorkers}
117       step_config: |
118         include tripleo::profile::base::nova::placement
119       service_config_settings:
120         keystone:
121           nova::keystone::auth_placement::tenant: 'service'
122           nova::keystone::auth_placement::public_url: {get_param: [EndpointMap, NovaPlacementPublic, uri]}
123           nova::keystone::auth_placement::internal_url: {get_param: [EndpointMap, NovaPlacementInternal, uri]}
124           nova::keystone::auth_placement::admin_url: {get_param: [EndpointMap, NovaPlacementAdmin, uri]}
125           nova::keystone::auth_placement::password: {get_param: NovaPassword}
126           nova::keystone::auth_placement::region: {get_param: KeystoneRegion}
127         mysql:
128           map_merge:
129           - {get_attr: [NovaBase, role_data, service_config_settings, mysql]}
130           - nova::db::mysql_placement::password: {get_param: NovaPassword}
131             nova::db::mysql_placement::user: nova_placement
132             nova::db::mysql_placement::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
133             nova::db::mysql_placement::dbname: nova_placement
134             nova::db::mysql_placement::allowed_hosts:
135               - '%'
136               - "%{hiera('mysql_bind_host')}"
137       upgrade_tasks:
138         - name: Stop nova_placement service (running under httpd)
139           tags: step1
140           service: name=httpd state=stopped
141         # The nova placement API isn't installed in newton images, so install
142         # it on upgrade
143         - name: Install nova-placement packages on upgrade
144           tags: step3
145           yum: name=openstack-nova-placement-api state=latest