community.vmware.vmware_dvswitch_uplink_pg module – Manage uplink portproup configuration of a Distributed Switch
Note
This module is part of the community.vmware collection (version 1.18.2).
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
.
Requirements
The below requirements are needed on the host that executes this module.
python >= 2.6
PyVmomi
Parameters
Parameter |
Comments |
---|---|
Dictionary which configures the advanced policy settings for the uplink portgroup. Default: {“block_override”: true, “netflow_override”: false, “port_config_reset_at_disconnect”: true, “traffic_filter_override”: false, “vendor_config_override”: false, “vlan_override”: false} |
|
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 Environment variable support added in Ansible 2.6. |
|
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: {“mode”: “passive”, “status”: “disabled”} |
|
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 Environment variable support added in Ansible 2.6. |
|
The port number of the vSphere vCenter or ESXi server. If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. Default: 443 |
|
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 This feature depends on a version of pyvmomi greater than v6.7.1.2018.12 |
|
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 Environment variable support added in Ansible 2.6. |
|
Allows connection when SSL certificates are not valid. Set to If the value is not specified in the task, the value of environment variable Environment variable support added in Ansible 2.6. If set to 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: [“0-4094”] |
Notes
Note
Tested on vSphere 6.5 and 6.7
All modules requires API write access and hence is not supported on a free ESXi license.
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: {“adv_block_ports”: true, “adv_netflow”: false, “adv_reset_at_disconnect”: true, “adv_traffic_filtering”: false, “adv_vendor_conf”: false, “adv_vlan”: false, “block_all_ports”: false, “changed”: false, “description”: null, “dvswitch”: “dvSwitch”, “lacp_status”: “disabled”, “lacp_status_previous”: “enabled”, “name”: “dvSwitch-DVUplinks”, “netflow_enabled”: false, “result”: “Uplink portgroup already configured properly”, “vlan_trunk_range”: [“2-3967”, “4049-4092”]} |
Authors
Christian Kotte (@ckotte)