5 - name: compatible with parameter targetSwVersion
\r
7 sw_to_be_downloaded: "{{targetSwVersion}}"
\r
8 when: targetSwVersion is defined
\r
10 - name: support new parameter swToBeDownloaded
\r
12 sw_to_be_downloaded: "{{swToBeDownloaded}}"
\r
13 when: swToBeDownloaded is defined
\r
15 - name: compatible with parameter pnfId
\r
17 ne_identifier: "{{pnfId}}"
\r
18 when: pnfId is defined
\r
20 - name: support new parameter neIdentifier
\r
22 ne_identifier: "{{neIdentifier}}"
\r
23 when: neIdentifier is defined
\r
25 - name: execute downloadNESw operation
\r
26 shell: ./swm/downloadNESw.sh --swToBeDownloaded {{sw_to_be_downloaded}} --neIdentifier {{ne_identifier}}
\r
27 register: download_result
\r
29 - name: parse response of downloadNESw
\r
31 download_response: "{{ download_result.stdout | from_json }}"
\r
33 - name: fetch file of Notification notifyDownloadNESwStatusChanged
\r
36 src: /tmp/notifyDownloadNESwStatusChanged-{{download_response.downloadProcessId}}
\r
38 - name: read contents of Notification notifyDownloadNESwStatusChanged
\r
40 download_notification: "{{ lookup('file', '/tmp/{{inventory_hostname}}/tmp/notifyDownloadNESwStatusChanged-{{download_response.downloadProcessId}}') | from_json }}"
\r
42 - name: delete file of Notification notifyDownloadNESwStatusChanged
\r
43 local_action: file path="/tmp/{{inventory_hostname}}/tmp/notifyDownloadNESwStatusChanged-{{download_response.downloadProcessId}}" state=absent
\r
45 - name: execute installNESw operation
\r
46 shell: ./swm/installNESw.sh --swToBeInstalled {{item}} --neIdentifier {{ne_identifier}}
\r
47 register: install_result
\r
48 with_items: "{{ download_notification.downloadedNESwInfo }}"
\r
50 - name: parse responses of all the installNESws
\r
52 install_responses: "{{ install_responses | default([]) + [item.stdout | from_json] }}"
\r
53 with_items: "{{ install_result.results }}"
\r
55 - name: fetch files of all the Notifications notifyInstallNESwStatusChanged
\r
58 src: /tmp/notifyInstallNESwStatusChanged-{{item.installProcessId}}
\r
59 with_items: "{{ install_responses }}"
\r
61 - name: read contents of all the Notifications notifyInstallNESwStatusChanged
\r
63 install_notifications: "{{ install_notifications | default([]) + [lookup('file', '/tmp/{{inventory_hostname}}/tmp/notifyInstallNESwStatusChanged-{{item.installProcessId}}') | from_json] }}"
\r
64 with_items: "{{ install_responses }}"
\r
66 - name: delete files of all the Notifications notifyInstallNESwStatusChanged
\r
67 local_action: file path="/tmp/{{inventory_hostname}}/tmp/notifyInstallNESwStatusChanged-{{item.installProcessId}}" state=absent
\r
68 with_items: "{{ install_responses }}"
\r
70 - name: parse all the installed NE SW info
\r
72 installed_ne_sw_info: "{{ installed_ne_sw_info | default([]) + item.installedNESwInfo }}"
\r
73 with_items: "{{ install_notifications }}"
\r
75 - name: execute activateNESw operation
\r
76 shell: ./swm/activateNESw.sh --swVersionToBeActivated {{item}} --neIdentifier {{ne_identifier}}
\r
77 register: activate_result
\r
78 with_items: "{{ installed_ne_sw_info }}"
\r