mirror of
https://github.com/geerlingguy/ansible-for-devops.git
synced 2024-05-19 06:50:03 +00:00
34 lines
969 B
YAML
34 lines
969 B
YAML
---
|
|
- name: Check out Drupal Core to the Apache docroot.
|
|
git:
|
|
repo: https://git.drupal.org/project/drupal.git
|
|
version: "{{ drupal_core_version }}"
|
|
dest: "{{ drupal_core_path }}"
|
|
register: git_checkout
|
|
|
|
- name: Ensure Drupal codebase is owned by www-data.
|
|
file:
|
|
path: "{{ drupal_core_path }}"
|
|
owner: www-data
|
|
group: www-data
|
|
recurse: true
|
|
when: git_checkout.changed | bool
|
|
|
|
- name: Install Drupal dependencies with Composer.
|
|
command: >
|
|
/usr/local/bin/composer install
|
|
chdir={{ drupal_core_path }}
|
|
creates={{ drupal_core_path }}/vendor/autoload.php
|
|
become_user: www-data
|
|
|
|
- name: Install Drupal.
|
|
command: >
|
|
drush si -y --site-name="{{ drupal_site_name }}"
|
|
--account-name=admin
|
|
--account-pass=admin
|
|
--db-url=mysql://{{ domain }}:1234@localhost/{{ domain }}
|
|
--root={{ drupal_core_path }}
|
|
creates={{ drupal_core_path }}/sites/default/settings.php
|
|
notify: restart apache
|
|
become_user: www-data
|