|
69 | 69 | - Is network interface connected or not. |
70 | 70 | notes: |
71 | 71 | - C(check_mode) is not supported. |
| 72 | + - Return value C(record) is added in version 1.2.0, and deprecates return value C(records). |
| 73 | + Return value C(records) will be removed in future release. |
72 | 74 | """ |
73 | 75 |
|
74 | 76 | EXAMPLES = r""" |
|
136 | 138 | """ |
137 | 139 |
|
138 | 140 | RETURN = r""" |
| 141 | +record: |
| 142 | + description: |
| 143 | + - The created or changed record for nic on a specified virtual machine. |
| 144 | + returned: success |
| 145 | + type: dict |
| 146 | + contains: |
| 147 | + uuid: |
| 148 | + description: Unique identifier |
| 149 | + type: str |
| 150 | + sample: 07a2a68a-0afa-4718-9c6f-00a39d08b67e |
| 151 | + vlan: |
| 152 | + description: VLAN tag of the interface |
| 153 | + type: int |
| 154 | + sample: 15 |
| 155 | + type: |
| 156 | + description: Virtualized network device types |
| 157 | + type: str |
| 158 | + sample: virtio |
| 159 | + mac: |
| 160 | + description: MAC address of the virtual network device |
| 161 | + type: str |
| 162 | + sample: 12-34-56-78-AB |
| 163 | + connected: |
| 164 | + description: Enabled and can make connections |
| 165 | + type: bool |
| 166 | + sample: true |
| 167 | + ipv4_addresses: |
| 168 | + description: IPv4 addresses registered with this device |
| 169 | + type: list |
| 170 | + elements: str |
| 171 | + sample: 192.0.2.1 |
139 | 172 | records: |
140 | 173 | description: |
141 | 174 | - The created or changed record for nic on a specified virtual machine. |
| 175 | + - This value is deprecated and will be removed in a future release. Please use record instead. |
142 | 176 | returned: success |
143 | | - type: list |
144 | | - sample: |
145 | | - - uuid: 07a2a68a-0afa-4718-9c6f-00a39d08b67e |
146 | | - vlan: 15 |
147 | | - type: virtio |
148 | | - mac: 12-34-56-78-AB |
149 | | - connected: true |
150 | | - ipv4_addresses: [] |
| 177 | + type: dict |
| 178 | + contains: |
| 179 | + uuid: |
| 180 | + description: Unique identifier |
| 181 | + type: str |
| 182 | + sample: 07a2a68a-0afa-4718-9c6f-00a39d08b67e |
| 183 | + vlan: |
| 184 | + description: VLAN tag of the interface |
| 185 | + type: int |
| 186 | + sample: 15 |
| 187 | + type: |
| 188 | + description: Virtualized network device types |
| 189 | + type: str |
| 190 | + sample: virtio |
| 191 | + mac: |
| 192 | + description: MAC address of the virtual network device |
| 193 | + type: str |
| 194 | + sample: 12-34-56-78-AB |
| 195 | + connected: |
| 196 | + description: Enabled and can make connections |
| 197 | + type: bool |
| 198 | + sample: true |
| 199 | + ipv4_addresses: |
| 200 | + description: IPv4 addresses registered with this device |
| 201 | + type: list |
| 202 | + elements: str |
| 203 | + sample: 192.0.2.1 |
151 | 204 | """ |
152 | 205 |
|
153 | 206 | from ansible.module_utils.basic import AnsibleModule |
@@ -278,12 +331,24 @@ def main(): |
278 | 331 | ), |
279 | 332 | ) |
280 | 333 |
|
| 334 | + module.deprecate( |
| 335 | + "The 'records' return value is being renamed to 'record'." |
| 336 | + "Please use 'record' since 'records' will be removed in future release." |
| 337 | + "But for now both values are being returned to allow users to migrate their automation.", |
| 338 | + version="3.0.0", |
| 339 | + collection_name="scale_computing.hypercore", |
| 340 | + ) |
| 341 | + |
281 | 342 | try: |
282 | 343 | client = Client.get_client(module.params["cluster_instance"]) |
283 | 344 | rest_client = RestClient(client=client) |
284 | | - changed, records, diff, reboot = run(module, rest_client) |
| 345 | + changed, record, diff, reboot = run(module, rest_client) |
285 | 346 | module.exit_json( |
286 | | - changed=changed, records=records, diff=diff, vm_rebooted=reboot |
| 347 | + changed=changed, |
| 348 | + records=record, |
| 349 | + record=record, |
| 350 | + diff=diff, |
| 351 | + vm_rebooted=reboot, |
287 | 352 | ) |
288 | 353 | except errors.ScaleComputingError as e: |
289 | 354 | module.fail_json(msg=str(e)) |
|
0 commit comments