The vmware_dvs_portgroup module

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"

Get Learn Ansible now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.