-
Notifications
You must be signed in to change notification settings - Fork 0
/
st_install.yml
443 lines (414 loc) · 16.4 KB
/
st_install.yml
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
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
- name: Installing the ST nodes
hosts: ST_NODES
become: true
become_user: "{{ ST_USER }}"
vars_files:
- files/external_vars.yml
- files/services_vars.yml
pre_tasks:
- name: Is ST Installed?
ansible.builtin.stat:
path: "{{ AXWAY_HOME }}/SecureTransport"
register: is_installed
tags:
- st_install
- name: Check if installer is there
ansible.builtin.stat:
path: "{{ INSTALLER_DIR }}/setup.sh"
register: installer_file
when:
- not is_installed.stat.exists
tags:
- st_install
- name: Download and extract the ST installer
ansible.builtin.unarchive:
src: "{{ ST_DOWNLOAD_LINK }}"
dest: "{{ INSTALLER_DIR }}"
mode: '0755'
group: "{{ ST_GROUP }}"
owner: "{{ ST_USER }}"
validate_certs: false
remote_src: true
when:
- (installer_file.stat.exists is undefined) or (not installer_file.stat.exists)
- not is_installed.stat.exists
tags:
- st_install
- axway_lab_specific
- name: Find the name of the archive that contains the JRE
ansible.builtin.find:
paths: "{{ INSTALLER_DIR }}/Java/linux-x86"
patterns: 'jre1*.zip'
register: file_to_copy
tags:
- st_install
when:
- not is_installed.stat.exists
- name: Find the name of the Axway_Installer
ansible.builtin.find:
paths: "{{ INSTALLER_DIR }}/Components/Configuration"
patterns: 'Install_Axway_Installer*.properties'
register: axway_installer
tags:
- st_install
when:
- not is_installed.stat.exists
- name: Filter the Axway Installer name and set a variable
ansible.builtin.set_fact:
installer_properties: "{{ axway_installer.files.0.path | basename }}"
when:
- not is_installed.stat.exists
- name: Find the name of the ST_Installer
ansible.builtin.find:
paths: "{{ INSTALLER_DIR }}/Components/Configuration/"
patterns: 'Install_SecureTransport*.properties'
register: silent_file
when:
- not is_installed.stat.exists
tags:
- st_install
- name: Filter the ST Installer name and set a variable
ansible.builtin.set_fact:
st_silentfile_properties: "{{ silent_file.files.0.path | basename }}"
when:
- not is_installed.stat.exists
tags:
- d
- name: Unarchive the JRE
ansible.builtin.unarchive:
src: "{{ file_to_copy['files'][0]['path'] }}"
dest: "{{ INSTALLER_DIR }}/JRE"
group: "{{ ST_GROUP }}"
owner: "{{ ST_USER }}"
mode: '0755'
remote_src: true
tags:
- st_install
when:
- not is_installed.stat.exists
- name: Ansible copy files remote to remote
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.copy:
src: "{{ INSTALLER_DIR }}/Components/Configuration/{{ item }}"
dest: "{{ INSTALLER_DIR }}"
mode: '0755'
remote_src: true
with_items:
["{{ installer_properties }}", "{{ st_silentfile_properties }}"]
tags:
- st_install
when:
- not is_installed.stat.exists
- name: Update Install_Axway_Installer properties
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.lineinfile:
path: "{{ INSTALLER_DIR }}/{{ installer_properties }}"
regexp: '^{{ item.option }} ='
line: "{{ item.option }} = {{ item.value }}"
with_items:
- { option: 'InstallationLogicalName', value: 'SecureTransport' }
- { option: 'InstallDir', value: '{{ AXWAY_HOME }}/Axway' }
- { option: 'AllAxwayComps32', value: 'false' }
- { option: 'AllAxwayComps64', value: 'true' }
- { option: 'IncludeFiles', value: '' }
- { option: 'IncludeFiles.SecureTransport', value: '{{ st_silentfile_properties }}' }
tags:
- st_install
when:
- not is_installed.stat.exists
- name: Delete unneeded items from the Axway Installer File
ansible.builtin.lineinfile:
path: "{{ INSTALLER_DIR }}/{{ installer_properties }}"
state: absent
regexp: '^License'
when:
- not is_installed.stat.exists
- name: Update Install_SecureTransport_V5.5.properties for all nodes
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.lineinfile:
path: "{{ INSTALLER_DIR }}/{{ st_silentfile_properties }}"
regexp: '^{{ item.option }} ='
line: "{{ item.option }} = {{ item.value }}"
with_items:
- { option: 'Component.ACCEPT_GENERAL_CONDITIONS', value: 'Yes' }
- { option: 'Component.JavaHome', value: '{{ AXWAY_HOME }}/Axway/Java/linux-x86/ {{ (file_to_copy.files.0.path |basename).rsplit(".",1)[0] }}' }
- { option: 'SelectedBitArchitecture', value: '64' }
- { option: 'InstMode', value: 'Install' }
- { option: 'SecureTransport', value: 'true' }
- { option: 'SecureTransport.Type', value: 'Module' }
- { option: 'SecureTransport.ModuleType', value: 'Installed' }
- { option: 'SecureTransport.LogicalName', value: 'SecureTransport' }
- { option: 'SecureTransport.ParentName', value: 'null' }
- { option: 'SecureTransport.Title', value: 'Axway SecureTransport V5.5' }
- { option: 'Server.Type', value: 'Module' }
- { option: 'Server.LogicalName', value: 'Server' }
- { option: 'Server.ParentName', value: 'SecureTransport' }
- { option: 'Server.Title', value: 'Server' }
- { option: 'Edge.Type', value: 'Module' }
- { option: 'Edge.LogicalName', value: 'Edge' }
- { option: 'Edge.ParentName', value: 'SecureTransport' }
- { option: 'Edge.Title', value: 'Edge' }
- { option: 'ServerDocker', value: 'false' }
- { option: 'ServerDocker.Type', value: 'Module' }
- { option: 'ServerDocker.ModuleType', value: 'NotInstalled' }
- { option: 'ServerDocker.LogicalName', value: 'ServerDocker' }
- { option: 'ServerDocker.ParentName', value: 'SecureTransport' }
- { option: 'ServerDocker.Title', value: 'ServerDocker' }
- { option: 'InstallDir', value: '{{ AXWAY_HOME }}/SecureTransport/' }
- { option: 'userName', value: '{{ ST_USER }}' }
- { option: 'isNonRootInstall', value: 'true' }
- { option: 'EdgeDocker', value: 'false' }
- { option: 'EdgeDocker.Type', value: 'Module' }
- { option: 'EdgeDocker.ModuleType', value: 'NotInstalled' }
- { option: 'EdgeDocker.LogicalName', value: 'EdgeDocker' }
- { option: 'EdgeDocker.ParentName', value: 'SecureTransport' }
- { option: 'EdgeDocker.Title', value: 'EdgeDocker' }
- { option: 'sslAdminPort', value: '{{ SSL_ADMIN_PORT }}' }
- { option: 'sslAdminPort.Type', value: 'Integer' }
- { option: 'enableLogRotation', value: 'true' }
- { option: 'SecretFilePath', value: '' }
- { option: 'clusterNodeValue', value: '{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}' }
- { option: 'tomcatShutdownPort', value: '8005' }
- { option: 'tomcatShutdownPort.Type', value: 'Integer' }
when:
- not is_installed.stat.exists
- name: Configure Install_SecureTransport_V5.5.properties for ST Core
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.lineinfile:
path: "{{ INSTALLER_DIR }}/{{ st_silentfile_properties }}"
regexp: '^{{ item.option }} ='
line: "{{ item.option }} = {{ item.value }}"
with_items:
- { option: 'Server', value: 'true' }
- { option: 'Server.ModuleType', value: 'Installed' }
- { option: 'Edge', value: 'false' }
- { option: 'Edge.ModuleType', value: 'NotInstalled' }
- { option: 'dbType', value: 'usePostgreSQLExternal' }
- { option: 'postgrePassword.Format', value: 'DefenceV1' }
- { option: 'postgrePassword', value: '' }
- { option: 'postgreHost', value: '{{ DB_HOST }}' }
- { option: 'postgreHost.Type', value: 'HostName' }
- { option: 'postgrePort', value: '{{ DB_PORT }}' }
- { option: 'postgrePort.Type', value: 'Integer' }
- { option: 'postgreLoginName', value: '{{ DB_USER }}' }
- { option: 'postgreDatabaseName', value: '{{ DB_NAME }}' }
- { option: 'postgreUseSecureConnection', value: 'false' }
- { option: 'postgreTrustStoreFilePath', value: '' }
- { option: 'externalDBTrustStore', value: '' }
- { option: 'externalDBUseSecureConnection', value: 'false' }
- { option: 'externalDBUseExistingSchema', value: 'false' }
- { option: 'postgreUseExistingSchema', value: 'false' }
when:
- inventory_hostname in groups["cores"]
- not is_installed.stat.exists
tags:
- st_install
- name: Update DB password in Install_SecureTransport_V5.5.properties
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.shell: "{{ INSTALLER_DIR }}/Tools/SilentFileEditor/SilentFileEditor.sh \
{{ INSTALLER_DIR }}/{{ st_silentfile_properties }} postgrePassword {{ DB_USER_PASSWORD }} -c"
args:
chdir: "{{ INSTALLER_DIR }}/Tools/SilentFileEditor/"
executable: /bin/bash
environment:
JAVA_HOME: "{{ INSTALLER_DIR }}/JRE"
register: user_cmd_result
changed_when: false
when:
- inventory_hostname in groups["cores"]
- not is_installed.stat.exists
tags:
- st_install2
- name: print
debug:
msg: "{{ user_cmd_result }}"
tags:
- st_install2
- name: Configure Install_SecureTransport_V5.5.properties for ST Edge
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.lineinfile:
path: "{{ INSTALLER_DIR }}/{{ st_silentfile_properties }}"
regexp: '^{{ item.option }} ='
line: "{{ item.option }} = {{ item.value }}"
with_items:
- { option: 'Server', value: 'false' }
- { option: 'Server.ModuleType', value: 'NotInstalled' }
- { option: 'Edge', value: 'true' }
- { option: 'Edge.ModuleType', value: 'Installed' }
- { option: 'dbType', value: 'useDBLocal' }
- { option: 'internalDBPort', value: '33060' }
- { option: 'internalDBPort.Type', value: 'IPPortOwner' }
- { option: 'internalDBPort.Max', value: '65535' }
- { option: 'internalDBPort.Min', value: '1024' }
- { option: 'internalDBUseSecureConnection', value: 'false' }
- { option: 'internalDBAutoGenerateCertificates', value: 'false' }
- { option: 'internalDBCaPath', value: '' }
- { option: 'internalDBServerKeyPath', value: '' }
- { option: 'internalDBServerCertPath', value: '' }
- { option: 'externalDBUseExistingSchema', value: 'false' }
- { option: 'externalDBUseSecureConnection', value: 'false' }
when:
- inventory_hostname in groups["edges"]
- not is_installed.stat.exists
tags:
- st_install
- name: Configure Install_SecureTransport_V5.5.properties for ST Core Secondary
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.lineinfile:
path: "{{ INSTALLER_DIR }}/{{ st_silentfile_properties }}"
regexp: '^{{ item.option }} ='
line: "{{ item.option }} = {{ item.value }}"
with_items:
- { option: 'externalDBUseExistingSchema', value: 'true' }
- { option: 'postgreUseExistingSchema', value: 'true' }
- { option: 'SecretFilePath', value: '{{ INSTALLER_DIR }}/taeh' }
- { option: 'SecretFilePath.Type', value: 'File' }
- { option: 'sslAdminPort', value: '' }
- { option: 'tomcatShutdownPort', value: '' }
when:
- inventory_hostname == "core_secondary"
- not is_installed.stat.exists
tags:
- st_install
- name: Configure Install_SecureTransport_V5.5.properties for ST Edge Secondary
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.lineinfile:
path: "{{ INSTALLER_DIR }}/{{ st_silentfile_properties }}"
regexp: '^{{ item.option }} ='
line: "{{ item.option }} = {{ item.value }}"
with_items:
- { option: 'SecretFilePath', value: '{{ INSTALLER_DIR }}/taeh' }
- { option: 'SecretFilePath.Type', value: 'File' }
- { option: 'tomcatShutdownPort', value: '' }
when:
- inventory_hostname == "edge_secondary"
- not is_installed.stat.exists
tags:
- st_install
- name: SilentInstall SecureTransport Primaries
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.command: "{{ INSTALLER_DIR }}/setup.sh -Xmx 6G -s {{ INSTALLER_DIR }}/{{ installer_properties }}"
changed_when: false
environment:
TEMPORARY_DIR: /tmp
args:
chdir: "{{ INSTALLER_DIR }}"
when:
- inventory_hostname == "edge_primary" or inventory_hostname == "core_primary"
- not is_installed.stat.exists
tags:
- st_install
- name: Get the taeh from the ST server primary
ansible.builtin.fetch:
src: "{{ AXWAY_HOME }}/SecureTransport/bin/taeh"
dest: files/core/
flat: true
when: inventory_hostname == "core_primary"
tags:
- st_install
- name: Get the taeh from the ST edge primary
ansible.builtin.fetch:
src: "{{ AXWAY_HOME }}/SecureTransport/bin/taeh"
dest: files/edge/
flat: true
when: inventory_hostname == "edge_primary"
tags:
- st_install
- name: Push the taeh file to the secondary core
ansible.builtin.copy:
src: files/core/taeh
dest: "{{ INSTALLER_DIR }}/taeh"
owner: "{{ ST_USER }}"
group: "{{ ST_GROUP }}"
mode: '0755'
when: inventory_hostname == "core_secondary"
tags:
- st_install
- name: Push the taeh file to the secondary edge
ansible.builtin.copy:
src: files/edge/taeh
dest: "{{ INSTALLER_DIR }}/taeh"
owner: "{{ ST_USER }}"
group: "{{ ST_GROUP }}"
mode: '0755'
when: inventory_hostname == "edge_secondary"
tags:
- st_install
- name: SilentInstall SecureTransport Secondaries
become: true
become_user: "{{ ST_USER }}"
ansible.builtin.command: "{{ INSTALLER_DIR }}/setup.sh -Xmx 6G -s {{ INSTALLER_DIR }}/{{ installer_properties }}"
changed_when: false
environment:
TEMPORARY_DIR: /tmp
args:
chdir: "{{ INSTALLER_DIR }}"
when:
- inventory_hostname == "edge_secondary" or inventory_hostname == "core_secondary"
- not is_installed.stat.exists
tags:
- st_install
- name: Download and extract the Azure FileStorage plugin
ansible.builtin.unarchive:
src: "{{ AZURE_FILE_PLUGIN }}"
dest: "{{ AXWAY_HOME }}/SecureTransport/plugins/transferSites/"
mode: '0755'
group: "{{ ST_GROUP }}"
owner: "{{ ST_USER }}"
validate_certs: false
remote_src: true
when:
- inventory_hostname in groups["cores"]
tags:
- st_install
- axway_lab_specific
- name: Download and extract the s3 plugin
ansible.builtin.unarchive:
src: "{{ s3_PLUGIN }}"
dest: "{{ AXWAY_HOME }}/SecureTransport/plugins/transferSites/"
mode: '0755'
group: "{{ ST_GROUP }}"
owner: "{{ ST_USER }}"
validate_certs: false
remote_src: true
when:
- inventory_hostname in groups["cores"]
tags:
- st_install
- axway_lab_specific
- name: Download and extract the SMB plugin
ansible.builtin.unarchive:
src: "{{ SMB_PLUGIN }}"
dest: "{{ AXWAY_HOME }}/SecureTransport/plugins/transferSites/"
mode: '0755'
group: "{{ ST_GROUP }}"
owner: "{{ ST_USER }}"
validate_certs: false
remote_src: true
when:
- inventory_hostname in groups["cores"]
tags:
- st_install
- axway_lab_specific
handlers:
- name: enable core_services # noqa: name[casing]
become: true
become_user: root
loop: "{{ services_data | selectattr('changed', 'equalto', true) | map(attribute='item') | map(attribute='svc_name') | list }}"
ansible.builtin.systemd:
enabled: true
name: "securetransport_{{ item }}"
- name: reload systemd # noqa: name[casing]
become: true
become_user: root
ansible.builtin.systemd:
daemon_reload: true