xci: scenarios: Fix location when copying scenarios to roles 55/49555/5
authorMarkos Chandras <mchandras@suse.de>
Fri, 22 Dec 2017 14:05:57 +0000 (14:05 +0000)
committerMarkos Chandras <mchandras@suse.de>
Fri, 22 Dec 2017 21:11:59 +0000 (21:11 +0000)
The location where we were putting the scenarios was wrong as it was
placing them in xci/playbooks/roles/$scenario/$scenario so in the end
the Ansible couldn't find the role we were looking for. As a result,
the role was never executed. Moreover, we can use the synchronize
module instead of the shell which should be both faster and safer.

Change-Id: I3d996652bb6a62d23e259da5674d94596dad4d8d
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/playbooks/get-opnfv-scenario-requirements.yml

index ec2f0d0..b44c50b 100644 (file)
@@ -66,9 +66,9 @@
         label: "{{ item.scenario }}"
 
     - name: Plug in the scenario to XCI
-      shell: >-
-          cp -a {{ scenario_path_default }}/{{ item.item.scenario }}/{{ item.item.role }}
-          {{ role_path_default }}/{{ item.item.scenario }}
+      synchronize:
+        src: "{{ scenario_path_default }}/{{ item.item.scenario }}/{{ item.item.role }}/"
+        dest: "{{ role_path_default }}/{{ item.item.scenario }}"
       when: item.stat.exists
       with_items: "{{ scenarios_list_exists.results }}"
       loop_control:
@@ -87,9 +87,9 @@
         label: "{{ item.item.scenario }}"
 
     - name: Plug in the scenario to XCI (fallback)
-      shell: >-
-          cp -a {{ XCI_PATH }}/{{ item.item.role }}
-          {{ role_path_default }}/{{ item.item.scenario }}
+      synchronize:
+        src: "{{ XCI_PATH }}/{{ item.item.role }}/"
+        dest: "{{ role_path_default }}/{{ item.item.scenario }}"
       when: not item.stat.exists
       with_items: "{{ scenarios_list_exists.results }}"
       loop_control: