Create VMs based on a FortiFlex configuration
Use the fortiflexvm_entitlements_vms_create
module to create one or more VMs based on a FortiFlex configuration.
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 |
|
Integer |
The ID of the FortiFlex configuration. |
|
Integer (Optional) |
The number of VMs to be created. The default value is |
|
String (Optional) |
The description of the VMs. |
|
String (Optional) |
The VM end date. It cannot be before today's date or after the program's end date. Any format that satisfies ISO 8601 is accepted but the recommended format is |
|
String (Optional) |
The folder path of the VMs. |
Example
The following is an example use of this module:
- name: Create VMs hosts: localhost collections: - fortinet.fortiflexvm vars: username: "<your_own_value>" password: "<your_own_value>" tasks: - name: Create Virtual Machines. fortinet.fortiflexvm.fortiflexvm_entitlements_vm_create: username: "{{ username }}" password: "{{ password }}" configId: 42 count: 1 # If you set it as 0, FortiFlexvm ansible collection will not create any vm. description: "Create through Ansible" # Optional. endDate: "2023-11-11T00:00:00" # Optional. If not set, it will use the program end date automatically. folderPath: "My Assets" # Optional. If not set, new VM will be in "My Assets" register: result - name: Display response debug: var: result.entitlements
Return values
The following parameters are returned:
Parameter |
Type Returned |
Description |
---|---|---|
|
List |
The list of virtual machine entitlements and their details. |
The entitlements
list includes:
Parameter |
Type Returned |
Description |
---|---|---|
|
Integer |
The ID of the VM configuration. |
|
String |
The description of the VM. |
|
String |
The end date of the VM's validity. |
|
String |
The serial number of the VM. |
|
String |
The start date of the VM's validity. |
|
String |
The status of the VM. |
|
String |
The token assigned to the VM. |
|
String |
The status of the token assigned to the VM. |