Update an existing VM
Use the fortiflexvm_vms_update
module to update an existing virtual machine.
Parameters
The following parameters are included:
Parameter |
Type |
Description |
---|---|---|
|
String (Optional) |
The username to authenticate. If not declared, the code will read the environment variable |
password
|
String (Optional) |
The password to authenticate. If not declared, the code will read the environment variable |
|
String |
The serial number of the virtual machine to update. |
|
Integer (Optional) |
The ID of the virtual machine configuration. |
|
String (Optional) |
The description of the virtual machine. |
|
String (Optional) |
The end date of the virtual machine's validity. Any format that satisfies ISO 8601 is accepted but the recommended format is |
|
Boolean (Optional) |
Defines whether to regenerate the token assigned to the virtual machine. The default value is false. |
|
String (Optional) |
The status of the virtual machine. |
Example
The following is an example use of this module:
- name: Update VM hosts: localhost collections: - fortinet.fortiflexvm vars: username: "<your_own_value>" password: "<your_own_value>" tasks: - name: Update a Virtual Machine fortinet.fortiflexvm.fortiflexvm_vms_update: username: "{{ username }}" password: "{{ password }}" serialNumber: "FGVMMLTM23001324" # Please specify configId if you want to update configId, description or endDate configId: 3196 description: "Modify through Ansible" endDate: "2023-12-12T00:00:00" status: "ACTIVE" # ACTIVE or STOPPED regenerateToken: False register: result - name: Display response debug: var: result.vms
Return values
The following parameters are returned:
Parameter |
Type Returned |
Description |
---|---|---|
|
List |
The VM you update. This list only has one VM. |
The vms
list includes:
Parameter |
Type Returned |
Description |
---|---|---|
|
String |
The serial number of the VM. |
|
String |
The description of the VM. |
|
Integer |
The configuration ID of the VM. |
|
String |
The start date of the VM. |
|
String |
The end date of the VM. |
|
String |
The status of the VM; either |
|
String |
The token of the VM. |
|
String |
The token status of the VM; either |