aboutsummaryrefslogtreecommitdiffstats
path: root/installation/ansible-server
diff options
context:
space:
mode:
authorYaoguang Wang <sunshine.wang@huawei.com>2018-09-21 23:21:20 +0800
committerYaoguang Wang <sunshine.wang@huawei.com>2018-09-21 23:39:27 +0800
commit6b92025e3a0a1a37b349bc5c0ed99ae753add4e3 (patch)
tree707abdd4ece2ce9223a817cb2097202772b5fe86 /installation/ansible-server
parent98dc6ca82b047cf4358c1ba5580d205f6eb428d0 (diff)
CCSDK-464
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
Diffstat (limited to 'installation/ansible-server')
-rw-r--r--installation/ansible-server/src/main/yml/ansible_huawei_postcheck@0.00.yml21
-rw-r--r--installation/ansible-server/src/main/yml/ansible_huawei_precheck@0.00.yml21
-rw-r--r--installation/ansible-server/src/main/yml/ansible_huawei_upgrade@0.00.yml21
3 files changed, 63 insertions, 0 deletions
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
index 00000000..975887d7
--- /dev/null
+++ b/installation/ansible-server/src/main/yml/ansible_huawei_postcheck@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: true
+
+ - name: prepare additional data
+ shell: echo {{additionalData}} > /tmp/tmp-{{Id}}
+ become: true
+
+ - name: execute post-check operation
+ shell: ./swm/upgrade-post-check.sh {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}
+
+ - name: remove the temporary file
+ file:
+ path: /tmp/tmp-{{Id}}
+ state: absent
+ become: true
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
index 00000000..651974f8
--- /dev/null
+++ b/installation/ansible-server/src/main/yml/ansible_huawei_precheck@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: true
+
+ - name: prepare additional data
+ shell: echo {{additionalData}} > /tmp/tmp-{{Id}}
+ become: true
+
+ - name: execute pre-check operation
+ shell: ./swm/upgrade-pre-check.sh {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}
+
+ - name: remove the temporary file
+ file:
+ path: /tmp/tmp-{{Id}}
+ state: absent
+ become: true
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
index 00000000..ac2c4054
--- /dev/null
+++ b/installation/ansible-server/src/main/yml/ansible_huawei_upgrade@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: true
+
+ - name: prepare additional data
+ shell: echo {{additionalData}} > /tmp/tmp-{{Id}}
+ become: true
+
+ - name: execute upgrade software operation
+ shell: ./swm/upgrade-software.sh {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} /tmp/tmp-{{Id}}
+
+ - name: remove the temporary file
+ file:
+ path: /tmp/tmp-{{Id}}
+ state: absent
+ become: true