This repository has been archived by the owner on Sep 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
cms.yml
218 lines (187 loc) · 10.3 KB
/
cms.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
---
- name: Setup TYPO3 CMS site directories
become: vagrant
file: path={{ typo3_webroot }}{{ item }} state=directory mode=0775
with_items: "{{ typo3.cms.sites.keys() }}"
tags: typo3-cms-sites
- name: Create fileadmin directories
become: vagrant
file: path={{ typo3_webroot }}{{ item.key }}/fileadmin state=directory mode=0775
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-directories
- name: Create typo3conf directories
become: vagrant
file: path={{ typo3_webroot }}{{ item.key }}/typo3conf state=directory mode=0775
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-directories
- name: Create typo3temp directories
become: vagrant
file: path={{ typo3_webroot }}{{ item.key }}/typo3temp state=directory mode=0775
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-directories
- name: Add typo3_console composer.6.x.json to TYPO3 CMS 6.x web roots
become: vagrant
template: src=cms/composer.6.x.json dest={{ typo3_webroot }}{{ item.key }}/composer.json
when: item.key | match('^6\\.\d\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-composer
- name: Add typo3_console composer.7.x.json to TYPO3 CMS 7.x web roots
become: vagrant
template: src=cms/composer.7.x.json dest={{ typo3_webroot }}{{ item.key }}/composer.json
when: item.key | match('^(7\\.\d)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-composer
- name: Add typo3_console composer.json to TYPO3 CMS 8.x and up web roots
become: vagrant
template: src=cms/composer.json dest={{ typo3_webroot }}{{ item.key }}/composer.json
when: item.key | match('^(8\\.\d|9\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-composer
- name: Composer install typo3_console for TYPO3 CMS 6.x, 7.x, 8.x and 9.x web roots | non dev
become: vagrant
composer: command=install working_dir={{ typo3_webroot }}{{ item.key }} prefer_dist="yes"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and (typo3_composer_install_dev == "no")
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-composer
- name: Composer install typo3_console for TYPO3 CMS 6.x, 7.x, 8.x and 9.x web roots | dev
become: vagrant
composer: command=install working_dir={{ typo3_webroot }}{{ item.key }} no_dev="no"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and (typo3_composer_install_dev == "yes")
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-composer
#- name: Composer install TYPO3 CMS 7.2 and up
# become: vagrant
# composer: command=install working_dir={{ typo3_webroot }}{{ item.key }}/typo3_src
# when: item.key | match('^((7)\\.(2|3|4|5|6|7|8|9|1\d)|dev-master|master|review)\\.')
# with_dict: "{{typo3.cms.sites }}"
# tags: typo3-cms-composer
- name: typo3_console installation of TYPO3
become: vagrant
shell: if [ ! -f {{ typo3_webroot }}{{ item.key }}/typo3conf/LocalConfiguration.php ]; then cd {{ typo3_webroot }}{{ item.key }} && ./bin/typo3cms install:setup --force --database-user-name=typo3 --database-user-password={{ mariadb.password }} --database-host-name=localhost --database-port=3600 --database-name={{ item.key | regex_replace('\.', '_') }} --admin-user-name=admin --admin-password={{ mariadb.password }} --site-name=TYPO3 --use-existing-database --no-interaction; fi
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
ignore_errors: yes
tags: typo3-cms-composer
- name: Flushing Caches
become: vagrant
command: rm -rf {{ typo3_webroot }}{{ item.key }}/typo3temp/Cache
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-composer
#- name: typo3_console cache warmup
# become: vagrant
# shell: "cd {{ typo3_webroot }}{{ item.key }} && ./bin/typo3cms cache:warmup"
# when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
# with_dict: "{{typo3.cms.sites }}"
# ignore_errors: yes
# tags: typo3-console
- name: typo3_console install extension accountmanagement
become: vagrant
shell: "cd {{ typo3_webroot }}{{ item.key }} && ./bin/typo3cms extension:activate accountmanagement"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
ignore_errors: yes
tags: typo3-console
- name: typo3_console install extensions
become: vagrant
shell: "cd {{ typo3_webroot }}{{ item[0] }} && ./bin/typo3cms extension:activate {{ item[1] }}"
when: item[0] | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and typo3.cms.extensions.enabled is defined
with_nested:
- "{{ typo3.cms.sites.keys() }}"
- "{{ typo3.cms.extensions.enabled }}"
ignore_errors: yes
tags: typo3-console
- name: typo3_console uninstall extensions
become: vagrant
shell: "cd {{ typo3_webroot }}{{ item[0] }} && ./bin/typo3cms extension:deactivate {{ item[1] }}"
when: item[0] | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and typo3.cms.extensions.disabled is defined
with_nested:
- "{{ typo3.cms.sites.keys() }}"
- "{{ typo3.cms.extensions.disabled }}"
ignore_errors: yes
tags: typo3-console
- name: typo3_console install introduction distribution
become: vagrant
shell: "cd {{ typo3_webroot }}{{ item.key }}; ./bin/typo3cms extension:activate realurl; ./bin/typo3cms extension:activate css_styled_content; ./bin/typo3cms extension:activate bootstrap_package; ./bin/typo3cms extension:activate introduction; ./bin/typo3cms cache:flush"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
ignore_errors: yes
tags: typo3-console
- name: Setup git push for typo3_console CMS Sources
become: vagrant
shell: cd {{ typo3_webroot }}{{ item.key }}/typo3_src; git config remote.origin.push HEAD:refs/for/master;
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and (typo3_composer_install_dev == "yes")
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-legacy
- name: Setup git origin for typo3_console CMS Sources
become: vagrant
shell: cd {{ typo3_webroot }}{{ item.key }}/typo3_src; git remote set-url origin {{ typo3_cms_src_repository }}
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and (typo3_composer_install_dev == "yes")
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-legacy
- name: Setup git pushurl for typo3_console CMS Sources (otherwise it's github)
become: vagrant
shell: cd {{ typo3_webroot }}{{ item.key }}/typo3_src; git remote set-url origin --push {{ typo3_cms_src_push_url }}
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and (typo3_composer_install_dev == "yes")
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-legacy
- name: Setup git commit message for typo3_console CMS Sources
become: vagrant
copy: src=git-commit-msg dest={{ typo3_webroot }}{{ item.key }}/typo3_src/.git/hooks/commit-msg force=no
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.') and (typo3_composer_install_dev == "yes")
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-legacy
- name: Create AdditionalConfiguration.php
become: vagrant
file: path={{ typo3_webroot }}{{ item.key }}/typo3conf/AdditionalConfiguration.php state=touch mode=0664
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-localconf
- name: Ensure AdditionalConfiguration.php contains starting php tag
become: vagrant
lineinfile: dest={{ typo3_webroot }}{{ item.key }}/typo3conf/AdditionalConfiguration.php line="<?php" insertbefore=BOF
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-localconf
- name: Add trustedHostsPattern to AdditionalConfiguration.php
become: vagrant
lineinfile: dest={{ typo3_webroot }}{{ item.key }}/typo3conf/AdditionalConfiguration.php line="$GLOBALS['TYPO3_CONF_VARS']['SYS']['trustedHostsPattern'] = '(.*\\.)?{{ item.key | regex_replace('\.', '\\.') }}';" insertafter="<\?php"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-localconf
- name: Add mailhog smtp configuration to AdditionalConfiguration.php
become: vagrant
lineinfile: dest={{ typo3_webroot }}{{ item.key }}/typo3conf/AdditionalConfiguration.php line="$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport'] = 'smtp';" insertafter="<\?php"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-localconf
- name: Add mailhog smtp port configuration to AdditionalConfiguration.php
become: vagrant
lineinfile: dest={{ typo3_webroot }}{{ item.key }}/typo3conf/AdditionalConfiguration.php line="$GLOBALS['TYPO3_CONF_VARS']['MAIL']['transport_smtp_server'] = 'localhost:1025';" insertafter="<\?php"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-localconf
- name: Enable error reporting in AdditionalConfiguration.php
become: vagrant
lineinfile: dest={{ typo3_webroot }}{{ item.key }}/typo3conf/AdditionalConfiguration.php line="$GLOBALS['TYPO3_CONF_VARS']['SYS']['displayErrors'] = TRUE;" insertafter="<\?php"
when: item.key | match('^((6|7|8|9)\\.\d|dev-master|master|review)\\.')
with_dict: "{{typo3.cms.sites }}"
when: context == "Development"
tags: typo3-cms-localconf
- name: Enable install tool for CMS Sources
become: vagrant
copy: src=ENABLE_INSTALL_TOOL dest={{ typo3_webroot }}{{ item.key }}/typo3conf/ENABLE_INSTALL_TOOL force=yes
with_dict: "{{typo3.cms.sites }}"
tags: typo3-cms-installtool
- name: Create ramdisk directories to offload typo3temp to ramdisk
file: path=/mnt/typo3cache/{{ item }} state=directory owner={{nginx_user}} group={{nginx_group}} mode=0775
with_items: "{{ typo3.cms.sites.keys() }}"
tags: typo3-cms-ramdisk
- name: Make fstab entries for TYPO3 CMS typo3temp
mount: src=/mnt/typo3cache/{{ item }} name={{ typo3_webroot }}{{ item }}/typo3temp/ fstype=none opts=bind,noauto state=present
with_items: "{{ typo3.cms.sites.keys() }}"
tags: typo3-cms-ramdisk
- name: Mount bind TYPO3 CMS typo3temp ramdisks
shell: if ! mountpoint -q "{{ typo3_webroot }}{{ item }}/typo3temp"; then mount "/mnt/typo3cache/{{ item }}"; fi
with_items: "{{ typo3.cms.sites.keys() }}"
tags: typo3-cms-ramdisk