X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=installation%2Fansible-server%2Fsrc%2Fmain%2FPlaybooks%2Fansible_huawei_precheck%400.01.yml;h=32de4b3746f0c47fe946735e51c36d9fc1d2f797;hb=226baa784e543bef038cffe091f734d22b34a256;hp=dcb6f6a01aabd0049783517bfe2a8ea63f115bc7;hpb=8bbe748d631353b8c48c7d71eb733cf85712884c;p=sdnc%2Foam.git 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: