ansible.builtin.vcenter_license (v2.9.24) — module

Manage VMware vCenter license keys

| "added in version" 2.4 of ansible.builtin"

Authors: Dag Wieers (@dagwieers)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.24

Description

Add and delete vCenter, ESXi server license keys.


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add a new vCenter license
  vcenter_license:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    license: f600d-21ae3-5592b-249e0-cc341
    state: present
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove an (unused) vCenter license
  vcenter_license:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    license: f600d-21ae3-5592b-249e0-cc341
    state: absent
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add ESXi license and assign to the ESXi host
  vcenter_license:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    esxi_hostname: '{{ esxi_hostname }}'
    license: f600d-21ae3-5592b-249e0-dd502
    state: present
  delegate_to: localhost
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Add vSAN license and assign to the given cluster
  vcenter_license:
    hostname: '{{ vcenter_hostname }}'
    username: '{{ vcenter_username }}'
    password: '{{ vcenter_password }}'
    datacenter: '{{ datacenter_name }}'
    cluster_name: '{{ cluster_name }}'
    license: f600d-21ae3-5592b-249e0-dd502
    state: present
  delegate_to: localhost

Inputs

    
port:
    default: 443
    description:
    - The port number of the vSphere vCenter server.
    - If the value is not specified in the task, the value of environment variable C(VMWARE_PORT)
      will be used instead.
    - Environment variable supported added in Ansible 2.6.
    type: int
    version_added: '2.5'
    version_added_collection: ansible.builtin

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether to add (C(present)) or remove (C(absent)) the license key.
    type: str

labels:
    default:
      source: ansible
    description:
    - The optional labels of the license key to manage in vSphere vCenter.
    - This is dictionary with key/value pair.
    type: dict

license:
    description:
    - The license key to manage in vSphere vCenter.
    required: true
    type: str

hostname:
    description:
    - The hostname or IP address of the vSphere vCenter server.
    - If the value is not specified in the task, the value of environment variable C(VMWARE_HOST)
      will be used instead.
    - Environment variable supported added in Ansible 2.6.
    type: str

password:
    aliases:
    - pass
    - pwd
    description:
    - The password of the vSphere vCenter server.
    - If the value is not specified in the task, the value of environment variable C(VMWARE_PASSWORD)
      will be used instead.
    - Environment variable supported added in Ansible 2.6.
    type: str

username:
    aliases:
    - admin
    - user
    description:
    - The username of the vSphere vCenter server.
    - If the value is not specified in the task, the value of environment variable C(VMWARE_USER)
      will be used instead.
    - Environment variable supported added in Ansible 2.6.
    type: str

datacenter:
    description:
    - The datacenter name to use for the operation.
    type: str
    version_added: '2.9'
    version_added_collection: ansible.builtin

proxy_host:
    description:
    - Address of a proxy that will receive all HTTPS requests and relay them.
    - The format is a hostname or a IP.
    - If the value is not specified in the task, the value of environment variable C(VMWARE_PROXY_HOST)
      will be used instead.
    required: false
    type: str
    version_added: '2.9'
    version_added_collection: ansible.builtin

proxy_port:
    description:
    - Port of the HTTP proxy that will receive all HTTPS requests and relay them.
    - If the value is not specified in the task, the value of environment variable C(VMWARE_PROXY_PORT)
      will be used instead.
    required: false
    type: int
    version_added: '2.9'
    version_added_collection: ansible.builtin

cluster_name:
    description:
    - Name of the cluster to apply vSAN license.
    type: str
    version_added: '2.9'
    version_added_collection: ansible.builtin

esxi_hostname:
    description:
    - The hostname of the ESXi server to which the specified license will be assigned.
    - This parameter is optional.
    type: str
    version_added: '2.8'
    version_added_collection: ansible.builtin

validate_certs:
    default: true
    description:
    - Allows connection when SSL certificates are not valid. Set to C(false) when certificates
      are not trusted.
    - If the value is not specified in the task, the value of environment variable C(VMWARE_VALIDATE_CERTS)
      will be used instead.
    - Environment variable supported added in Ansible 2.6.
    - If set to C(true), please make sure Python >= 2.7.9 is installed on the given machine.
    type: bool

Outputs

licenses:
  description: list of license keys after module executed
  returned: always
  sample:
  - f600d-21ae3-5592b-249e0-cc341
  - 143cc-0e942-b2955-3ea12-d006f
  type: list