diff --git a/aws_jira_dc_node.yml b/aws_jira_dc_node.yml index 6ef0765..b0470fb 100644 --- a/aws_jira_dc_node.yml +++ b/aws_jira_dc_node.yml @@ -21,9 +21,9 @@ - role: linux_common - role: aws_common - role: aws_shared_fs_config - - role: fetch_backups - role: product_common - role: product_install - role: database_init + - role: restore_backups - role: jira_config - role: product_startup diff --git a/roles/fetch_backups/defaults/main.yml b/roles/restore_backups/defaults/main.yml similarity index 100% rename from roles/fetch_backups/defaults/main.yml rename to roles/restore_backups/defaults/main.yml diff --git a/roles/fetch_backups/tasks/amazon.yml b/roles/restore_backups/tasks/amazon.yml similarity index 100% rename from roles/fetch_backups/tasks/amazon.yml rename to roles/restore_backups/tasks/amazon.yml diff --git a/roles/fetch_backups/tasks/main.yml b/roles/restore_backups/tasks/main.yml similarity index 84% rename from roles/fetch_backups/tasks/main.yml rename to roles/restore_backups/tasks/main.yml index 5dcdf01..a0023cf 100644 --- a/roles/fetch_backups/tasks/main.yml +++ b/roles/restore_backups/tasks/main.yml @@ -108,22 +108,29 @@ path: "{{ atl_backup_home_restore_canary_path }}" register: restore_canary - - name: Create shared home if necessary - file: - path: "{{ atl_product_home_shared }}" - state: directory - mode: 0750 - owner: "{{ atl_product_user }}" - group: "{{ atl_product_user }}" - when: restore_canary.stat.exists + - block: - - name: Restore the shared-home backup - unarchive: - path: "{{ atl_backup_home_restore_canary_path }}" - dest: "{{ atl_product_home_shared }}" - owner: "{{ atl_product_user }}" - group: "{{ atl_product_user }}" - when: restore_canary.stat.exists + - name: Create shared home if necessary + file: + path: "{{ atl_product_home_shared }}" + state: directory + mode: 0750 + owner: "{{ atl_product_user }}" + group: "{{ atl_product_user }}" + + - name: Restore the shared-home backup + unarchive: + path: "{{ atl_backup_home_restore_canary_path }}" + dest: "{{ atl_product_home_shared }}" + owner: "{{ atl_product_user }}" + group: "{{ atl_product_user }}" + + - name: Create restore-canary if necessary + copy: + dest: "{{ atl_backup_home_restore_canary_path }}" + content: "{{ atl_backup_id }}" + + when: not restore_canary.stat.exists when: atl_backup_manifest_url is defined and atl_backup_manifest_url != ''