summaryrefslogtreecommitdiffstats
path: root/ansible/roles/resource-data/tasks/nfs-upload.yml
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/resource-data/tasks/nfs-upload.yml')
-rw-r--r--ansible/roles/resource-data/tasks/nfs-upload.yml53
1 files changed, 0 insertions, 53 deletions
diff --git a/ansible/roles/resource-data/tasks/nfs-upload.yml b/ansible/roles/resource-data/tasks/nfs-upload.yml
deleted file mode 100644
index 4b5c18d1..00000000
--- a/ansible/roles/resource-data/tasks/nfs-upload.yml
+++ /dev/null
@@ -1,53 +0,0 @@
----
-- name: Upload resources to infrastructure servers over nfs
- block:
- - name: Mount resources
- mount:
- path: /tmp/resource_data
- src: "{{ hostvars[groups.resources.0].ansible_host }}:{{ hostvars[groups.resources.0].resources_dir }}"
- fstype: nfs
- state: mounted
-
- - name: Unarchive resources
- unarchive:
- src: "/tmp/resource_data/{{ hostvars[groups.resources.0].resources_filename }}"
- remote_src: yes
- dest: "{{ app_data_path }}"
- when: not resources_data_check.stat.exists
-
- - name: Unarchive auxiliary resources
- unarchive:
- src: "/tmp/resource_data/{{ hostvars[groups.resources.0].aux_resources_filename }}"
- remote_src: yes
- dest: "{{ aux_data_path }}"
- when: >
- hostvars[groups.resources.0].aux_resources_filename is defined
- and hostvars[groups.resources.0].aux_resources_filename is not none
- and aux_data_path is defined and aux_data_path is not none
- and hostvars[groups.resources.0].aux_file_presence.stat.exists
- and not aux_resources_data_check.stat.exists
-
- rescue:
- - name: Removing the resources data due to an error - so the next run can try again
- command: /bin/false
- register: upload_failed
-
- always:
- - name: unmount resource dir
- mount:
- path: /tmp/resource_data
- src: "{{ hostvars[groups.resources.0].ansible_host }}:{{hostvars[groups.resources.0].resources_dir }}"
- fstype: nfs
- state: absent
-
- - name: Remove the resource data on error
- file:
- path: "{{ app_data_path }}"
- state: absent
- when: upload_failed is defined
-
- - name: Remove the auxilliary resource data on error
- file:
- path: "{{ aux_data_path }}"
- state: absent
- when: upload_failed is defined