summaryrefslogtreecommitdiffstats
path: root/ansible/upload_resources.yml
diff options
context:
space:
mode:
authorSamuli Silvius <s.silvius@partner.samsung.com>2019-02-19 16:00:37 +0200
committerMichal Ptacek <m.ptacek@partner.samsung.com>2019-03-07 08:01:08 +0000
commit29886f09d53bee1ecdc1bc8612e8edb4a130a270 (patch)
tree9507ee70a95e27afd81adf284f1dfe2c8b946491 /ansible/upload_resources.yml
parentf968e170316ee1e514d4cf03a56137ba93c1a0bf (diff)
Re-factored resources upload into role
Whole functionality of resource files upload is implemented in resource-data role instead of playbook level tasks. This will make roles easier to test and make it easier to implement other OS support later. Issue-ID: OOM-1654 Change-Id: I3d3da9381b0e804f511ee854c41554b924d18883 Signed-off-by: Samuli Silvius <s.silvius@partner.samsung.com>
Diffstat (limited to 'ansible/upload_resources.yml')
-rw-r--r--ansible/upload_resources.yml49
1 files changed, 0 insertions, 49 deletions
diff --git a/ansible/upload_resources.yml b/ansible/upload_resources.yml
deleted file mode 100644
index 68010eb1..00000000
--- a/ansible/upload_resources.yml
+++ /dev/null
@@ -1,49 +0,0 @@
----
-- name: Check for presence of auxiliary resources tar file
- hosts: resources[0]
- tasks:
- - name: Store auxiliary resources tar file info into variable
- stat:
- path: "{{ hostvars[groups.resources.0].resources_dir }}/{{ hostvars[groups.resources.0].aux_resources_filename }}"
- register: aux_file_presence
-
-- name: Check infrastructure server for presence of resources and requirements
- hosts: infrastructure
- tasks:
- - name: Check if nfs-utils is installed
- yum:
- list: nfs-utils
- register: nfs_utils_check
-
- - name: Check if the resources are already unpacked
- stat:
- path: "{{ app_data_path }}"
- register: resources_data_check
-
- - name: Check if the auxilliary resources are already unpacked
- stat:
- path: "{{ aux_data_path }}"
- register: aux_resources_data_check
- when: aux_data_path is defined and aux_data_path is not none
-
-- name: Ensure the existence of data directory/ies on infrastructure server
- hosts: infrastructure
- tasks:
- - name: Create data directory
- file:
- path: "{{ app_data_path }}"
- state: directory
-
- - name: Create auxiliary data directory
- file:
- path: "{{ aux_data_path }}"
- state: directory
- when: aux_data_path is defined and aux_data_path is not none
-
-- name: Upload resources to infrastructure server
- hosts: infrastructure
- roles:
- # use nfs or ssh and unpack resources into data directory/ies
- - role: resource-data
- vars:
- transport: "{{ 'nfs' if resources_on_nfs and (nfs_utils_check.results|selectattr('yumstate', 'match', 'installed')|list|length != 0) else 'ssh' }}"