aboutsummaryrefslogtreecommitdiffstats
path: root/installation/ansible-server/src/main/Playbooks
diff options
context:
space:
mode:
authorEnbo Wang <wangenbo@huawei.com>2020-02-21 17:28:53 +0800
committerEnbo Wang <wangenbo@huawei.com>2020-02-21 17:35:35 +0800
commit226baa784e543bef038cffe091f734d22b34a256 (patch)
treefad166ee96f5c1fc6325b6296516e30de99d6809 /installation/ansible-server/src/main/Playbooks
parent8bbe748d631353b8c48c7d71eb733cf85712884c (diff)
Update DGs and Playbooks for PNF SW Upgrade
Change-Id: Iecc84ca6f794fe9947e81da3d95ceaad00f2861d Issue-ID: SDNC-1079 Signed-off-by: Enbo Wang <wangenbo@huawei.com> Former-commit-id: e2915384cc7523e93c2e154d4a84920fd093146d
Diffstat (limited to 'installation/ansible-server/src/main/Playbooks')
-rw-r--r--installation/ansible-server/src/main/Playbooks/ansible_huawei_activatenesw@0.00.yml6
-rw-r--r--installation/ansible-server/src/main/Playbooks/ansible_huawei_downloadnesw@0.00.yml6
-rw-r--r--installation/ansible-server/src/main/Playbooks/ansible_huawei_postcheck@0.01.yml26
-rw-r--r--installation/ansible-server/src/main/Playbooks/ansible_huawei_precheck@0.01.yml26
4 files changed, 46 insertions, 18 deletions
diff --git a/installation/ansible-server/src/main/Playbooks/ansible_huawei_activatenesw@0.00.yml b/installation/ansible-server/src/main/Playbooks/ansible_huawei_activatenesw@0.00.yml
index e25d2e61..1ce873a0 100644
--- a/installation/ansible-server/src/main/Playbooks/ansible_huawei_activatenesw@0.00.yml
+++ b/installation/ansible-server/src/main/Playbooks/ansible_huawei_activatenesw@0.00.yml
@@ -12,10 +12,10 @@
ne_identifier: "{{neIdentifier}}"
when: neIdentifier is defined
- - name: compatible with parameter pnfId
+ - name: compatible with parameter pnfName
set_fact:
- ne_identifier: "{{pnfId}}"
- when: neIdentifier is not defined and pnfId is defined
+ ne_identifier: "{{pnfName}}"
+ when: neIdentifier is not defined and pnfName is defined
- name: execute activateNESw operation
shell: ./swm/activateNESw --swVersionToBeActivated {{sw_version_to_be_activated}} --neIdentifier {{ne_identifier}}
diff --git a/installation/ansible-server/src/main/Playbooks/ansible_huawei_downloadnesw@0.00.yml b/installation/ansible-server/src/main/Playbooks/ansible_huawei_downloadnesw@0.00.yml
index 10e25b34..47359f57 100644
--- a/installation/ansible-server/src/main/Playbooks/ansible_huawei_downloadnesw@0.00.yml
+++ b/installation/ansible-server/src/main/Playbooks/ansible_huawei_downloadnesw@0.00.yml
@@ -12,10 +12,10 @@
ne_identifier: "{{neIdentifier}}"
when: neIdentifier is defined
- - name: compatible with parameter pnfId
+ - name: compatible with parameter pnfName
set_fact:
- ne_identifier: "{{pnfId}}"
- when: neIdentifier is not defined and pnfId is defined
+ ne_identifier: "{{pnfName}}"
+ when: neIdentifier is not defined and pnfName is defined
- name: execute downloadNESw operation
shell: ./swm/downloadNESw --swToBeDownloaded {{sw_to_be_downloaded}} --neIdentifier {{ne_identifier}}
diff --git a/installation/ansible-server/src/main/Playbooks/ansible_huawei_postcheck@0.01.yml b/installation/ansible-server/src/main/Playbooks/ansible_huawei_postcheck@0.01.yml
index b9b1ab81..cc867c14 100644
--- a/installation/ansible-server/src/main/Playbooks/ansible_huawei_postcheck@0.01.yml
+++ b/installation/ansible-server/src/main/Playbooks/ansible_huawei_postcheck@0.01.yml
@@ -1,16 +1,29 @@
---
- hosts: all
tasks:
+
+ - name: parameter neIdentifier
+ set_fact:
+ ne_identifier: "{{neIdentifier}}"
+ when: neIdentifier is defined
+
+ - name: compatible with parameter pnfName
+ set_fact:
+ ne_identifier: "{{pnfName}}"
+ when: neIdentifier is not defined and pnfName is defined
+
- name: create a temporary file for additional data
- file:
- path: /tmp/tmp-{{Id}}
- state: touch
+ tempfile:
+ state: file
+ register: additional_data_file
- name: prepare additional data
- shell: echo {{additionalData}} > /tmp/tmp-{{Id}}
+ copy:
+ content: "{{additionalData}}"
+ dest: "{{additional_data_file.path}}"
- name: execute post-check operation
- shell: ./swm/upgrade-post-check {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}
+ shell: ./swm/upgrade-post-check {{ne_identifier}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} {{additional_data_file.path}}
ignore_errors: yes
register: postcheck_result
@@ -20,8 +33,9 @@
- name: remove the temporary file
file:
- path: /tmp/tmp-{{Id}}
+ path: "{{additional_data_file.path}}"
state: absent
+ when: additional_data_file.path is defined
- name: build error message
set_fact:
diff --git a/installation/ansible-server/src/main/Playbooks/ansible_huawei_precheck@0.01.yml b/installation/ansible-server/src/main/Playbooks/ansible_huawei_precheck@0.01.yml
index dcb6f6a0..32de4b37 100644
--- a/installation/ansible-server/src/main/Playbooks/ansible_huawei_precheck@0.01.yml
+++ b/installation/ansible-server/src/main/Playbooks/ansible_huawei_precheck@0.01.yml
@@ -1,16 +1,29 @@
---
- hosts: all
tasks:
+
+ - name: parameter neIdentifier
+ set_fact:
+ ne_identifier: "{{neIdentifier}}"
+ when: neIdentifier is defined
+
+ - name: compatible with parameter pnfName
+ set_fact:
+ ne_identifier: "{{pnfName}}"
+ when: neIdentifier is not defined and pnfName is defined
+
- name: create a temporary file for additional data
- file:
- path: /tmp/tmp-{{Id}}
- state: touch
+ tempfile:
+ state: file
+ register: additional_data_file
- name: prepare additional data
- shell: echo {{additionalData}} > /tmp/tmp-{{Id}}
+ copy:
+ content: "{{additionalData}}"
+ dest: "{{additional_data_file.path}}"
- name: execute pre-check operation
- shell: ./swm/upgrade-pre-check {{pnfId}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} /tmp/tmp-{{Id}}
+ shell: ./swm/upgrade-pre-check {{ne_identifier}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} {{additional_data_file.path}}
ignore_errors: yes
register: precheck_result
@@ -20,8 +33,9 @@
- name: remove the temporary file
file:
- path: /tmp/tmp-{{Id}}
+ path: "{{additional_data_file.path}}"
state: absent
+ when: additional_data_file.path is defined
- name: build error message
set_fact: