Skip to content
Snippets Groups Projects
Commit 34328ba7 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#13 Restructure install and deployment

parent a607e612
No related branches found
No related tags found
No related merge requests found
Showing with 100 additions and 23 deletions
---
# file: roles/drupal/tasks/users.svn.yml
# file: roles/drupal/tasks/deploy/d6.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/deploy/d7.yml
- set_fact: dummy=yes
# TODO: Let's see how we can generalize this and whether we need that for D6 as well.
#- name: "Deploy | Drush"
# shell: "drush -y @{{ deploy.drush.alias }} {{ item }}"
# with_items:
# - "fra"
# - "cc all"
# when: deploy.drush is defined
---
# file: roles/drupal/tasks/deploy/d8.yml
- name: "Ensure extra directories"
file:
path: '{{ drupalRoot }}{{ item }}'
state: 'directory'
with_items:
- '/modules/custom'
- '/modules/contrib'
- '/themes/custom'
- '/themes/contrib'
---
# file: roles/drupal/tasks/install.none.yml
# file: roles/drupal/tasks/deploy/drush.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/install.gitscript.yml
# IMPORTANT: The following should be called but really ONLY for new installs.
- name: "Make Sure Drupal Root Does Not Yet Exist"
file:
path: '{{ docRoot }}'
state: 'absent'
# file: roles/drupal/tasks/deploy/gitscript.yml
- name: "Ensure Repository Directory"
file:
......@@ -14,7 +8,6 @@
owner: 'root'
group: 'root'
mode: '775'
tags: 'deploy'
- name: "Clone Git Repository"
git:
......@@ -25,7 +18,6 @@
force: yes
version: '{{ drupal.src.git.branch|default(omit) }}'
become: false
tags: 'deploy'
- name: "Second Clone Git Repository"
git:
......@@ -34,9 +26,7 @@
force: yes
version: '{{ drupal.src.git.branch|default(omit) }}'
when: drupal.src.git.target2 is defined
tags: 'deploy'
- name: "Run Script"
shell: '{{ webRoot }}{{ drupal.src.git.target }}{{ drupal.src.script }}'
when: drupal.src.script is defined and drupal.src.script
tags: 'deploy'
---
# file: roles/drupal/tasks/users.drush.yml
# file: roles/drupal/tasks/deploy/none.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/install.d6.yml
# file: roles/drupal/tasks/deploy/svn.yml
- set_fact: dummy=yes
......@@ -47,18 +47,20 @@
register: drupal_available
failed_when: false
# TODO: The following mechanism doesn't work, it clear the variable drupal_available always, not only when the tag is defined.
#- set_fact:
# drupal_available:
# stdout: ''
# tags: 'deploy'
- include: install.{{ installSource.mode|default("none") }}.yml
- include: install/{{ installSource.mode|default("none") }}.yml
when: drupal_install_drupal and drupal_available is defined and drupal_available.stdout != '{{ drupalRoot }}/index.php'
- include: install.{{ drupal.version|default("d7") }}.yml
- include: install/{{ drupal.version|default("d7") }}.yml
when: drupal_install_drupal and drupal_available is defined and drupal_available.stdout != '{{ drupalRoot }}/index.php'
- include: deploy/{{ installSource.mode|default("none") }}.yml
when: drupal_install_drupal
tags: 'deploy'
- include: deploy/{{ drupal.version|default("d7") }}.yml
when: drupal_install_drupal
tags: 'deploy'
- name: "Ensure links"
file:
src: '{{ webRoot }}{{ item.src }}'
......@@ -67,7 +69,7 @@
with_items: '{{ drupal.links|default([]) }}'
tags: 'deploy'
- include: users.{{ installSource.mode|default("none") }}.yml
- include: users/{{ installSource.mode|default("none") }}.yml
when: drupal_install_drupal and drupal.src.name is defined
tags: 'SetPermissions'
......
---
# file: roles/drupal/tasks/install.d7.yml
# file: roles/drupal/tasks/install/d6.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/users.none.yml
# file: roles/drupal/tasks/install/d7.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/install.d8.yml
# file: roles/drupal/tasks/install/d8.yml
- block:
#- name: "Drupalconsole run chain"
......@@ -7,23 +7,7 @@
# args:
# chdir: '{{ webRoot }}'
- name: "Drupalconsole: Remove Drupal Directory"
file:
path: '{{ drupalRoot }}'
state: 'absent'
- name: "Drupalconsole: Install Drupal"
shell: drupal site:new {{ drupalRoot }} 8.1.1 --no-interaction chdir={{ webRoot }}
when: drupal.chain is defined
- name: "Ensure extra directories"
file:
path: '{{ drupalRoot }}{{ item }}'
state: 'directory'
with_items:
- '/modules/custom'
- '/modules/contrib'
- '/themes/custom'
- '/themes/contrib'
tags: 'deploy'
---
# file: roles/drupal/tasks/install.drush.yml
# file: roles/drupal/tasks/install/drush.yml
- name: "Copy Drush Make Files"
copy:
......
---
# file: roles/drupal/tasks/install/gitscript.yml
# IMPORTANT: The following should be called but really ONLY for new installs.
- name: "Make Sure Drupal Root Does Not Yet Exist"
file:
path: '{{ docRoot }}'
state: 'absent'
---
# file: roles/drupal/tasks/install/none.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/install.svn.yml
# file: roles/drupal/tasks/install/svn.yml
- name: "Install and update Drupal trees from SVN"
subversion:
......
---
# file: roles/drupal/tasks/users/drush.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/users.gitscript.yml
# file: roles/drupal/tasks/users/gitscript.yml
- name: "Make sure the git group exists"
group: name='{{ drupal.src.name }}'
......
---
# file: roles/drupal/tasks/users/none.yml
- set_fact: dummy=yes
---
# file: roles/drupal/tasks/users/svn.yml
- set_fact: dummy=yes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment