init
This commit is contained in:
commit
63f060b4ad
8
tasks/main.yml
Normal file
8
tasks/main.yml
Normal 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
22
templates/settings.php.j2
Normal 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 %}
|
Reference in a new issue