Using this module, you can add or remove a host from the distributed virtual switch:
- name: Add host to dvs vmware_dvs_host: hostname: "{{ vsphere_host }}" username: "{{ vsphere_username }}" password: "{{ vsphere_password }}" validate_certs: "no" esxi_hostname: "{{ exsi_host }}" switch_name: "my_dvSwitch" vmnics: - "vmnic1" - "vmnic2" state: "present" delegate_to: "localhost"