vmware_dvswitch – Create or remove a distributed vSwitch
vmware_dvswitch – Create or remove a distributed vSwitch
New in version 2.0.
Synopsis
- Create or remove a distributed vSwitch
Requirements
The below requirements are needed on the host that executes this module.
- python >= 2.6
- PyVmomi
Parameters
Parameter | Choices/Defaults | Comments |
---|---|---|
datacenter_name - / required |
The name of the datacenter that will contain the dvSwitch | |
discovery_operation - |
|
Select the discovery operation |
discovery_proto - / required |
|
Link discovery protocol between Cisco and Link Layer discovery |
hostname string |
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 version 2.6. | |
mtu - / required |
The switch maximum transmission unit | |
password string |
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 version 2.6.
| |
port integer added in 2.5 |
Default: 443 |
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 version 2.6. |
state - |
|
Create or remove dvSwitch |
switch_name - / required |
The name of the switch to create or remove | |
switch_version - added in 2.5 |
The version of the switch to create. Can be 6.5.0, 6.0.0, 5.5.0, 5.1.0, 5.0.0 with a vcenter running vSphere 6.5 Needed if you have a vcenter version > ESXi version to join DVS. If not specified version=version of vcenter | |
uplink_quantity - / required |
Quantity of uplink per ESXi host added to the switch | |
username string |
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 version 2.6.
| |
validate_certs boolean |
|
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 version 2.6. If set to |
Notes
Note
- Tested on vSphere 6.5
Examples
- name: Create dvswitch
vmware_dvswitch:
hostname: '{{ vcenter_hostname }}'
username: '{{ vcenter_username }}'
password: '{{ vcenter_password }}'
datacenter_name: datacenter
switch_name: dvSwitch
switch_version: 6.0.0
mtu: 9000
uplink_quantity: 2
discovery_proto: lldp
discovery_operation: both
state: present
delegate_to: localhost
Status
- This module is not guaranteed to have a backwards compatible interface. [preview]
- This module is maintained by the Ansible Community. [community]
Authors
- Joseph Callen (@jcpowermac)
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/vmware_dvswitch_module.html