CCSDK-464 61/68461/1
authorYaoguang Wang <sunshine.wang@huawei.com>
Fri, 21 Sep 2018 15:21:20 +0000 (23:21 +0800)
committerYaoguang Wang <sunshine.wang@huawei.com>
Fri, 21 Sep 2018 15:39:27 +0000 (23:39 +0800)
create and push ansible playbooks for 5G PNF software pre-check,upgrade and post-check

Change-Id: Ie7cb18047dc4587ecc0999e890bf85daab73b97b
Issue-ID: CCSDK-464
Signed-off-by: wangyaoguang <sunshine.wang@huawei.com>
Former-commit-id: 8dd603f5bb2ab82a2332afe5d4a24a8de76a8e34

installation/ansible-server/src/main/yml/ansible_huawei_postcheck@0.00.yml [new file with mode: 0644]
installation/ansible-server/src/main/yml/ansible_huawei_precheck@0.00.yml [new file with mode: 0644]
installation/ansible-server/src/main/yml/ansible_huawei_upgrade@0.00.yml [new file with mode: 0644]

diff --git a/installation/ansible-server/src/main/yml/ansible_huawei_postcheck@0.00.yml b/installation/ansible-server/src/main/yml/ansible_huawei_postcheck@0.00.yml
new file mode 100644 (file)
index 0000000..975887d
--- /dev/null
@@ -0,0 +1,21 @@
+---\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: true\r
+\r
+  - name: prepare additional data\r
+    shell: echo {{additionalData}} > /tmp/tmp-{{Id}}\r
+    become: true\r
+\r
+  - name: execute post-check operation\r
+    shell: ./swm/upgrade-post-check.sh {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}\r
+\r
+  - name: remove the temporary file\r
+    file:\r
+        path: /tmp/tmp-{{Id}}\r
+        state: absent\r
+    become: true\r
diff --git a/installation/ansible-server/src/main/yml/ansible_huawei_precheck@0.00.yml b/installation/ansible-server/src/main/yml/ansible_huawei_precheck@0.00.yml
new file mode 100644 (file)
index 0000000..651974f
--- /dev/null
@@ -0,0 +1,21 @@
+---\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: true\r
+\r
+  - name: prepare additional data\r
+    shell: echo {{additionalData}} > /tmp/tmp-{{Id}}\r
+    become: true\r
+\r
+  - name: execute pre-check operation\r
+    shell: ./swm/upgrade-pre-check.sh {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}\r
+\r
+  - name: remove the temporary file\r
+    file:\r
+        path: /tmp/tmp-{{Id}}\r
+        state: absent\r
+    become: true\r
diff --git a/installation/ansible-server/src/main/yml/ansible_huawei_upgrade@0.00.yml b/installation/ansible-server/src/main/yml/ansible_huawei_upgrade@0.00.yml
new file mode 100644 (file)
index 0000000..ac2c405
--- /dev/null
@@ -0,0 +1,21 @@
+---\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: true\r
+\r
+  - name: prepare additional data\r
+    shell: echo {{additionalData}} > /tmp/tmp-{{Id}}\r
+    become: true\r
+\r
+  - name: execute upgrade software operation\r
+    shell: ./swm/upgrade-software.sh {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} /tmp/tmp-{{Id}}\r
+\r
+  - name: remove the temporary file\r
+    file:\r
+        path: /tmp/tmp-{{Id}}\r
+        state: absent\r
+    become: true\r