Use the original playbook in play-resources tests 75/89375/1
authorMichal Zegan <m.zegan@samsung.com>
Wed, 5 Jun 2019 13:45:55 +0000 (15:45 +0200)
committerMichal Zegan <m.zegan@samsung.com>
Wed, 5 Jun 2019 13:45:55 +0000 (15:45 +0200)
This commit includes the original resources.yml playbook
by using import_playbook.
Some modifications were needed mostly because of the way
import_playbook works.
Also moved the setup role call to prepare.

Change-Id: I8745d5e43fd2050d47970c7d19bbbc4db8a5847f
Issue-ID: OOM-1912
Signed-off-by: Michal Zegan <m.zegan@samsung.com>
ansible/test/play-resources/molecule/default/playbook.yml
ansible/test/play-resources/molecule/default/prepare.yml
ansible/test/play-resources/molecule/default/vars.yml [moved from ansible/test/play-resources/molecule/default/group_vars/all.yml with 87% similarity]
ansible/test/play-resources/molecule/nfs/molecule.yml
ansible/test/play-resources/molecule/nfs/playbook.yml
ansible/test/play-resources/molecule/nfs/prepare.yml
ansible/test/play-resources/molecule/nfs/vars.yml [new file with mode: 0644]

index 50ba233..096077a 100644 (file)
@@ -1,6 +1,8 @@
 ---
-- name: Test resource transfer with ssh
+- name: Initialize
   hosts: all
-  roles:
-    - setup
-    - resource-data
+  tasks:
+    - name: Include variables
+      include_vars: vars.yml
+
+- import_playbook: ../../../../resources.yml
index a443600..5c8ae65 100644 (file)
@@ -2,4 +2,7 @@
 - name: Prepare resource-data
   hosts: all
   roles:
+    - setup
     - prepare-resource-data
+  vars_files:
+    - vars.yml
@@ -1,5 +1,5 @@
 ---
-app_data_path: /opt/myleculeapp
+app_data_path: /opt/moleculeapp
 aux_data_path: "{{ app_data_path }}/runtime_images_source_dir"
 resources_dir: /data
 resources_filename: resources_package.tar
index 9cff6b8..1172639 100644 (file)
@@ -32,13 +32,8 @@ platforms:
       - name: resource-data
 provisioner:
   name: ansible
-  playbooks:
-    cleanup: ../default/cleanup.yml
   env:
     ANSIBLE_ROLES_PATH: ../../../../roles:../../../roles
-  inventory:
-    links:
-      group_vars: ../default/group_vars
   lint:
     name: ansible-lint
 verifier:
index 8844011..096077a 100644 (file)
@@ -1,8 +1,8 @@
 ---
-- name: Test resource transfer with nfs
+- name: Initialize
   hosts: all
-  roles:
-    - setup
-    - role: resource-data
-      vars:
-        resources_on_nfs: true
+  tasks:
+    - name: Include variables
+      include_vars: vars.yml
+
+- import_playbook: ../../../../resources.yml
index d381ba7..2276f2e 100644 (file)
@@ -1,7 +1,7 @@
 ---
-- name: Prepare resource-data
+- name: Prepare
   hosts: all
   roles:
-    - role: prepare-resource-data
-      vars:
-        resources_on_nfs: true
+    - prepare-resource-data
+  vars_files:
+    - vars.yml
diff --git a/ansible/test/play-resources/molecule/nfs/vars.yml b/ansible/test/play-resources/molecule/nfs/vars.yml
new file mode 100644 (file)
index 0000000..2cc4d25
--- /dev/null
@@ -0,0 +1,7 @@
+---
+app_data_path: /opt/moleculeapp
+aux_data_path: "{{ app_data_path }}/runtime_images_source_dir"
+resources_on_nfs: true
+resources_dir: /data
+resources_filename: resources_package.tar
+aux_resources_filename: aux_resources_package.tar