Fortinet white logo
Fortinet white logo

Administration Guide

Regenerate a token for a VM

Regenerate a token for a VM

Use the fortiflexvm_entitlements_update module to update an existing entitlement.

Parameters

The following parameters are included:

Parameter

Type

Description

username

String (Optional)

The username to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_USERNAME.

password

String (Optional)

The password to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_PASSWORD.

serialNumber

String

The serial number of the entitlement to update.

regenerate

Boolean

State whether to regenerate a new token or not.

Example

The following is an example use of this module:

- name: Regenerate token
  hosts: localhost
  collections:
    - fortinet.fortiflexvm
  vars_files:
    - vars/vars.yml
  tasks:
    - name: Regenerate token
      fortinet.fortiflexvm.fortiflexvm_entitlements_vm_regenerate_token:
        username: "{{ username }}"
        password: "{{ password }}"
        serialNumber: "FGVMMLTM23001324"
        regenerate: true # If you set it as false, FortiFlexvm ansible collection will return an empty list.
      register: result

    - name: Display response
      debug:
        var: result.entitlements

Return values

The following parameters are returned:

Parameter

Type Returned

Description

entitlements

List

The entitlement you update. This list only contains one entitlement. It will be empty if you set regenerate as false.

The entitlements list includes:

Parameter

Type Returned

Description

serialNumber

String

The serial number of the entitlement.

description

String

The description of the entitlement.

configId

Integer

The configuration ID of the entitlement.

startDate

String

The start date of the entitlement.

endDate

String

The end date of the entitlement.

status

String

The status of the VM; either "PENDING", "ACTIVE", "STOPPED", or "EXPIRED".

token

String

The token of the entitlement.

tokenStatus

String

The token status of the entitlement; either "NOTUSED" or "USED".

Regenerate a token for a VM

Regenerate a token for a VM

Use the fortiflexvm_entitlements_update module to update an existing entitlement.

Parameters

The following parameters are included:

Parameter

Type

Description

username

String (Optional)

The username to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_USERNAME.

password

String (Optional)

The password to authenticate. If not declared, the code will read the environment variable FLEXVM_ACCESS_PASSWORD.

serialNumber

String

The serial number of the entitlement to update.

regenerate

Boolean

State whether to regenerate a new token or not.

Example

The following is an example use of this module:

- name: Regenerate token
  hosts: localhost
  collections:
    - fortinet.fortiflexvm
  vars_files:
    - vars/vars.yml
  tasks:
    - name: Regenerate token
      fortinet.fortiflexvm.fortiflexvm_entitlements_vm_regenerate_token:
        username: "{{ username }}"
        password: "{{ password }}"
        serialNumber: "FGVMMLTM23001324"
        regenerate: true # If you set it as false, FortiFlexvm ansible collection will return an empty list.
      register: result

    - name: Display response
      debug:
        var: result.entitlements

Return values

The following parameters are returned:

Parameter

Type Returned

Description

entitlements

List

The entitlement you update. This list only contains one entitlement. It will be empty if you set regenerate as false.

The entitlements list includes:

Parameter

Type Returned

Description

serialNumber

String

The serial number of the entitlement.

description

String

The description of the entitlement.

configId

Integer

The configuration ID of the entitlement.

startDate

String

The start date of the entitlement.

endDate

String

The end date of the entitlement.

status

String

The status of the VM; either "PENDING", "ACTIVE", "STOPPED", or "EXPIRED".

token

String

The token of the entitlement.

tokenStatus

String

The token status of the entitlement; either "NOTUSED" or "USED".