-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathipst.yml
298 lines (217 loc) · 11.2 KB
/
ipst.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
---
#
# Copyright (c) 2016, RTE (http://www.rte-france.com)
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
#
###
###
# This ansible playbook builds and installs IPST on a target CentOS linux (tested versions 6.5, 7.0, 7.2). In particular:
#
# A) it installs on the target server all the OS packages and SW runtimes, needed to build and run the platform
# -C/C++development tools (gcc, g++, make, git, etc)
# -CMake
# -OpenMPI (sources installation + local build with flag --enable-mpi-thread-multiple)
# -Oracle JDK8
# -Apache Maven
# -DBMaria
# -WildFly
# -MATLAB Runtime (MCR)
# -Hades
# -default data in case of itesla testing
#
# Notes:
# 1) admin rights are required to install all the above mentioned packages and runtimes
# 2) in case all the packages are already available on the target OS, this step can be skipped ( set variable installPrerequisites to be False, in the inventory ipst-hosts file)
#
# B) on the target server(s): it clones the IPST project sources from GitHub (or pull onto an existing repository), builds the 'platform distribution' and installs it
#
# C) on the target server(s): can integrate a situation/network data and test two base tools (security-analysis and ddb-load-eurostag)
#
##
# the target hosts
- hosts: all
###
###
# environment variables at this playbook level
environment: "{{ ipst_environment | default('{}') }}"
###
###
vars:
## if set, clone/updates the ipst repository on target OS from github
ipst_github_enabled: "{{ github_enabled|default('True') }}"
## if set to False, do not try installing all the prerequisite packages: common development tools, openmpi libraries, jdk, maven;
## useful if already available on the target OS and no admin rights are available
installPrerequisites: "{{ install_prerequisites|default('True') }}"
## if set to False, do not try installing the matlab runtime;
## useful if already available on the target OS and no admin rights are available
installMCR: "{{ install_MCR|default('False') }}"
## if set to True, always triggers the ipst platfrom build, even if there are no updates from github
forceBuild: "{{ force_build|default('True') }}"
## OS target project root path, contains source, binary files and standalone tools
project_home: "{{ user_project_home |default( ansible_env.HOME) }}"
## OS target temporary path, relative to project home
project_temporary: "{{ project_home + '/'+ user_project_temporary |default('tmp') }}"
## OS target script path, relative to project home
project_script: "{{ project_home + '/scripts' }}"
## prefix for locale log file
log_file_prefix_default: "{{ playbook_dir }}/install"
log_file_prefix: "{{ user_log_file_prefix |default(log_file_prefix_default) }}"
# postfix for locale log file
log_file_postfix_default: "{{ inventory_hostname+'.log' }}"
log_file_postfix: "{{ user_log_file_postfix |default(log_file_postfix_default) }}"
## source root path on target OS where sources will be cloned/updated, relative to project home
root_sources_path_default: "sources"
root_sources_path: "{{ project_home + '/' + user_source_root|default(root_sources_path_default) }}"
## path on target OS where powsybl-core sources will be cloned/updated, relative to root_sources_path
core_sources_path_default: "powsybl-core"
core_sources_path: "{{ root_sources_path + '/' + user_core_source|default(core_sources_path_default) }}"
## path on target OS where cgmes sources will be cloned/updated, relative to root_sources_path
cgmes_sources_path_default: "CGMES"
cgmes_sources_path: "{{ root_sources_path + '/' + user_cgmes_source|default(cgmes_sources_path_default) }}"
## path on target OS where ipst sources will be cloned/updated, relative to root_sources_path
ipst_sources_path_default: "ipst"
ipst_sources_path: "{{ root_sources_path + '/' + user_ipst_source|default(ipst_sources_path_default) }}"
## path on target OS where ipst thirdparty libraries will be installed, relative to project home
ipst_thirdparty_path_default: "thirdparty"
ipst_thirdparty_path: "{{ project_home + '/' + user_source_thirdparty|default(ipst_thirdparty_path_default) }}"
## path on target OS where ipst will be installed, relative to project home
ipst_install_path_default: "itools"
ipst_install_path: "{{ project_home + '/' + user_project_bin|default(ipst_install_path_default) }}"
## path on local OS, source of additional thirdparty libraries to be installed (as-is: untgz to ipst_install_path)
misc_thirdparties_path: "./misc"
## ipst github project details
### TODO branchname must be set to master, eventually
ipst_github_branchname: "{{ ipst_project_branch |default('master') }}"
core_github_branchname: "{{ powsybl_core_project_branch |default('master') }}"
cgmes_github_branchname: "{{ powsybl_cgmes_project_branch |default('master') }}"
## ipst_thirdparty_packs, relative to project home
ipst_thirdparty_packs_path_default: "{{ project_home }}/thirdparty_packs"
ipst_thirdparty_packs_path: "{{ thirdparty_packs|default(ipst_thirdparty_packs_path_default) }}"
##----------------------------------------------------------------------------------------------------------
## jdk install
##
## jdk archive url
jdk8_url_default: "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz"
jdk8_url: "{{ user_jdk8_url |default(jdk8_url_default) }}"
## OS target jdk installation path, relative to project home
jdk8_home_default: "{{ 'java/jdk1.8.0_144' }}"
jdk8_home: "{{ project_home+'/'+ user_jdk8_home |default( jdk8_home_default ) }}"
## 1= log is activate, log is inactivate otherwise
jdk8_log: "{{ user_jdk8_log |default(0) }}"
##----------------------------------------------------------------------------------------------------------
## mariadb parameters
##
##
mariadb_version_default: "10.2.9"
mariadb_version: "{{ user_mariadb_version |default( mariadb_version_default ) }}"
##
mariadb_home_default: "{{ '/mariadb-' + mariadb_version }}"
mariadb_home: "{{ project_home+'/'+ user_mariadb_home|default(mariadb_home_default) }}"
##
mariadb_archivename: "mariadb-{{ mariadb_version }}-linux-x86_64.tar.gz"
##
mariadb_url: "https://downloads.mariadb.org/f/mariadb-10.2.9/bintar-linux-systemd-x86_64/mariadb-10.2.9-linux-systemd-x86_64.tar.gz/from/http%3A//ftp.hosteurope.de/mirror/archive.mariadb.org/?serve"
##
mariadb_conf: "{{ mariadb_home }}/my.cnf"
##
mariadb_log_file: "{{ log_file_prefix+'_mariadb_'+log_file_postfix }}"
##----------------------------------------------------------------------------------------------------------
## database parameters
##
## if set to True, database loading
ddb_process: "{{ user_ddb_process|default('False') }}"
## define the eurostag version
ddb_eurostag_version: "{{ user_ddb_eurostag_version|default('5.1.1') }}"
## test data archive name
ddb_archive_name_default: 'minimalist_DDB.zip'
ddb_archive_name: "{{ user_ddb_archive_name |default(ddb_archive_name_default) }}"
## local archive path of the data to integrate
ddb_locale_path_default: "{{ ansible_env.HOME }}/"
ddb_locale_path: "{{ user_ddb_locale_path |default(ddb_locale_path_default) }}"
## OS target data path to integrate
ddb_remote_path_default: "minimalist_DDB"
ddb_remote_path: "{{ project_home+'/'+ user_ddb_remote_path |default(ddb_remote_path_default) }}"
## local db log file
ddb_log_file: "{{ log_file_prefix+'_ddb_'+log_file_postfix }}"
##----------------------------------------------------------------------------------------------------------
## the project ear name
ear_name_default: "iidm-ddb-ear.ear"
ear_name: "{{ user_ear_name |default(ear_name_default) }}"
## ear remote path relative to the install path
ear_path_default: "iidm-ddb/iidm-ddb-ear/target"
ear_path: "{{ user_ear_path |default(ear_path_default) }}"
##----------------------------------------------------------------------------------------------------------
## hades parameters
## if set to True, do test Hades part
hades_process: "{{ user_hades_process|default('True') }}"
## hades binary archive name
hades_archive_name: "{{ user_hades_archive_name |default('hades2LF.tar.gz') }}"
#hades_archive_name: "{{ user_hades_archive_name |default('hades2LF.zip') }}"
## local hades binary archive path
hades_src: "{{ user_hades_src |default('/$HOME/tmp/hades') + '/'+hades_archive_name }}"
## target OS hades prefix path install relative to project home
hades_dst: "{{ project_home + '/'+user_hades_dst |default( '' ) }}"
## target OS hades path install
hades_create: "{{ hades_dst + '/'+ user_hades_create |default('hades2LF') }}"
## test situation file name
hades_situation_test: "{{ user_hades_situation_test |default('20160101_0030_FO5_FR0.xiidm.gz') }}"
##
hades_situation_prefix: "{{ user_hades_situation_prefix |default('/DATA/IIDM/FO/2016/01/01') }}"
## local test situation path
hades_situations_src: "{{ user_hades_situations_prefix_src |default('/$HOME/tmp/situations/grovslb1/local') + hades_situation_prefix + '/'+ hades_situation_test }}"
## target OS test situation path
hades_situations_dst: "{{ project_home + '/' + user_hades_situations_home|default( 'situations' + hades_situation_prefix) }}"
## result filename
hades_result_file: "{{ project_home + '/' + user_hades_result_file |default('security-analysis-result.txt') }}"
## show discalmer, default is no
hades_isDisclaimerPrompt: "{{ user_hades_isDisclaimerPrompt |default(False) }}"
## disclaimer
hades_disclaimer: "{{ user_hades_disclaimer |default('no disclaimer') }}"
## hades_log_file
hades_log_file: "{{ log_file_prefix+'_hades_'+log_file_postfix }}"
###
###
### dump variable's content
pre_tasks:
- debug:
var="{{ item }}"
when: "0==0"
with_items:
- user_project_home
- ipst_github_branchname
- core_github_branchname
- root_sources_path
- ipst_sources_path
- ipst_install_path
- ipst_thirdparty_path
- core_sources_path
- core_github_branchname
#
- name: create directory
file: state=directory
path={{ item }}
with_items:
- "{{ project_home }}"
- "{{ project_temporary }}"
- "{{ hades_dst }}"
- "{{ project_script }}"
#- "{{ hades_situations_dst }}"
###
###
###
roles:
- { role: ipst.common, when: "installPrerequisites == True", become: "yes" }
- { role: ipst.openmpi, when: "installPrerequisites == True", become: "yes" }
- { role: ipst.jdk8, when: "installPrerequisites == True" }
- { role: ipst.maven, when: "installPrerequisites == True" }
- { role: ipst.mariadb, when: "installPrerequisites == True" }
- { role: ipst.wildfly, when: "installPrerequisites == True" }
- { role: ipst.mcr, when: "installMCR == True", become: "yes" }
- { role: ipst.ipst }
- { role: ipst.scripts }
- { role: ipst.final , when: "ddb_process == True" }
- { role: ipst.hades , when: "hades_process == True" }
- { role: samples.nordic44, when: "installNordic44 is defined", tags: 'Nordic44'}