New in version 2.0.
Add or remove a host from distributed virtual switch
- python >= 2.6
- PyVmomi
parameter | required | default | choices | comments |
---|---|---|---|---|
esxi_hostname |
yes | The ESXi hostname | ||
hostname |
yes | The hostname or IP address of the vSphere vCenter | ||
password |
yes | The password of the vSphere vCenter aliases: pass, pwd | ||
state |
yes |
|
If the host should be present or absent attached to the vSwitch | |
switch_name |
yes | The name of the Distributed vSwitch | ||
username |
yes | The username of the vSphere vCenter aliases: user, admin | ||
vmnics |
yes | The ESXi hosts vmnics to use with the Distributed vSwitch |
# Example vmware_dvs_host command from Ansible Playbooks - name: Add Host to dVS local_action: module: vmware_dvs_host hostname: vcenter_ip_or_hostname username: vcenter_username password: vcenter_password esxi_hostname: esxi_hostname_as_listed_in_vcenter switch_name: dvSwitch vmnics: - vmnic0 - vmnic1 state: present
Note
Tested on vSphere 5.5
For more information on what this means please read Extras Modules
For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Helping Testing PRs and Developing Modules.