-
-
Notifications
You must be signed in to change notification settings - Fork 608
/
helpers.yml
23 lines (21 loc) · 1.74 KB
/
helpers.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
wordpress_env_defaults:
db_host: localhost
db_name: "{{ item.key | underscore }}_{{ env }}"
db_user: "{{ item.key | underscore }}"
db_user_host: localhost
disable_wp_cron: true
wp_env: "{{ env }}"
wp_home: "{{ ssl_enabled | ternary('https', 'http') }}://{{ site_hosts_canonical | first }}"
wp_siteurl: "{{ ssl_enabled | ternary('https', 'http') }}://{{ site_hosts_canonical | first }}/wp"
domain_current_site: "{{ site_hosts_canonical | first }}"
wp_debug_log: "{{ www_root }}/{{ item.key }}/logs/debug.log"
site_env: "{{ wordpress_env_defaults | combine(vault_wordpress_env_defaults | default({}), item.value.env | default({}), vault_wordpress_sites[item.key].env) }}"
site_hosts_canonical: "{{ item.value.site_hosts | map(attribute='canonical') | list }}"
site_hosts_redirects: "{{ item.value.site_hosts | selectattr('redirects', 'defined') | sum(attribute='redirects', start=[]) | list }}"
site_hosts: "{{ site_hosts_canonical | union(site_hosts_redirects) }}"
multisite_subdomains_wildcards: "{{ item.value.multisite.subdomains | default(false) | ternary( site_hosts_canonical | map('regex_replace', '^(www\\.)?(.*)$', '*.\\2') | list, [] ) }}"
ssl_enabled: "{{ item.value.ssl is defined and item.value.ssl.enabled | default(false) }}"
ssl_stapling_enabled: "{{ item.value.ssl is defined and item.value.ssl.stapling_enabled | default(true) }}"
cron_enabled: "{{ site_env.disable_wp_cron and (not item.value.multisite.enabled | default(false) or (item.value.multisite.enabled | default(false) and item.value.multisite.cron | default(true))) }}"
sites_use_ssl: "{{ wordpress_sites.values() | map(attribute='ssl') | selectattr('enabled') | list | count > 0 }}"
composer_authentications: "{{ vault_wordpress_sites[site].composer_authentications | default([]) }}"