-
Notifications
You must be signed in to change notification settings - Fork 34
/
trilio-datamover-api.yaml
289 lines (279 loc) · 11.5 KB
/
trilio-datamover-api.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
heat_template_version: queens
description: >
Trilio Datamover Api containerized service
parameters:
DockerTrilioDmApiImage:
default: ''
description: The location of Trilio Datamover container image
type: string
ServiceData:
default: {}
description: Dictionary packing service data
type: json
ServiceNetMap:
default: {}
description: Mapping of service_name -> network name. Typically set
via parameter_defaults in the resource registry. This
mapping overrides those in ServiceNetMapDefaults.
type: json
DefaultPasswords:
default: {}
type: json
RoleName:
default: ''
description: Role name on which the service is applied
type: string
RoleParameters:
default: {}
description: Parameters specific to the role
type: json
EndpointMap:
default: {}
description: Mapping of service endpoint -> protocol. Typically set
via parameter_defaults in the resource registry.
type: json
DmApiPort:
default: '8784'
description: Trilio Dmapi listen port
type: string
DmApiSslPort:
default: '13784'
description: Trilio Dmapi ssl listen port
type: string
KeystoneRegion:
type: string
default: 'regionOne'
description: Keystone region for endpoint
TrilioDatamoverPassword:
description: The password for the trilio service and db account
type: string
hidden: true
NotificationDriver:
type: string
default: 'messagingv2'
description: Driver or drivers to handle sending notifications.
RabbitPassword:
description: The password for RabbitMQ
type: string
hidden: true
RabbitUserName:
default: guest
description: The username for RabbitMQ
type: string
RabbitClientUseSSL:
default: false
description: >
Rabbit client subscriber parameter to specify
an SSL connection to the RabbitMQ host.
type: string
RabbitClientPort:
default: 5672
description: Set rabbit subscriber port, change this if using SSL
type: number
DockerMysqlConfigImage:
description: The container image to use for the mysql config_volume
type: string
DockerKeystoneConfigImage:
description: The container image to use for the keystone config_volume
type: string
EnableInternalTLS:
type: boolean
default: false
InternalTLSCAFile:
default: '/etc/ipa/ca.crt'
type: string
description: Specifies the default CA cert to use if TLS is used for
services in the internal network.
DeployIdentifier:
default: ''
type: string
description: >
Setting this to a unique value will re-run any deployment tasks which
perform configuration on a Heat stack-update.
resources:
ContainersCommon:
type: /usr/share/openstack-tripleo-heat-templates/docker/services/containers-common.yaml
MySQLClient:
type: /usr/share/openstack-tripleo-heat-templates/puppet/services/database/mysql-client.yaml
conditions:
internal_tls_enabled: {equals: [{get_param: EnableInternalTLS}, true]}
outputs:
role_data:
description: Role data for the Trilio Datamover role.
value:
service_name: trilio_datamover_api
config_settings:
trilio::dmapi::dmapi_port: {get_param: DmApiPort}
trilio::dmapi::dmapi_ssl_port: {get_param: DmApiSslPort}
trilio::dmapi::password: {get_param: TrilioDatamoverPassword}
trilio::dmapi::auth_uri: {get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
trilio::dmapi::auth_url: { get_param: [EndpointMap, KeystoneInternal, uri_no_suffix] }
trilio::dmapi::notification_driver: {get_param: NotificationDriver}
trilio::rabbit_userid: {get_param: RabbitUserName}
trilio::rabbit_password: {get_param: RabbitPassword}
trilio::rabbit_use_ssl: {get_param: RabbitClientUseSSL}
trilio::rabbit_port: {get_param: RabbitClientPort}
trilio::dmapi::enable_proxy_headers_parsing: true
trilio::dmapi::project_name: 'service'
trilio::dmapi::region_name: {get_param: KeystoneRegion}
trilio::dmapi::user_domain_name: 'Default'
trilio::dmapi::project_domain_name: 'Default'
tripleo.trilio_datamover_api.firewall_rules:
'240 trilio_datamover_api':
dport:
- 8784
- 13784
trilio::dmapi::database_connection:
make_url:
scheme: {get_param: [EndpointMap, MysqlInternal, protocol]}
username: dmapi
password: {get_param: TrilioDatamoverPassword}
host: {get_param: [EndpointMap, MysqlInternal, host]}
path: /dmapi
trilio::dmapi::my_ip:
str_replace:
template:
"%{hiera('$NETWORK')}"
params:
$NETWORK: {get_param: [ServiceNetMap, TrilioDatamoverApiNetwork]}
service_config_settings:
haproxy:
tripleo::trilio_datamover_api::haproxy_endpoints:
trilio_datamover_api:
public_virtual_ip: "%{hiera('public_virtual_ip')}"
internal_ip: "%{hiera('trilio_datamover_api_vip')}"
service_port: {get_param: DmApiPort}
public_ssl_port: {get_param: DmApiSslPort}
member_options: [ 'check', 'inter 2000', 'rise 2', 'fall 5' ]
haproxy_listen_bind_param: ['transparent']
service_network: "%{hiera('trilio_datamover_api_network')}"
keystone:
trilio::keystone::auth::tenant: 'service'
trilio::keystone::auth::service_name: 'dmapi'
trilio::keystone::auth::service_type: 'datamover'
trilio::keystone::auth::service_description: 'TrilioVault Datamover Service'
trilio::keystone::auth::public_url: {get_param: [EndpointMap, TrilioDatamoverPublic, uri]}
trilio::keystone::auth::internal_url: {get_param: [EndpointMap, TrilioDatamoverInternal, uri]}
trilio::keystone::auth::admin_url: {get_param: [EndpointMap, TrilioDatamoverAdmin, uri]}
trilio::keystone::auth::password: {get_param: TrilioDatamoverPassword}
trilio::keystone::auth::region: {get_param: KeystoneRegion}
mysql:
trilio::db::mysql::user: dmapi
trilio::db::mysql::password: {get_param: TrilioDatamoverPassword}
trilio::db::mysql::host: {get_param: [EndpointMap, MysqlInternal, host_nobrackets]}
trilio::db::mysql::dbname: dmapi
trilio::db::mysql::allowed_hosts:
- '%'
- "%{hiera('mysql_bind_host')}"
puppet_config:
config_volume: triliodmapi
puppet_tags: dmapiconfig
step_config:
list_join:
- "\n"
- - "include ::trilio::dmapi"
- {get_attr: [MySQLClient, role_data, step_config]}
config_image: {get_param: DockerTrilioDmApiImage}
kolla_config:
/var/lib/kolla/config_files/trilio_dmapi.json:
command: /usr/bin/python /usr/bin/dmapi-api
config_files:
- source: "/var/lib/kolla/config_files/triliodmapi/*"
dest: "/"
merge: true
preserve_properties: true
permissions:
- path: /var/log/trilio-datamover-api
owner: dmapi:dmapi
recurse: true
docker_puppet_tasks:
# Trilio Datamover Api MySQL database initialization occurs only on single node
step_3:
config_volume: 'trilio_datamover_api_mysql_init_tasks'
puppet_tags: 'mysql_database,mysql_grant,mysql_user'
step_config: 'include ::trilio::tripleo::mysql'
config_image: {get_param: DockerMysqlConfigImage}
volumes:
list_concat:
-
- /var/lib/mysql:/var/lib/mysql/:rw
- /var/log/containers/mysql:/var/log/mariadb
- /var/lib/config-data/puppet-generated/mysql/root:/root:rw #provides .my.cnf for puppet, changed on password update
- if:
- internal_tls_enabled
-
- list_join:
- ':'
- - {get_param: InternalTLSCAFile}
- {get_param: InternalTLSCAFile}
- 'ro'
- /etc/pki/tls/certs/mysql.crt:/var/lib/kolla/config_files/src-tls/etc/pki/tls/certs/mysql.crt:ro
- /etc/pki/tls/private/mysql.key:/var/lib/kolla/config_files/src-tls/etc/pki/tls/private/mysql.key:ro
- null
step_4:
config_volume: 'trilio_datamover_api_keystone_init_tasks'
puppet_tags: 'keystone_config,keystone_domain_config,keystone_endpoint,keystone_identity_provider,keystone_paste_ini,keystone_role,keystone_service,keystone_tenant,keystone_user,keystone_user_role,keystone_domain'
step_config: 'include ::trilio::tripleo::keystone'
config_image: {get_param: DockerKeystoneConfigImage}
volumes:
- /var/lib/config-data/puppet-generated/keystone/etc/keystone:/etc/keystone:rw
docker_config:
step_2:
trilio_datamover_api_init_log:
image: &trilio_datamover_api_image {get_param: DockerTrilioDmApiImage}
start_order: 0
net: none
user: root
volumes:
- /var/log/containers/trilio-datamover-api:/var/log/trilio-datamover-api:z
command: ['/bin/bash', '-c', 'chown -R dmapi:dmapi /var/log/trilio-datamover-api']
step_4:
trilio_datamover_api_db_sync:
image: *trilio_datamover_api_image
net: host
privileged: false
detach: false
user: root
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/config-data/triliodmapi/etc/my.cnf.d/tripleo.cnf:/etc/my.cnf.d/tripleo.cnf:ro
- /var/lib/config-data/triliodmapi/etc/dmapi/:/etc/dmapi/:ro
- /var/log/containers/trilio-datamover-api:/var/log/trilio-datamover-api
command: "/usr/bin/bootstrap_host_exec trilio_datamover_api su dmapi -s /bin/bash -c /usr/bin/dmapi-dbsync"
environment:
TRIPLEO_DEPLOY_IDENTIFIER: {get_param: DeployIdentifier}
step_5:
trilio_dmapi:
image: {get_param: DockerTrilioDmApiImage}
net: host
privileged: true
user: dmapi
restart: always
volumes:
list_concat:
- {get_attr: [ContainersCommon, volumes]}
-
- /var/lib/kolla/config_files/trilio_dmapi.json:/var/lib/kolla/config_files/config.json:ro
- /var/lib/config-data/puppet-generated/triliodmapi/:/var/lib/kolla/config_files/triliodmapi:ro
- /var/log/containers/trilio-datamover-api:/var/log/trilio-datamover-api:z
- if:
- internal_tls_enabled
- - /etc/pki/tls/certs/httpd:/etc/pki/tls/certs/httpd:ro
- []
- if:
- internal_tls_enabled
- - /etc/pki/tls/private/httpd:/etc/pki/tls/private/httpd:ro
- []
environment:
- KOLLA_CONFIG_STRATEGY=COPY_ALWAYS
host_prep_tasks:
- name: create trilio datamover api log directory
file:
path: "{{ item.path }}"
state: directory
setype: "{{ item.setype }}"
with_items:
- { 'path': /var/log/containers/trilio-datamover-api, 'setype': svirt_sandbox_file_t }
upgrade_tasks: []