5 - name: parameter neIdentifier
\r
7 ne_identifier: "{{neIdentifier}}"
\r
8 when: neIdentifier is defined
\r
10 - name: compatible with parameter pnfName
\r
12 ne_identifier: "{{pnfName}}"
\r
13 when: neIdentifier is not defined and pnfName is defined
\r
15 - name: create a temporary file for additional data
\r
18 register: additional_data_file
\r
20 - name: prepare additional data
\r
22 content: "{{additionalData}}"
\r
23 dest: "{{additional_data_file.path}}"
\r
25 - name: execute pre-check operation
\r
26 shell: ./swm/upgrade-pre-check {{ne_identifier}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} {{additional_data_file.path}}
\r
28 register: precheck_result
\r
30 - name: write output to file
\r
31 local_action: copy content="{{precheck_result.stdout}}" dest="{{inventory_dir}}/{{inventory_hostname}}_results.txt"
\r
32 when: precheck_result.stdout != ""
\r
34 - name: remove the temporary file
\r
36 path: "{{additional_data_file.path}}"
\r
38 when: additional_data_file.path is defined
\r
40 - name: build error message
\r
43 "reason": "{{precheck_result.stderr}}"
\r
45 when: precheck_result is failed and precheck_result.stdout == "" and precheck_result.stderr != ""
\r
47 - name: write error message to file
\r
48 local_action: copy content="{{err_msg}}" dest="{{inventory_dir}}/{{inventory_hostname}}_results.txt"
\r
49 when: precheck_result is failed and precheck_result.stdout == "" and precheck_result.stderr != ""
\r
51 - name: use result of pre-check as the result of Playbook
\r
53 msg: "{{precheck_result.stderr}}"
\r
54 when: precheck_result is failed
\r