diff --git a/plugins/module_utils/interface_group.py b/plugins/module_utils/interface_group.py index bffd4b07..63d9fe05 100644 --- a/plugins/module_utils/interface_group.py +++ b/plugins/module_utils/interface_group.py @@ -13,9 +13,13 @@ state=dict(default='present', choices=['present', 'absent']), name=dict(required=True, type='str'), descr=dict(type='str'), - members=dict(required=True, type='list', elements='str'), + members=dict(type='list', elements='str'), ) +INTERFACE_GROUP_REQUIRED_IF = [ + ['state', 'present', ['members']], +] + INTERFACE_GROUP_PHP_COMMAND = ''' require_once("interfaces.inc"); {0} diff --git a/plugins/modules/pfsense_interface_group.py b/plugins/modules/pfsense_interface_group.py index 4a82ad73..103150a0 100644 --- a/plugins/modules/pfsense_interface_group.py +++ b/plugins/modules/pfsense_interface_group.py @@ -82,6 +82,7 @@ def main(): module = AnsibleModule( argument_spec=INTERFACE_GROUP_ARGUMENT_SPEC, + required_if=INTERFACE_GROUP_REQUIRED_IF, supports_check_mode=True) pfmodule = PFSenseInterfaceGroupModule(module)