From 2155cad4f5d23f9416a65b77c1b109dc2003ba65 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Thu, 9 Apr 2020 09:51:22 +0200
Subject: [PATCH] Finalize script drupal-data-copy

---
 tasks/copy_data/main.yml | 62 ++++++++++++++++++----------------------
 1 file changed, 28 insertions(+), 34 deletions(-)

diff --git a/tasks/copy_data/main.yml b/tasks/copy_data/main.yml
index 7e98eea..a82b111 100644
--- a/tasks/copy_data/main.yml
+++ b/tasks/copy_data/main.yml
@@ -3,43 +3,37 @@
 
 - block:
 
-  - name: Set facts without jails
-    set_fact:
-      webRoot: /var/www{{ drupal.webRoot|default("") }}
-      cronUser: root
-      apacheUser: www-data
-      apacheLogDir: /var/log/apache2
-      drushSubkey: '{{ drupal.drush_subkey|default("") }}'
-    when: drupal.jail is not defined
+    - name: Set facts without jails
+      set_fact:
+        webRoot: /var/www{{ drupal.webRoot|default("") }}
+        apacheUser: www-data
+      when: drupal.jail is not defined
 
-  - name: Set facts with jails
-    set_fact:
-      webRoot: '{{ jailroot }}/{{ drupal.jail.name }}/var/www{{ drupal.webRoot|default("") }}'
-      cronUser: '{{ drupal.jail.name }}'
-      apacheUser: '{{ drupal.jail.name }}'
-      apacheLogDir: '{{ jailroot }}/{{ drupal.jail.name }}/var/log/apache2'
-      drushSubkey: .{{ drupal.jail.name }}
-    when: drupal.jail is defined
+    - name: Set facts with jails
+      set_fact:
+        webRoot: '{{ jailroot }}/{{ drupal.jail.name }}/var/www{{ drupal.webRoot|default("") }}'
+        apacheUser: '{{ drupal.jail.name }}'
+      when: drupal.jail is defined
 
-  - name: Execute Drush Commands
-    shell: drush -y {{ item }}
-    args:
-      chdir: '{{ webRoot }}'
-    with_items:
-      - sql:sync --create-db @{{ drupal.id }}.{{ branch }} @{{ drupal.id }}.{{ destination_branch }}
-      - rsync @{{ drupal.id }}.{{ branch }}:%files/ @{{ drupal.id }}.{{ destination_branch }}:%files -- --chown={{ apacheUser }}:{{ apacheUser }} --safe-links --max-size=20M
-      - cr
-      - updatedb
-      - config-import sync
+    - name: Execute Drush Commands
+      shell: drush -y {{ item }}
+      args:
+        chdir: '{{ webRoot }}'
+      with_items:
+        - sql:sync --create-db @{{ drupal.id }}_stages.{{ branch }} @{{ drupal.id }}_stages.{{ destination_branch }}
+        - rsync @{{ drupal.id }}_stages.{{ branch }}:%files/ @{{ drupal.id }}_stages.{{ destination_branch }}:%files -- --chown={{ apacheUser }}:{{ apacheUser }} --safe-links
+        - cache-rebuild
+        - updatedb
+        - config-import sync
 
-  - name: Set files ownership
-    file:
-      path: '{{ webRoot }}/files'
-      owner: '{{ apacheUser }}'
-      group: '{{ apacheUser }}'
-      mode: ug+rw
-      recurse: yes
-      follow: no
+    - name: Set files ownership
+      file:
+        path: '{{ webRoot }}/files'
+        owner: '{{ apacheUser }}'
+        group: '{{ apacheUser }}'
+        mode: ug+rw
+        recurse: yes
+        follow: no
 
   tags:
     - copy_db_and_assets
-- 
GitLab