With this module, you can manage your DVS port groups:
- name: Create a portgroup with vlan vmware_dvs_portgroup: hostname: "{{ vsphere_host }}" username: "{{ vsphere_username }}" password: "{{ vsphere_password }}" validate_certs: "no" portgroup_name: "my_portgroup_vlan123" switch_name: "my_dvSwitch" vlan_id: "123" num_ports: "120" portgroup_type: "earlyBinding" state: "present" delegate_to: "localhost"