From 765a74ce2edd72a27051d2fc0da8f229ce203a3f Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 22 Dec 2023 21:12:00 -0700 Subject: [PATCH] [pfsense_nat_outbound] Fix boolean values, invert. (#92) --- plugins/module_utils/nat_outbound.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/module_utils/nat_outbound.py b/plugins/module_utils/nat_outbound.py index bb843e6e..6e5c6abe 100644 --- a/plugins/module_utils/nat_outbound.py +++ b/plugins/module_utils/nat_outbound.py @@ -88,11 +88,10 @@ def _params_to_obj(self): self._get_ansible_param(obj, 'poolopts') self._get_ansible_param(obj, 'source_hash_key') self._get_ansible_param(obj, 'natport') - self._get_ansible_param_bool(obj, 'disabled') - self._get_ansible_param_bool(obj, 'nonat') - self._get_ansible_param_bool(obj, 'invert') - self._get_ansible_param_bool(obj, 'staticnatport') - self._get_ansible_param_bool(obj, 'nosync') + self._get_ansible_param_bool(obj, 'disabled', value='') + self._get_ansible_param_bool(obj, 'nonat', value='') + self._get_ansible_param_bool(obj, 'staticnatport', value='') + self._get_ansible_param_bool(obj, 'nosync', value='') if 'after' in self.params and self.params['after'] is not None: self.after = self.params['after'] @@ -102,6 +101,8 @@ def _params_to_obj(self): self._parse_address(obj, 'source', 'sourceport', True, 'network') self._parse_address(obj, 'destination', 'dstport', False, 'address') + if self.params['invert']: + obj['destination']['not'] = None self._parse_translated_address(obj) if obj['source_hash_key'] != '' and not obj['source_hash_key'].startswith('0x'):