forked from yorkulibraries/yudl-playbook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
post-install.yml
242 lines (191 loc) · 11.7 KB
/
post-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
---
- hosts: webserver
become: yes
# add some vars here so we can run with --start-at-task if desired
vars:
webserver_app_user: "www-data"
vagrant_user: "vagrant"
tasks:
- name: Get Islandora PREMIS
git:
repo: https://github.com/mjordan/islandora_premis.git
dest: "{{ drupal_core_path }}/modules/contrib/islandora_premis"
version: 8.x-1.x
force: yes
- name: Enable Islandora PREMIS # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y en islandora_premis"
- name: Get Islandora Workbench
git:
repo: https://github.com/mjordan/islandora_workbench.git
dest: "/opt/islandora_workbench"
version: main
force: yes
- name: Install Islandora Workbench dependencies
shell: "cd /opt/islandora_workbench; python setup.py install"
- name: Create workbench env
file:
path: "/opt/workbench/{{ item }}"
owner: "{{ vagrant_user }}"
group: "{{ vagrant_user }}"
recurse: yes
state: directory
with_items: ["configs", "logs", "data"]
- name: Get YUDL collections workbench configs
template:
src: "yudl-collections-{{ item }}.yml"
owner: "{{ vagrant_user }}"
group: "{{ vagrant_user }}"
dest: /opt/workbench/configs
with_items: ["00", "01", "02", "03", "04", "06", "07", "08", "09"]
- name: Get sample data workbench configs
template:
src: "{{ item }}.yml"
owner: "{{ vagrant_user }}"
group: "{{ vagrant_user }}"
dest: /opt/workbench/configs
with_items: ["paged", "single"]
when: env != "staging" or env != "production"
- name: Get sample data
unarchive:
remote_src: yes
src: http://alpha.library.yorku.ca/sample-data.zip
owner: "{{ vagrant_user }}"
group: "{{ vagrant_user }}"
dest: /opt/workbench/data
when: env != "staging" or env != "production"
- name: Add admin to fedoraAdmin role # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y urol fedoraadmin admin"
# Set jsonld module to strip ?_format=jsonld
- name: Set JSONLD Config # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cset --input-format=yaml jsonld.settings remove_jsonld_format {{ drupal_jsonld_remove_format }}"
- name: Set broker_url (PRODUCTION) # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cset islandora.settings broker_url 'tcp://10.0.0.16:61613'"
when: env == "production"
- name: Set JWT Expiry # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cset islandora.settings jwt_expiry '{{ islandora_jwt_expiry }}'"
- name: Set pseudo field bundles # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cset --input-format=yaml islandora.settings gemini_pseudo_bundles.{{ item.0 }} {{ item.1 }}"
with_indexed_items: "{{ drupal_gemini_pseudo_bundles }}"
- name: Set media urls # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cset --input-format=yaml media.settings standalone_url true"
- name: Set iiif url # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cset --input-format=yaml islandora_iiif.settings iiif_server {{ openseadragon_iiiv_server }}"
- name: Set iiif manifest view # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cset --input-format=yaml openseadragon.settings manifest_view iiif_manifest"
- name: Run Islandora migration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} --userid=1 mim islandora_tags"
- name: Run Islandora FITS migration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} --userid=1 mim islandora_fits_tags"
- name: Run York migration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} --userid=1 mim islandora_defaults_00_tags,islandora_defaults_01_rights,islandora_defaults_02_languages,islandora_defaults_03_physical_form,islandora_defaults_04_genre,islandora_defaults_05_continent,islandora_defaults_06_country,islandora_defaults_07_province,islandora_defaults_08_city_section,islandora_defaults_09_corporate_body,islandora_defaults_10_person,islandora_defaults_11_city,islandora_defaults_12_county,islandora_defaults_13_region,islandora_defaults_15_access"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config restricted islandora_access"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config york_university islandora_access"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config media-type-access-fields.audio field_access_terms"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config media-type-access-fields.document field_access_terms"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config media-type-access-fields.extracted_text field_access_terms"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config media-type-access-fields.file field_access_terms"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config media-type-access-fields.image field_access_terms"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config media-type-access-fields.remote_video field_access_terms"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config media-type-access-fields.video field_access_terms"
- name: Islandora Groups configuration # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset islandora_group.config node-type-access-fields.islandora_object field_access_terms"
- name: Add mov to video formats # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset field.field.media.video.field_media_video_file settings.file_extensions 'mp4 mov'"
- name: Set site email # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset system.site mail {{ certbot_admin_email }}"
when: env == "staging" or env == "production"
- name: Set update notifications email # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset update.settings notification.emails {{ certbot_admin_email }}"
when: env == "staging" or env == "production"
- name: Set admin only account creation # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} cset user.settings register admin_only"
- name: Add admin users # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} ucrt {{ item }}"
loop: "{{ lookup('file', 'templates/list_of_admin_users').splitlines() }}"
- name: Add islandora admin users # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} ucrt {{ item }}"
loop: "{{ lookup('file', 'templates/list_of_islandora_admin_users').splitlines() }}"
- name: Add islandora creator users # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} ucrt {{ item }}"
loop: "{{ lookup('file', 'templates/list_of_islandora_creator_users').splitlines() }}"
- name: Add past islandora creators # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} ucrt {{ item }}"
loop: "{{ lookup('file', 'templates/list_of_past_islandora_creators').splitlines() }}"
- name: Add admin users to admin role # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y -l localhost:{{ apache_listen_port }} urol administrator {{ item }}"
loop: "{{ lookup('file', 'templates/list_of_admin_users').splitlines() }}"
- name: Add vagrant user to webserver app user group
user: name={{ vagrant_user }}
groups={{ webserver_app_user }}
append=yes
- name: Chown islandora core feature
file:
dest: "{{ drupal_core_path }}/modules/contrib/islandora/modules/islandora_core_feature"
state: directory
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
mode: 0775
recurse: yes
- name: Chown islandora_defaults feature
file:
dest: "{{ drupal_core_path }}/modules/contrib/yudl_defaults"
state: directory
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
mode: 0775
recurse: yes
- name: Chown yudl_customizations
file:
dest: "{{ drupal_core_path }}/modules/custom/yudl_customizations"
state: directory
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
mode: 0775
recurse: yes
- name: Chown yudl_barrio_subtheme
file:
dest: "{{ drupal_core_path }}/themes/contrib/yudl_barrio_subtheme"
state: directory
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
mode: 0775
recurse: yes
- name: Chown controlled access terms default configuration
file:
dest: "{{ drupal_core_path }}/modules/contrib/controlled_access_terms/modules/controlled_access_terms_defaults"
state: directory
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
mode: 0775
recurse: yes
- name: Apply patched LDAP library https://www.drupal.org/project/ldap/issues/3151284
template:
src: Connection.php.j2
dest: "/var/www/html/drupal/vendor/grahl/ldap/Adapter/ExtLdap/Connection.php"
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
mode: 0755
when: env == "staging" or env == "production"
- name: Clear cache # noqa 301
command: "{{ drush_path }} --root {{ drupal_core_path }} -y cr"
- name: Restart Apache
service:
name: apache2
state: restarted
when: env == "staging" or env == "production"
- name: Add YUDL collections via islandora workbench
command: "/opt/islandora_workbench/workbench --config /opt/workbench/configs/yudl-collections-{{ item }}.yml"
with_items: ["00", "01", "02", "03", "04", "06", "07", "08", "09"]
- name: Add sample objects via islandora workbench
command: "/opt/islandora_workbench/workbench --config /opt/workbench/configs/{{ item }}.yml"
with_items: ["paged", "single"]
when: env != "staging" or env != "production"