New in version 1.4.
The below requirements are needed on the host that executes this module.
Parameter |
Choices/Defaults |
Comments |
---|---|---|
immediate
(added in 1.9) |
|
Should this configuration be applied immediately, if set as permanent
|
interface
(added in 2.1) |
|
The interface you would like to add/remove to/from a zone in firewalld
|
masquerade
(added in 2.1) |
|
The masquerade setting you would like to enable/disable to/from zones within firewalld
|
permanent
|
|
Should this configuration be in the running firewalld configuration or persist across reboots. As of Ansible version 2.3, permanent operations can operate on firewalld configs when it's not running (requires firewalld >= 3.0.9). (NOTE: If this is false, immediate is assumed true.)
|
port
|
|
Name of a port or port range to add/remove to/from firewalld. Must be in the form PORT/PROTOCOL or PORT-PORT/PROTOCOL for port ranges.
|
rich_rule
|
|
Rich rule to add/remove to/from firewalld.
|
service
|
|
Name of a service to add/remove to/from firewalld - service must be listed in output of firewall-cmd --get-services.
|
source
(added in 2.0) |
|
The source/network you would like to add/remove to/from firewalld
|
state
required |
|
Enable or disable a setting. For ports: Should this port accept(enabled) or reject(disabled) connections. The states "present" and "absent" can only be used in zone level operations (i.e. when no other parameters but zone and state are set).
|
timeout
|
Default:
no
|
The amount of time the rule should be in effect for when non-permanent.
|
zone
|
system-default(public)
|
The firewalld zone to add/remove to/from (NOTE: default zone can be configured per system but "public" is default from upstream. Available choices can be extended based on per-system configs, listed here are "out of the box" defaults).
|
Note
- firewalld:
service: https
permanent: true
state: enabled
- firewalld:
port: 8081/tcp
permanent: true
state: disabled
- firewalld:
port: 161-162/udp
permanent: true
state: enabled
- firewalld:
zone: dmz
service: http
permanent: true
state: enabled
- firewalld:
rich_rule: 'rule service name="ftp" audit limit value="1/m" accept'
permanent: true
state: enabled
- firewalld:
source: 192.0.2.0/24
zone: internal
state: enabled
- firewalld:
zone: trusted
interface: eth2
permanent: true
state: enabled
- firewalld:
masquerade: yes
state: enabled
permanent: true
zone: dmz
- firewalld:
zone: custom
state: present
permanent: true
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
Hint
If you notice any issues in this documentation you can edit this document to improve it.