2018-08-20 14:45:20 +00:00
|
|
|
---
|
|
|
|
- name: Run composer install.
|
|
|
|
command: "composer install"
|
|
|
|
args:
|
|
|
|
chdir: "{{ drupal_composer_install_dir }}"
|
|
|
|
|
2018-08-22 20:27:51 +00:00
|
|
|
- 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"
|
|
|
|
|
2018-08-20 14:45:20 +00:00
|
|
|
- name: Check if site is already installed.
|
2018-08-22 20:27:51 +00:00
|
|
|
command: "{{ drupal_composer_install_dir }}/vendor/bin/drush --root={{ drupal_core_path}}/ status bootstrap"
|
2018-08-20 14:45:20 +00:00
|
|
|
args:
|
2018-08-22 20:27:51 +00:00
|
|
|
chdir: "{{ drupal_core_path }}"
|
2018-08-20 14:45:20 +00:00
|
|
|
register: drupal_site_installed
|
|
|
|
failed_when: "drupal_site_installed.stdout is undefined"
|
|
|
|
changed_when: false
|
|
|
|
become: no
|
|
|
|
|
|
|
|
# - name: Ensure /etc/drush folder exists
|
|
|
|
# file:
|
|
|
|
# name: /etc/drush
|
|
|
|
# state: directory
|
|
|
|
# group: root
|
|
|
|
# owner: root
|
|
|
|
# mode: 0755
|
|
|
|
# become: yes
|
|
|
|
#
|
|
|
|
# - name: Install drushrc.php
|
|
|
|
# copy:
|
|
|
|
# src: drushrc.php
|
|
|
|
# dest: /etc/drush/drushrc.php
|
|
|
|
# owner: root
|
|
|
|
# group: root
|
|
|
|
# mode: 0755
|
|
|
|
# backup: no
|
|
|
|
# become: yes
|
|
|
|
|
|
|
|
# - name: Add RewriteMap to vhost.conf
|
|
|
|
# lineinfile:
|
|
|
|
# path: /etc/apache2/sites-enabled/vhosts.conf
|
|
|
|
# line: "RewriteMap legacy \"txt:{{ web_root}}/redirect/legacy.txt\""
|
|
|
|
# insertafter: "DocumentRoot \"{{ web_root }}/web\""
|
|
|
|
# become: yes
|
|
|
|
|
|
|
|
- name: Install Drupal with drush.
|
|
|
|
command: >
|
|
|
|
{{ drupal_composer_install_dir }}/vendor/bin/drush site-install -y
|
2018-08-22 20:27:51 +00:00
|
|
|
--root={{ drupal_core_path }}
|
2018-08-20 14:45:20 +00:00
|
|
|
--site-name={{ drupal_site_name }}
|
|
|
|
--account-name={{ drupal_account_name }}
|
|
|
|
--account-pass={{ drupal_account_pass }}
|
|
|
|
--site-mail={{ drupal_account_email }}
|
|
|
|
args:
|
2018-08-22 20:27:51 +00:00
|
|
|
chdir: "{{ drupal_core_path }}"
|
2018-08-20 14:45:20 +00:00
|
|
|
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:
|
2018-08-22 20:27:51 +00:00
|
|
|
chdir: "{{ drupal_core_path }}/themes/{{ theme }}/"
|
2018-08-20 14:45:20 +00:00
|
|
|
when: theme != ""
|
|
|
|
|
|
|
|
# - name: Ensure ansible is installed
|
|
|
|
# apt:
|
|
|
|
# name: ansible
|
|
|
|
# state: latest
|
|
|
|
# become: yes
|