-
-
Notifications
You must be signed in to change notification settings - Fork 51
/
main.yml
56 lines (44 loc) · 1.65 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
- name: Add backwards-compatibility shims.
include_tasks: backwards-compatibility.yml
- name: Check if Drupal is already set up.
stat: "path={{ drupal_core_path }}/index.php"
register: drupal_site
ignore_errors: true
- name: Define drush_path if it's not already defined.
set_fact:
drush_path: drush
when: drush_path is not defined
- name: Define drupal_site_exists.
set_fact:
drupal_site_exists: "{{ drupal_site.stat.exists|default(false) }}"
# Deploy Drupal if configured.
- include_tasks: deploy.yml
when: drupal_deploy
- name: Define drupal_deploy_updated
set_fact:
drupal_deploy_updated: "{{ (drupal_deploy_repo_updated is defined and drupal_deploy_repo_updated.changed) | default(false) }}"
# Run update tasks if Drupal was updated.
- include_tasks: update.yml
when: drupal_deploy_updated and drupal_site_exists
# Build makefile if configured.
- include_tasks: build-makefile.yml
when: drupal_build_makefile
# Build with composer if configured.
- include_tasks: build-composer.yml
when: drupal_build_composer
# Build a composer project if configured.
- include_tasks: build-composer-project.yml
when: drupal_build_composer_project
# Set Drush variables.
- name: Check if a project specific Drush binary exists.
stat: "path={{ drupal_composer_install_dir }}/{{ drupal_composer_bin_dir }}/drush"
register: drush_vendor_bin
ignore_errors: true
- name: Use project specific Drush if available.
set_fact:
drush_path: "{{ drupal_composer_install_dir }}/{{ drupal_composer_bin_dir }}/drush"
when: drush_vendor_bin.stat.exists
# Install site if configured.
- include_tasks: install-site.yml
when: drupal_install_site