drmofu.fortiflexvm.fortiflexvm_entitlements_vm_regenerate_token (2.0.0) — module

Regenerate token for a VM.

| "added in version" 2.0.0 of drmofu.fortiflexvm"

Authors: Xinwei Du (@DrMofu)

Install collection

Install with ansible-galaxy collection install drmofu.fortiflexvm:==2.0.0


Add to requirements.yml

  collections:
    - name: drmofu.fortiflexvm
      version: 2.0.0

Description

Regenerate token for a VM.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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

Inputs

    
password:
    description:
    - The password to authenticate. If not declared, the code will read the environment
      variable FORTIFLEX_ACCESS_PASSWORD.
    required: false
    type: str

username:
    description:
    - The username to authenticate. If not declared, the code will read the environment
      variable FORTIFLEX_ACCESS_USERNAME.
    required: false
    type: str

regenerate:
    description:
    - Whether regenerate a new token.
    required: true
    type: bool

serialNumber:
    description:
    - The serial number of the entitlement to update.
    required: true
    type: str

Outputs

entitlements:
  contains:
    configId:
      description: The config ID of the entitlement.
      returned: always
      sample: 3196
      type: int
    description:
      description: The description of the entitlement.
      returned: always
      sample: Modify through Ansible
      type: str
    endDate:
      description: The end date of the entitlement.
      returned: always
      sample: '2023-12-12T00:00:00'
      type: str
    serialNumber:
      description: The serial number of the entitlement.
      returned: always
      sample: FGVMMLTM23001324
      type: str
    startDate:
      description: The start date of the entitlement.
      returned: always
      sample: '2023-03-13T11:48:53.03'
      type: str
    status:
      description: The status of the VM. Possible values are "PENDING", "ACTIVE",
        "STOPPED" or "EXPIRED".
      returned: always
      sample: ACTIVE
      type: str
    token:
      description: The token of the entitlement.
      returned: always
      type: str
    tokenStatus:
      description: The token status of the entitlement. Possible values are "NOTUSED"
        or "USED".
      returned: always
      sample: NOTUSED
      type: str
  description: The entitlement you update. This list only contains one entitlement.
    It will be empty if you set regenerate as false.
  returned: always
  type: list