Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firewalld - set masquerade #21632

Closed
tdobrovolny opened this issue Feb 19, 2017 · 5 comments · Fixed by #21693
Closed

firewalld - set masquerade #21632

tdobrovolny opened this issue Feb 19, 2017 · 5 comments · Fixed by #21693
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module.

Comments

@tdobrovolny
Copy link
Contributor

ISSUE TYPE
  • Bug Report
COMPONENT NAME

firewalld module

ANSIBLE VERSION
ansible 2.3.0 (devel 76c9ad9dfc) last updated 2017/02/19 14:00:22 (GMT +200)
  config file = /home/tomas/ansible/net/ansible.cfg
  configured module search path = Default w/o overrides
FIREWALLD VERSION
firewalld.noarch          0.4.4.2-2.fc24
python-firewall.noarch    0.4.4.2-2.fc24
CONFIGURATION

Default

OS / ENVIRONMENT

Fedora 24

SUMMARY

Setting masquerade option for zone with firewalld module failed with error:
ERROR: Exception caught: get_masquerade_enabled_permanent() takes exactly 1 argument (6 given)

STEPS TO REPRODUCE

Run ansible-playbook firewall.yml

firewall.yml is here:

- hosts: all
  become: yes
  tasks:
  - name: Set masquarade for zones
    tags:
      - firewalld
    firewalld:
      zone: SmazMe
      masquerade: yes
      permanent: true
      state: enabled
EXPECTED RESULTS

Set firewalld masquerade option for zone SmazMe

ACTUAL RESULTS

Action failed with error.

fatal: [localhost]: FAILED! => {
    "changed": false, 
    "failed": true, 
    "invocation": {
        "module_args": {
            "immediate": false, 
            "interface": null, 
            "masquerade": "True", 
            "offline": null, 
            "permanent": true, 
            "port": null, 
            "rich_rule": null, 
            "service": null, 
            "source": null, 
            "state": "enabled", 
            "timeout": 0, 
            "zone": "SmazMe"
        }
    }, 
    "msg": "ERROR: Exception caught: get_masquerade_enabled_permanent() takes exactly 1 argument (6 given)"
}
@ansibot
Copy link
Contributor

ansibot commented Feb 19, 2017

@ansibot ansibot added affects_2.3 This issue/PR affects Ansible v2.3 bug_report module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. labels Feb 19, 2017
@alikins alikins removed the needs_triage Needs a first human triage before being processed. label Feb 20, 2017
@alikins
Copy link
Contributor

alikins commented Feb 20, 2017

Proposed fix for this at #21693

alikins added a commit that referenced this issue Feb 24, 2017
get_masquerade_* functions only take one arg. The action_handler
wrapper function expected a tuple, but was being passed (zone)
instead of (zone,) making for an ambiquous tuple. The
(zone) arg was being treated as a tuple/list of six chars
(the zone name) instead of a tuple of one string.

This would cause errors like:

        get_masquerade_enabled_permanent() takes exactly 1 argument (6 given)

Fixes #21632
@aioue
Copy link
Contributor

aioue commented Jun 14, 2017

@alikins @tdobrovolny I have the exact same issue when using immediate: true, even after the fix. Without immediate: true, there is no problem.

@tdobrovolny
Copy link
Contributor Author

tdobrovolny commented Jun 14, 2017

@aioue Confirm. Adding immediate: true make the nearly same error. But on set function.

FAILED! => {"changed": false, "failed": true, "msg": "ERROR: Exception caught: set_masquerade_enabled() takes exactly 1 argument (6 given)"}

ansible 2.4.0 (devel 6ce7448ca4) last updated 2017/06/08 18:13:48 (GMT +200)

---
- hosts: localhost
  become: yes
  tasks:
  - name: Set masquarade for zones
    tags:
      - firewalld
    firewalld:
      zone: SmazMe
      masquerade: yes
      immediate: true
      permanent: true
      state: enabled
...

@aioue
Copy link
Contributor

aioue commented Jun 14, 2017

@alikins issue not completely fixed by #21693

@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.3 This issue/PR affects Ansible v2.3 bug This issue/PR relates to a bug. module This issue/PR relates to a module.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants