mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Fix exception when using masquerade
The following snippet:
- name: Let the DMZ connect to internet
firewalld:
zone: dmz
masquerade: True
permanent: True
immediate: True
state: enabled
will fail with this error message:
Exception caught: set_masquerade_enabled() takes 1 positional argument but 3 were given
It turn out that it treat 'zone' as a array of string instead of 1 string.
I only tested on Python 3 with a Fedora 25.
This commit is contained in:
committed by
Brian Coca
parent
88099e2acb
commit
bda066f6f6
@@ -1009,7 +1009,7 @@ def main():
|
|||||||
action_handler(set_masquerade_permanent, (zone, True))
|
action_handler(set_masquerade_permanent, (zone, True))
|
||||||
changed=True
|
changed=True
|
||||||
if not is_enabled_immediate:
|
if not is_enabled_immediate:
|
||||||
action_handler(set_masquerade_enabled, (zone))
|
action_handler(set_masquerade_enabled, (zone,))
|
||||||
changed=True
|
changed=True
|
||||||
if changed:
|
if changed:
|
||||||
msgs.append("Added masquerade to zone %s" % (zone))
|
msgs.append("Added masquerade to zone %s" % (zone))
|
||||||
@@ -1022,7 +1022,7 @@ def main():
|
|||||||
action_handler(set_masquerade_permanent, (zone, False))
|
action_handler(set_masquerade_permanent, (zone, False))
|
||||||
changed=True
|
changed=True
|
||||||
if is_enabled_immediate:
|
if is_enabled_immediate:
|
||||||
action_handler(set_masquerade_disabled, (zone))
|
action_handler(set_masquerade_disabled, (zone,))
|
||||||
changed=True
|
changed=True
|
||||||
if changed:
|
if changed:
|
||||||
msgs.append("Removed masquerade from zone %s" % (zone))
|
msgs.append("Removed masquerade from zone %s" % (zone))
|
||||||
|
|||||||
Reference in New Issue
Block a user