The vmware_portgroup module

This module lets you create a VMware port group on the hosts in a given cluster:

- name: Create a portgroup with vlan  vmware_portgroup:    hostname: "{{ vsphere_host }}"    username: "{{ vsphere_username }}"    password: "{{ vsphere_password }}"    validate_certs: "no"    cluster_name: "my_cluster"    switch_name: "my_switch"    portgroup_name: "my_portgroup_vlan123"    vlan_id: "123"  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.