ansible-collections/ansible.posix

ansible.posix.firewalld cannot change target

Opened this issue · 0 comments

Summary

I try to setup firewall with ansible:

      - ansible.posix.firewalld:
          zone: public
          state: enabled
          permanent: true
          target: DROP

and get error: "Unsupported parameters for (ansible.posix.firewalld) module: target Supported parameters include: icmp_block, icmp_block_inversion, immediate, interface, masquerade, offline, permanent, port, rich_rule, service, source, state, timeout, zone"

изображение

In same time in documentation (https://docs.ansible.com/ansible/latest/collections/ansible/posix/firewalld_module.html) i see this example:

- ansible.posix.firewalld:
    zone: internal
    state: present
    permanent: true
    target: ACCEPT

Issue Type

Bug Report

Component Name

firewalld

Ansible Version

$ ansible --version
2.10.6

Configuration

# if using a version older than ansible-core 2.12 you should omit the '-t all'
$ ansible-config dump --only-changed -t all
DEFAULT_FORKS(/etc/ansible/ansible.cfg) = 100
DEFAULT_GATHER_SUBSET(/etc/ansible/ansible.cfg) = [u'!all', u'!min', u'distribution', u'network', u'date_time', u'virtualization_role', u'hardware', u'os_family']
DEFAULT_HOST_LIST(/etc/ansible/ansible.cfg) = [u'/opt/<name_product>/ansible/production']
DEFAULT_LOG_PATH(/etc/ansible/ansible.cfg) = /var/log/ansible/ansible.log
DEFAULT_STRATEGY(/etc/ansible/ansible.cfg) = mitogen_linear
DEFAULT_STRATEGY_PLUGIN_PATH(/etc/ansible/ansible.cfg) = [u'/usr/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy']
HOST_KEY_CHECKING(/etc/ansible/ansible.cfg) = False

OS / Environment

CentOS 7

Steps to Reproduce

      - ansible.posix.firewalld:
          zone: public
          state: enabled
          permanent: true
          target: DROP

Expected Results

I expected, that if etc/firewalld/zones/public.xml will changes default, like after usage of shell command: "firewalld-cmd --permanent --zone=public --set-target=DROP"

Actual Results

Have error:  "Unsupported parameters for (ansible.posix.firewalld) module: target Supported parameters include: icmp_block, icmp_block_inversion, immediate, interface, masquerade, offline, permanent, port, rich_rule, service, source, state, timeout, zone"

Code of Conduct

  • I agree to follow the Ansible Code of Conduct