Add missing payload for DGs and Playbooks of LCM APIs
[sdnc/oam.git] / installation / ansible-server / src / main / Playbooks / ansible_huawei_rollback@0.00.yml
index ef56c54..fa164c9 100644 (file)
@@ -1,21 +1,18 @@
 ---\r
 - hosts: all\r
   tasks:\r
-  - name: create a temporary file for additional data\r
-    file: \r
-        path: /tmp/tmp-{{Id}}\r
-        state: touch\r
-    become: false\r
 \r
-  - name: prepare additional data\r
-    shell: echo {{additionalData}} > /tmp/tmp-{{Id}}\r
-    become: false\r
+  - name: execute swFallback operation\r
+    shell: ./swm/swFallback --filter {{filter}}\r
+    ignore_errors: yes\r
+    register: fallback_result\r
+    \r
+  - name: write output to file\r
+    local_action: copy content="{{fallback_result.stdout}}" dest="{{inventory_dir}}/{{inventory_hostname}}_results.txt"\r
+    when: fallback_result.stdout != ""\r
 \r
-  - name: execute rollback operation\r
-    shell: ./swm/rollback.sh {{pnfId}} {{oldSwVersion}} /tmp/tmp-{{Id}}\r
+  - name: use result of swFallback as the result of Playbook\r
+    fail:\r
+      msg: "{{fallback_result.stderr}}"\r
+    when: fallback_result is failed\r
 \r
-  - name: remove the temporary file\r
-    file:\r
-        path: /tmp/tmp-{{Id}}\r
-        state: absent\r
-    become: false\r