ansible.posix/plugins/modules
ansible-zuul[bot] e815909859
Merge pull request #215 from quasd/main
fix REJECT target name

SUMMARY
Fix setting default target to reject. The target name is %%REJECT%% not REJECT.
https://firewalld.org/documentation/zone/options.html
After this pull request to way to set REJECT would be
  - name: "Set target to REJECT for public"
    ansible.posix.firewalld:
      zone: public
      permanent: yes
      target: '%%REJECT%%'
      state: enabled
    become: true


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME
firewalld
ADDITIONAL INFORMATION



This snippet would fail due to there not being target called REJECT and using %%REJECT%% is not in allowed values for target
  - name: "Set target to REJECT for public"
    ansible.posix.firewalld:
      zone: public
      permanent: yes
      target: 'REJECT'
      state: enabled
    become: true

Ansible error
{
    "msg": "ERROR: Exception caught: org.fedoraproject.FirewallD1.Exception: INVALID_TARGET: REJECT Permanent operation",
    "invocation": {
        "module_args": {
            "zone": "public",
            "permanent": true,
            "target": "REJECT",
            "state": "enabled",
            "immediate": false,
            "timeout": 0,
            "icmp_block": null,
            "icmp_block_inversion": null,
            "service": null,
            "port": null,
            "port_forward": null,
            "rich_rule": null,
            "source": null,
            "interface": null,
            "masquerade": null,
            "offline": null
        }
    },
    "_ansible_no_log": false,
    "changed": false
}

syslog
Jun 29 09:49:39 <hostname retracted> ansible-ansible.posix.firewalld[9015]: Invoked with zone=public permanent=True state=enabled target=REJECT immediate=False timeout=0 icmp_[1850/7279] icmp_block_inversion=None service=None port=None port_forward=None rich_rule=None source=None interface=None masquerade=None offline=None                                                                 
Jun 29 09:49:39 <hostname retracted>  firewalld[915]: ERROR: INVALID_TARGET: REJECT

Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: None <None>
Reviewed-by: Amin Vakil <info@aminvakil.com>
Reviewed-by: quidame <None>
Reviewed-by: Hideki Saito <saito@fgrep.org>
2021-07-14 17:05:30 +00:00
..
__init__.py Initial commit 2020-03-09 13:15:28 +00:00
acl.py acl: Add new alias 2021-06-04 16:51:15 +05:30
at.py Append line-separator to the end of command line 2021-05-05 09:35:39 +09:00
authorized_key.py authorized_key: Add support for additional key types 2021-05-25 10:06:01 +05:30
firewalld.py fix yaml syntax for reject choices 2021-06-29 13:33:35 +03:00
mount.py Merge https://github.com/ansible-collections/ansible.posix into issues/126/mount-return-backup-file 2021-06-30 04:11:28 -04:00
patch.py patch - add line break to fix pep8 error 2020-07-12 12:09:52 +02:00
seboolean.py Fix sanity test for modules 2021-03-02 18:53:06 +05:30
selinux.py Fix sanity test for modules 2021-03-02 18:53:06 +05:30
synchronize.py fixes #24 and #190 2021-06-24 23:37:48 +02:00
sysctl.py Fix sanity test for modules 2021-03-02 18:53:06 +05:30