This commit is contained in:
Oliver Davies 2019-01-24 02:07:45 +00:00
commit 63f060b4ad
2 changed files with 30 additions and 0 deletions

8
tasks/main.yml Normal file
View file

@ -0,0 +1,8 @@
---
- name: Create settings files
template:
src: settings.php.j2
dest: '{{ item.0.project_dir }}/shared/web/sites/{{ item.1.name|default(''default'') }}/local.settings.php'
with_subelements:
- '{{ drupal_settings }}'
- sites

22
templates/settings.php.j2 Normal file
View file

@ -0,0 +1,22 @@
<?php
// {{ ansible_managed }}
{% for name, values in item.1.settings.databases.iteritems() %}
$databases['{{ name }}']['default'] = [
'driver' => '{{ values.driver }}',
'host' => '{{ values.host }}',
'database' => '{{ values.database }}',
'username' => '{{ values.username }}',
'password' => '{{ values.password }}',
];
{% endfor %}
{% if item.1.settings.base_url %}
$base_url = '{{ item.1.settings.base_url }}';
{% endif %}
{% if item.1.settings.extra_parameters is defined %}
{{ item.1.settings.extra_parameters|indent(0) }}
{% endif %}