blob: bbf99321f8bfba2802ef2cd26e4983d112b45fbc [file] [log] [blame]
---
#
# Expected variables
# resources_source_host
# resources_dir
# resource_source_filename
# resource_destination_directory
# Output is upload_failed true/false
#
- name: "Upload resource {{ resources_dir }}/{{ resource_source_filename }} to infrastructure servers over nfs"
block:
- name: Mount resource dir
mount:
path: /tmp/resource_data
src: "{{ resources_source_host }}:{{ resources_dir }}"
fstype: nfs
state: mounted
- name: "Unarchive resource {{ resources_dir }}/{{ resource_source_filename }} \
to {{ resource_destination_directory }} dir on infrastructure servers over nfs"
unarchive:
src: "/tmp/resource_data/{{ resource_source_filename }}"
dest: "{{ resource_destination_directory }}"
remote_src: yes
always:
- name: Unmount resource dir
mount:
path: /tmp/resource_data
src: "{{ resources_source_host }}:{{ resources_dir }}"
fstype: nfs
state: absent