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 post-check operation
\r
26 shell: ./swm/upgrade-post-check {{ne_identifier}} {{oldSwVersion}} {{targetSwVersion}} {{ruleName}} {{additional_data_file.path}}
\r
28 register: postcheck_result
\r
30 - name: write output to file
\r
31 local_action: copy content="{{postcheck_result.stdout}}" dest="{{inventory_dir}}/{{inventory_hostname}}_results.txt"
\r
32 when: postcheck_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": "{{postcheck_result.stderr}}"
\r
45 when: postcheck_result is failed and postcheck_result.stdout == "" and postcheck_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: postcheck_result is failed and postcheck_result.stdout == "" and postcheck_result.stderr != ""
\r
51 - name: use result of post-check as the result of Playbook
\r
53 msg: "{{postcheck_result.stderr}}"
\r
54 when: postcheck_result is failed
\r