-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathdrupal.yml
108 lines (91 loc) · 3.77 KB
/
drupal.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
---
- name: Trusted Host Settings
blockinfile:
state: present
block: |
$settings['trusted_host_patterns'] = array(
{% for host in drupal_trusted_hosts %}
'{{ host }}',
{% endfor %}
);
$settings['flysystem'] = [
'fedora' => [
'driver' => 'fedora',
'config' => [
'root' => '{{ fedora_base_url }}',
],
],
];
path: "{{ drupal_trusted_hosts_file }}"
marker: // {mark} ANSIBLE MANAGED BLOCK
- name: Uninstall core search module
command: "{{ drush_path }} --root {{ drupal_core_path }} -y pm-uninstall search"
register: uninstall_search
changed_when: "'successfully uninstalled' in uninstall_search.stdout"
- name: Get Carapace status
command: "{{ drush_path }} --root {{ drupal_core_path }} pm-list --format=json"
register: carapace_enabled
changed_when: false
- name: Enable Carapace if not enabled
command: "{{ drush_path }} --root {{ drupal_core_path }} then -y carapace"
when: ((carapace_enabled.stdout|from_json).carapace.status|lower) != 'enabled'
- name: Test if theme is Carapace
command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-get system.theme default"
register: drupal_theme_carapace
changed_when: false
check_mode: no
- name: Set theme to carapace
command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set system.theme default carapace"
when: "'carapace' not in drupal_theme_carapace.stdout"
- name: Set permissions on the public files directory
file:
recurse: yes
state: directory
path: "{{ drupal_public_filesystem }}"
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
- name: Create drupal configs directory.
file:
state: directory
path: "{{ webserver_app_drupal_config_path }}"
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
- name: Import features
command: "{{ drush_path }} --root {{ drupal_core_path }} -y fim islandora_core_feature,controlled_access_terms_defaults,islandora_defaults,islandora_search"
# masonry library is required by content_browser and not installed by composer due to issue 2971165.
- name: Create drupal library directory.
file:
state: directory
path: "{{ drupal_external_libraries_directory }}"
owner: "{{ webserver_app_user }}"
group: "{{ webserver_app_user }}"
- name: Unarchive masonry library.
unarchive:
src: "https://github.com/desandro/masonry/archive/v3.3.2.zip"
dest: "{{ drupal_external_libraries_directory }}"
creates: "{{ drupal_external_libraries_directory }}/masonry"
remote_src: yes
- name: Rename masonry directory.
command: mv "{{ drupal_external_libraries_directory }}/masonry-3.3.2" "{{ drupal_external_libraries_directory }}/masonry"
args:
creates: "{{ drupal_external_libraries_directory }}/masonry"
# Set Matomo Settings
- name: Set Matomo site id.
command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set matomo.settings site_id 1"
register: set_search_api_config
changed_when: "'Do you want to update site_id' in set_search_api_config.stdout"
- name: Set Matmo sever url.
command: "{{ drush_path }} --root {{ drupal_core_path }} -y config-set matomo.settings url_http http://localhost:8000/matomo/"
register: set_search_api_config
changed_when: "'Do you want to update site_id' in set_search_api_config.stdout"
# pdf.js library
- name: ensure pdf.js directory exists
file:
path: "{{ drupal_external_libraries_directory }}/pdf.js"
state: directory
- name: Unarchive pdf.js library
unarchive:
src: "https://github.com/mozilla/pdf.js/releases/download/v2.0.943/pdfjs-2.0.943-dist.zip"
dest: "{{ drupal_external_libraries_directory }}/pdf.js"
creates: "{{ drupal_external_libraries_directory }}/pdf.js/build"
remote_src: yes