ansible.posix.firewalld_info module – Gather information about firewalld
Note
This module is part of the ansible.posix collection (version 1.5.4).
You might already have this collection installed if you are using the ansible
package. It is not included in ansible-core
. To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install ansible.posix
. You need further requirements to be able to use this module, see Requirements for details.
To use it in a playbook, specify: ansible.posix.firewalld_info
.
Synopsis
- This module gathers information about firewalld rules.
Requirements
The below requirements are needed on the host that executes this module.
- firewalld >= 0.2.11
- python-firewall
- python-dbus
Parameters
Parameter | Comments |
---|---|
active_zones boolean | Gather information about active zones. Choices:
|
zones list / elements=string | Gather information about specific zones. If only works if |
Examples
- name: Gather information about active zones ansible.posix.firewalld_info: active_zones: true register: result - name: Print default zone for debugging ansible.builtin.debug: var: result.firewalld_info.default_zone - name: Gather information about specific zones ansible.posix.firewalld_info: zones: - public - external - internal register: result
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key | Description |
---|---|
active_zones boolean | Gather active zones only if turn it Returned: success Sample: |
collected_zones list / elements=string | A list of collected zones. Returned: success Sample: |
firewalld_info complex | Returns various information about firewalld configuration. Returned: success |
default_zone string |
The zone name of default zone. Returned: success Sample: |
version string |
The version information of firewalld. Returned: success Sample: |
zones complex |
A dict of zones to gather information. Returned: success |
zone complex |
The zone name registered in firewalld. Returned: success Sample: |
forward boolean |
The network interface forwarding. This parameter supports on python-firewall 0.9.0(or later) and is not collected in earlier versions. Returned: success Sample: |
forward_ports list / elements=string |
A list of forwarding port pair with protocol. Returned: success Sample: |
icmp_block_inversion boolean |
The ICMP block inversion to block all ICMP requests. Returned: success Sample: |
icmp_blocks list / elements=string |
A list of blocking icmp protocol. Returned: success Sample: |
interfaces list / elements=string |
A list of network interfaces. Returned: success Sample: |
masquerade boolean |
The network interface masquerading. Returned: success Sample: |
ports list / elements=string |
A list of network port with protocol. Returned: success Sample: |
protocols list / elements=string |
A list of network protocol. Returned: success Sample: |
rich_rules list / elements=string |
A list of rich language rule. Returned: success Sample: |
services list / elements=string |
A list of network services. Returned: success Sample: |
source_ports list / elements=string |
A list of network source port with protocol. Returned: success Sample: |
sources list / elements=string |
A list of source network address. Returned: success Sample: |
target string |
A list of services in the zone. Returned: success Sample: |
undefined_zones list / elements=string | A list of undefined zones in
Returned: success Sample: |
Collection links
© 2012–2018 Michael DeHaan
© 2018–2024 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/ansible/posix/firewalld_info_module.html