From 771abe1038faec3cd32a8fd71ca4e04e7ed3468f Mon Sep 17 00:00:00 2001 From: Mario Lenz Date: Sat, 1 Oct 2022 15:06:29 +0200 Subject: [PATCH] Remove default for network_policy and add inherit param --- plugins/modules/vmware_dvs_portgroup.py | 27 ++++++++++++------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/plugins/modules/vmware_dvs_portgroup.py b/plugins/modules/vmware_dvs_portgroup.py index f3fd293e53..d3730f7404 100644 --- a/plugins/modules/vmware_dvs_portgroup.py +++ b/plugins/modules/vmware_dvs_portgroup.py @@ -111,18 +111,18 @@ description: - Dictionary which configures the different security values for portgroup. suboptions: + inherited: + type: bool + description: Inherit the settings from the switch or not. promiscuous: type: bool - description: Indicates whether promiscuous mode is allowed. - default: False + description: Indicates whether promiscuous mode is allowed. Ignored if C(inherited) is true. forged_transmits: type: bool - description: Indicates whether forged transmits are allowed. - default: False + description: Indicates whether forged transmits are allowed. Ignored if C(inherited) is true. mac_changes: type: bool - description: Indicates whether mac changes are allowed. - default: False + description: Indicates whether mac changes are allowed. Ignored if C(inherited) is true. required: False default: { promiscuous: False, @@ -855,15 +855,14 @@ def main(): network_policy=dict( type='dict', options=dict( - promiscuous=dict(type='bool', default=False), - forged_transmits=dict(type='bool', default=False), - mac_changes=dict(type='bool', default=False) + inherited=dict(type='bool'), + promiscuous=dict(type='bool'), + forged_transmits=dict(type='bool'), + mac_changes=dict(type='bool') ), - default=dict( - promiscuous=False, - forged_transmits=False, - mac_changes=False - ) + required_if=[ + ('inherited', True, ('promiscuous', 'forged_transmits', 'mac_changes')) + ], ), in_traffic_shaping=dict( type='dict',