ansible.posix/tests/integration/targets
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
..
acl Bootstrap Collection (#1) 2020-03-13 09:12:26 +00:00
at Revert "Enable at, patch and synchronize tests (#5)" (#35) 2020-06-04 15:54:14 -05:00
authorized_key Restructure integration tests for authorized_key module 2021-07-02 16:27:02 +09:00
firewalld add tests for REJECT target 2021-06-29 11:37:20 +03:00
mount Clean up main.yml 2021-07-01 10:12:33 -07:00
patch patch - add integration test for ignore_whitespace 2020-07-12 12:09:56 +02:00
prepare_tests/tasks Initial commit 2020-03-09 13:15:28 +00:00
seboolean Bootstrap Collection (#1) 2020-03-13 09:12:26 +00:00
selinux Fix sanity test for modules 2021-03-02 18:53:06 +05:30
synchronize enable integration tests 2021-07-09 02:28:39 +02:00
sysctl do not persist sysctl when value is invalid 2020-10-02 23:03:14 +02:00