From 6b92025e3a0a1a37b349bc5c0ed99ae753add4e3 Mon Sep 17 00:00:00 2001 From: Yaoguang Wang Date: Fri, 21 Sep 2018 23:21:20 +0800 Subject: 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 Former-commit-id: 8dd603f5bb2ab82a2332afe5d4a24a8de76a8e34 --- .../src/main/yml/ansible_huawei_postcheck@0.00.yml | 21 +++++++++++++++++++++ .../src/main/yml/ansible_huawei_precheck@0.00.yml | 21 +++++++++++++++++++++ .../src/main/yml/ansible_huawei_upgrade@0.00.yml | 21 +++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 installation/ansible-server/src/main/yml/ansible_huawei_postcheck@0.00.yml create mode 100644 installation/ansible-server/src/main/yml/ansible_huawei_precheck@0.00.yml create mode 100644 installation/ansible-server/src/main/yml/ansible_huawei_upgrade@0.00.yml 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 -- cgit 1.2.3-korg