aboutsummaryrefslogtreecommitdiffstats
path: root/installation/ansible-server/src
diff options
context:
space:
mode:
authorEnbo Wang <wangenbo@huawei.com>2019-03-27 10:22:42 +0000
committerEnbo Wang <wangenbo@huawei.com>2019-03-27 10:22:42 +0000
commitc11ca8e2ea698fc16f0c2bd368a6de74974ac270 (patch)
treeb55c4f9f40003ea9af3ed2e2d6bd7f3d04da1336 /installation/ansible-server/src
parentd0b8fc583393c79655d44511ad3d1628fdc1914c (diff)
Add Ansible playbook for PNF software rollback
Change-Id: I1fd8f17954a2908207d2d7404a932a4dbd3c9ec1 Issue-ID: SDNC-671 Signed-off-by: Enbo Wang <wangenbo@huawei.com> Former-commit-id: 7f1168ec86880028bca8f15f0654d377f9b2a6c6
Diffstat (limited to 'installation/ansible-server/src')
-rw-r--r--installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml21
1 files changed, 21 insertions, 0 deletions
diff --git a/installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml b/installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml
new file mode 100644
index 00000000..ef56c54f
--- /dev/null
+++ b/installation/ansible-server/src/main/Playbooks/ansible_huawei_rollback@0.00.yml
@@ -0,0 +1,21 @@
+---
+- hosts: all
+ tasks:
+ - name: create a temporary file for additional data
+ file:
+ path: /tmp/tmp-{{Id}}
+ state: touch
+ become: false
+
+ - name: prepare additional data
+ shell: echo {{additionalData}} > /tmp/tmp-{{Id}}
+ become: false
+
+ - name: execute rollback operation
+ shell: ./swm/rollback.sh {{pnfId}} {{oldSwVersion}} /tmp/tmp-{{Id}}
+
+ - name: remove the temporary file
+ file:
+ path: /tmp/tmp-{{Id}}
+ state: absent
+ become: false