From 63f74b6ca8c454bbe82ef8adb00b29e997744c5b Mon Sep 17 00:00:00 2001 From: Olivier Clavel Date: Fri, 14 Feb 2020 18:06:31 +0100 Subject: [PATCH] Fix blobstore restore script when splitted blobstore is on (#245) * Digest splitted blobstore list earlier Collateral dammage of #241. When split blobstore is on blobstore list was not valorised early enough and blobstore restore script was buggy. * Fix white spaces --- tasks/main.yml | 8 ++++---- templates/nexus-blob-restore.sh.j2 | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 2e7a41c1..27a007a3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -23,6 +23,10 @@ - include_tasks: nexus_purge.yml when: nexus_purge | default(false) | bool +- name: "Digest splited blob list var" + include_vars: blob_vars.yml + when: nexus_blob_split | bool + - import_tasks: nexus_install.yml - include_tasks: httpd_reverse_proxy_config.yml @@ -93,10 +97,6 @@ {%- endfor -%} {{ result | to_json | from_json }} - - name: "Digest splited blob list var" - include_vars: blob_vars.yml - when: nexus_blob_split | bool - - name: Create/Check blobstores when: nexus_restore_point is undefined block: diff --git a/templates/nexus-blob-restore.sh.j2 b/templates/nexus-blob-restore.sh.j2 index 6c5056f0..97a356cd 100644 --- a/templates/nexus-blob-restore.sh.j2 +++ b/templates/nexus-blob-restore.sh.j2 @@ -24,8 +24,8 @@ else rm -rf ${data_dir}/db/* rm -rf ${data_dir}/blobs/* sudo -u {{ nexus_os_user }} cp ${backup_dir}/${blob_dir}/db/* ${db_restore_dir} - {% for item in nexus_blobstores %} +{% for item in nexus_blobstores %} sudo -u {{ nexus_os_user }} cp -r ${backup_dir}/${blob_dir}/{{ item.name }} ${data_dir}/blobs/ - {% endfor %} +{% endfor %} sudo -u {{ nexus_os_user }} cp -r ${backup_dir}/${blob_dir}/default ${data_dir}/blobs/ fi