-
Notifications
You must be signed in to change notification settings - Fork 19
/
folio.yml
267 lines (251 loc) · 7.82 KB
/
folio.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
---
# Ansible playbook to deploy Okapi and FOLIO modules
# Provision a host as a backend FOLIO system
- hosts: all
become: yes
become_method: sudo
gather_facts: no
tasks:
- name: Bootstrap Python 3
raw: test -e /usr/bin/python3 || (apt -qqy update && apt install -qy python3-minimal)
register: python3_output
changed_when: python3_output.stdout != ""
- name: Use Python 3 for Ansible
set_fact:
ansible_python_interpreter: /usr/bin/python3
- hosts: all
roles:
- common
- role: postgresql
pg_max_conn: 1000
- docker-engine
- kafka-zk
- okapi-docker-container
# Additional infrastructure for platform-complete builds
- hosts: testing:snapshot:release
roles:
- role: minio-docker # for multiple modules
minio_buckets:
- "{{ lists_app_bucket_name | default('lists-app-bucket') }}" # mod-lists requires the bucket to be created ahead of time
- role: elasticsearch # for mod-search
# Configure builds
# Need to build the webpack early to allow enough RAM for the build
# But don't want to register or enable modules at this point
#
# Deprecated: FOLIO-3419
- name: Configure testing build
hosts: testing
pre_tasks:
- name: set data export and erm AWS URL for minio
set_fact:
data_export_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
erm_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
roles:
- role: stripes-build
okapi_register_modules: false
okapi_enable_modules: false
- okapi-register-modules
- tenant-data
- okapi-tenant-deploy
- create-tenant-admin
- tenant-admin-permissions
- set-patron-group
# Configure build for top-down deployment
# (Okapi dependency resolution)
- name: Configure snapshot build
hosts: snapshot
pre_tasks:
- name: set AWS URLs for minio
set_fact:
data_export_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
erm_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
oai_pmh_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
mod_elinks_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
mod_marc_migrations_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
lists_app_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
roles:
- role: stripes-build
okapi_register_modules: false
okapi_enable_modules: false
- okapi-pull
- tenant-data
- role: build-module-list
deploy_url: "https://raw.githubusercontent.com/folio-org/platform-complete/snapshot/okapi-install.json"
enable_url: "https://raw.githubusercontent.com/folio-org/platform-complete/snapshot/stripes-install.json"
- okapi-deployment
- role: okapi-tenant-deploy
create_db: no
module_env: []
- create-tenant-admin
- tenant-admin-permissions
- set-patron-group
- ldp
- mod-ldp-config
- name: Configure release build
hosts: release-core:release
pre_tasks:
- name: set data export and erm AWS URL for minio
set_fact:
data_export_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
erm_aws_url: "http://{{ ansible_default_ipv4.address }}:{{ minio_port|default('9000') }}"
roles:
- role: stripes-build
okapi_register_modules: false
okapi_enable_modules: false
- okapi-pull
- tenant-data
- build-module-list
- okapi-deployment
- role: okapi-tenant-deploy
create_db: no
module_env: []
- create-tenant-admin
- tenant-admin-permissions
- set-patron-group
- ldp
- mod-ldp-config
# Edge modules
- name: Set up Okapi to support edge modules
hosts: testing
roles:
- role: okapi-register-modules
folio_modules:
- name: mod-oai-pmh
- name: mod-rtac
- name: mod-gobi
- name: edge-oai-pmh
- name: edge-rtac
- name: edge-orders
- role: okapi-tenant-deploy
folio_modules:
- name: mod-oai-pmh
deploy: yes
- name: mod-rtac
deploy: yes
- name: mod-gobi
deploy: yes
- name: edge-oai-pmh
- name: edge-rtac
- name: edge-orders
- tenant-admin-permissions
- name: Set up edge modules
hosts: testing:snapshot:release
roles:
- role: edge-module
edge_module: edge-rtac
edge_module_publish_port: 9700
edge_module_path: /prod/rtac
edge_module_expose_port: 8081
edge_module_docker_env:
LOG4J_FORMAT_MSG_NO_LOOKUPS: "true"
auth_required: yes
inst_user_perms:
- rtac.all
- role: edge-module
edge_module: edge-oai-pmh
edge_module_publish_port: 9701
edge_module_path: /oai
edge_module_expose_port: 8081
edge_module_docker_env:
LOG4J_FORMAT_MSG_NO_LOOKUPS: "true"
auth_required: yes
inst_user_perms:
- oai-pmh.all
edge_extra_tenants:
- tenant_id: test_oaipmh
inst_user:
username: test-user
password: test
- role: edge-module
edge_module: edge-orders
edge_module_publish_port: 9702
edge_module_path: /orders
edge_module_expose_port: 8081
edge_module_docker_env:
LOG4J_FORMAT_MSG_NO_LOOKUPS: "true"
auth_required: yes
inst_user_perms:
- gobi.all
- ebsconet.all
edge_extra_tenants:
- tenant_id: test_edge_orders
inst_user:
username: test-user
password: test
- role: edge-module
edge_module: edge-inn-reach
edge_module_publish_port: 9703
edge_module_path: /innreach
edge_module_expose_port: 8081
edge_module_docker_env:
JAVA_OPTIONS: "-XX:MaxRAMPercentage=66.0"
LOG4J_FORMAT_MSG_NO_LOOKUPS: "true"
edge_module_cmd: "--okapi_url={{edge_module_okapi_url}} --secure_store_props=/mnt/{{ edge_module }}-ephemeral.properties"
inst_user:
username: "innreachClient"
password: "admin"
personal:
lastName: SYSTEM
firstName: innreachClient
inst_user_perms:
- inn-reach.all
edge_http_version: 1.1
edge_extra_tenants:
- tenant_id: test_edge_inn_reach
inst_user:
username: innreachClient
password: "password"
edge_tenants_mappings:
- tenant: "{{ tenant }}"
mapping: fli01
- tenant: "test_edge_inn_reach"
mapping: "5858f9d8-1558-4513-aa25-bad839eb803a"
# Sample data for snapshot-core, testing, snapshot
- name: Add sample users for permissions testing
hosts: testing:snapshot:release
roles:
- add-users
- name: Add testing_admin user for diku with okapi.all permissions
hosts: snapshot-core:snapshot:testing-core:testing:release-core:release
roles:
- role: create-user
username: testing_admin
password: admin
permissions:
- okapi.all
# Set up stripes
- name: Build stripes webpack, assign permissions
hosts: stripes-build
roles:
- role: stripes-build
build_webpack: no
- tenant-admin-permissions
- name: Build Stripes webpack and container, assign permissions
hosts: stripes
roles:
- stripes-docker
- tenant-admin-permissions
- name: Build Stripes container
hosts: stripes-docker
roles:
- stripes-docker
- name: Install Stripes on local installed nginx
hosts: stripes-nginx
roles:
- stripes-nginx
- tenant-admin-permissions
- name: Secure Okapi Supertenant
hosts: production
roles:
- okapi-secure
# Roles for packaging
- hosts: vagrant
tasks:
- name: Install maven
become: yes
apt:
name:
- maven
- hosts: packer
roles:
- vagrant-tidy