mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Fix vmware_portgroup throwing an error if port group already exists
This commit is contained in:
@@ -106,6 +106,9 @@ def main():
|
|||||||
raise SystemExit("Unable to locate Physical Host.")
|
raise SystemExit("Unable to locate Physical Host.")
|
||||||
host_system = host.keys()[0]
|
host_system = host.keys()[0]
|
||||||
|
|
||||||
|
if find_host_portgroup_by_name(host_system, portgroup_name):
|
||||||
|
module.exit_json(changed=False)
|
||||||
|
|
||||||
changed = create_port_group(host_system, portgroup_name, vlan_id, switch_name)
|
changed = create_port_group(host_system, portgroup_name, vlan_id, switch_name)
|
||||||
|
|
||||||
module.exit_json(changed=changed)
|
module.exit_json(changed=changed)
|
||||||
|
|||||||
Reference in New Issue
Block a user