Add settings(local)php generation to provision
This commit is contained in:
parent
15ebd22051
commit
dbc00a269d
2 changed files with 90 additions and 5 deletions
|
@ -4,10 +4,30 @@
|
|||
args:
|
||||
chdir: "{{ drupal_composer_install_dir }}"
|
||||
|
||||
- name: install default settings.php
|
||||
copy:
|
||||
src: "{{ drupal_core_path }}/sites/default/default.settings.php"
|
||||
dest: "{{ drupal_core_path }}/sites/default/settings.php"
|
||||
|
||||
- name: enable settings.local.php include_tasks
|
||||
blockinfile:
|
||||
path: "{{ drupal_core_path }}/sites/default/settings.php"
|
||||
marker: "/* {mark} ANSIBLE MANAGED BLOCK: LOCAL INCLUDE */"
|
||||
insertafter: EOF
|
||||
content: |1+
|
||||
if (file_exists($app_root . '/' . $site_path . '/settings.local.php')) {
|
||||
include $app_root . '/' . $site_path . '/settings.local.php';
|
||||
}
|
||||
|
||||
- name: create settings.local.php
|
||||
template:
|
||||
src: "settings.local.php.j2"
|
||||
dest: "{{ drupal_core_path }}/sites/default/settings.local.php"
|
||||
|
||||
- name: Check if site is already installed.
|
||||
command: "{{ drupal_composer_install_dir }}/vendor/bin/drush --root={{ drupal_composer_install_dir }}/web/ status bootstrap"
|
||||
command: "{{ drupal_composer_install_dir }}/vendor/bin/drush --root={{ drupal_core_path}}/ status bootstrap"
|
||||
args:
|
||||
chdir: "{{ drupal_composer_install_dir }}/web"
|
||||
chdir: "{{ drupal_core_path }}"
|
||||
register: drupal_site_installed
|
||||
failed_when: "drupal_site_installed.stdout is undefined"
|
||||
changed_when: false
|
||||
|
@ -42,20 +62,20 @@
|
|||
- name: Install Drupal with drush.
|
||||
command: >
|
||||
{{ drupal_composer_install_dir }}/vendor/bin/drush site-install -y
|
||||
--root={{ drupal_composer_install_dir }}/web
|
||||
--root={{ drupal_core_path }}
|
||||
--site-name={{ drupal_site_name }}
|
||||
--account-name={{ drupal_account_name }}
|
||||
--account-pass={{ drupal_account_pass }}
|
||||
--site-mail={{ drupal_account_email }}
|
||||
args:
|
||||
chdir: "{{ drupal_composer_install_dir }}/web"
|
||||
chdir: "{{ drupal_core_path }}"
|
||||
become: no
|
||||
when: "force_reinstall|default(false) or 'Drupal bootstrap' not in drupal_site_installed.stdout"
|
||||
|
||||
- name: Run sass
|
||||
command: sassc sass/styles.scss css/styles.css
|
||||
args:
|
||||
chdir: "{{ drupal_composer_install_dir }}/web/themes/{{ theme }}/"
|
||||
chdir: "{{ drupal_core_path }}/themes/{{ theme }}/"
|
||||
when: theme != ""
|
||||
|
||||
# - name: Ensure ansible is installed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue