community.vmware.vmware_dvswitch_uplink_pg module – Manage uplink portgroup configuration of a Distributed Switch
Note
This module is part of the community.vmware collection (version 5.9.0).
You might already have this collection installed if you are using the ansible package.
It is not included in ansible-core.
To check whether it is installed, run ansible-galaxy collection list.
To install it, use: ansible-galaxy collection install community.vmware.
To use it in a playbook, specify: community.vmware.vmware_dvswitch_uplink_pg.
Synopsis
- This module can be used to configure the uplink portgroup of a Distributed Switch. 
Parameters
| Parameter | Comments | 
|---|---|
| Dictionary which configures the advanced policy settings for the uplink portgroup. Default:  | |
| Indicates if the block policy can be changed per port. Choices: 
 | |
| Indicates if the NetFlow policy can be changed per port. Choices: 
 | |
| Indicates if the configuration of a port is reset automatically after disconnect. Choices: 
 | |
| Indicates if the traffic filter can be changed per port. Choices: 
 | |
| Indicates if the vendor config can be changed per port. Choices: 
 | |
| Indicates if the vlan can be changed per port. Choices: 
 | |
| Indicates if all ports are blocked on the uplink portgroup. Choices: 
 | |
| The description of the uplink portgroup. | |
| The hostname or IP address of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable  | |
| Dictionary which configures the LACP settings for the uplink portgroup. The options are only used if the LACP support mode is set to ‘basic’. Default:  | |
| The negotiating state of the uplinks/ports. Choices: 
 | |
| Indicates if LACP is enabled. Choices: 
 | |
| The name of the uplink portgroup. The current name will be used if not specified. | |
| Indicates if NetFlow is enabled on the uplink portgroup. Choices: 
 | |
| The password of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable  | |
| The port number of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable  Default:  | |
| 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  | |
| 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  | |
| The name of the Distributed Switch. | |
| The username of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable  | |
| Allows connection when SSL certificates are not valid. Set to  If the value is not specified in the task, the value of environment variable  Choices: 
 | |
| The VLAN trunk range that should be configured with the uplink portgroup. This can be a combination of multiple ranges and numbers, example: [ 2-3967, 4049-4092 ]. Default:  | 
Notes
Note
- All modules requires API write access and hence is not supported on a free ESXi license. 
- All variables and VMware object names are case sensitive. 
Examples
- name: Configure Uplink portgroup
  community.vmware.vmware_dvswitch_uplink_pg:
    hostname: '{{ inventory_hostname }}'
    username: '{{ vcsa_username }}'
    password: '{{ vcsa_password }}'
    switch: dvSwitch
    name: dvSwitch-DVUplinks
    advanced:
      port_config_reset_at_disconnect: true
      block_override: true
      vendor_config_override: false
      vlan_override: false
      netflow_override: false
      traffic_filter_override: false
    vlan_trunk_range:
      - '0-4094'
    netflow_enabled: false
    block_all_ports: false
  delegate_to: localhost
- name: Enabled LACP on Uplink portgroup
  community.vmware.vmware_dvswitch_uplink_pg:
    hostname: '{{ inventory_hostname }}'
    username: '{{ vcsa_username }}'
    password: '{{ vcsa_password }}'
    switch: dvSwitch
    lacp:
      status: enabled
      mode: active
  delegate_to: localhost
Return Values
Common return values are documented here, the following are the fields unique to this module:
| Key | Description | 
|---|---|
| information about performed operation Returned: always Sample:  | 
