Skip to content
Snippets Groups Projects
Commit 3033b4af authored by jurgenhaas's avatar jurgenhaas
Browse files

Run post deploy tasks per Drupal domain

parent 957c9b04
Branches
No related tags found
No related merge requests found
---
# file: roles/drupal/tasks/deploy/post-tasks.yml
- set_fact:
drushAlias='@{{ drupal.id }}.{{ drupal_domain.shortname|default("default") }}'
drushAliasValidate="'@{{ drupal.id }}.{{ drupal_domain.shortname|default('default') }}':"
- set_fact:
drushAlias='@{{ inventory_hostname }}{{ drushSubkey }}.{{ drupal_domain.shortname|default("default") }}'
drushAliasValidate='@{{ inventory_hostname }}{{ drushSubkey }}.{{ drupal_domain.shortname|default("default") }}'
when: drush_version_main|default('8') == '8'
- name: "Check Drush Status"
shell: drush -y {{ drushAlias }} status
args:
chdir: '{{ webRoot }}'
register: drush_status
changed_when: false
when: drushAliasValidate in drush_aliases.stdout_lines
- name: "Run Post Deploy Tasks"
shell: drush -y {{ drushAlias }} {{ item }}
args:
chdir: '{{ webRoot }}'
with_items: '{{ drupal_post_deploy_tasks[drupal.version|default("d7")] }}'
when: "drush_status is defined and ('Successful' in drush_status.stdout|default('') or 'Erfolgreich' in drush_status.stdout|default(''))"
......@@ -21,12 +21,6 @@
relativeRoot='{{ drupal.relativeRoot|default(drupal_links_relative_root) }}'
drupalRoot='{{ webRoot }}{{ drupal.root|default("") }}'
docRoot='{{ webRoot }}{{ drupal.docroot|default(drupal.root|default("")) }}'
drushAlias='@{{ drushSubkey }}'
drushAliasValidate="'@{{ drushSubkey }}':"
- set_fact:
drushAlias='@{{ inventory_hostname }}{{ drushSubkey }}'
drushAliasValidate='@{{ inventory_hostname }}{{ drushSubkey }}'
when: drush_version_main|default('8') == '8'
tags: 'always'
- name: "Configure Apache"
......@@ -264,19 +258,9 @@
changed_when: false
tags: 'deploy'
- name: "Check Drush Status"
shell: drush -y {{ drushAlias }} status
args:
chdir: '{{ webRoot }}'
register: drush_status
changed_when: false
when: drushAliasValidate in drush_aliases.stdout_lines
tags: 'deploy'
- name: "Run Post Deploy Tasks"
shell: drush -y {{ drushAlias }} {{ item }}
args:
chdir: '{{ webRoot }}'
with_items: '{{ drupal_post_deploy_tasks[drupal.version|default("d7")] }}'
when: "drush_status is defined and ('Successful' in drush_status.stdout|default('') or 'Erfolgreich' in drush_status.stdout|default(''))"
- name: "Post Deploy Tasks"
include: deploy/post-tasks.yml
with_items: '{{ drupal.domains }}'
loop_control:
loop_var: drupal_domain
tags: 'deploy'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment