??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
ó
àUdac @` s“ d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d d
l m
Z
d d l m Z m
Z
y$ d d l m Z d d
l m Z Wn e k
r© n Xd e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d „ Z e d! k re ƒ n d" S(# i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bysÒ
---
module: firewalld
short_description: Manage arbitrary ports/services with firewalld
description:
- This module allows for addition or deletion of services and ports (either TCP or UDP) in either running or permanent firewalld rules.
version_added: "1.4"
options:
service:
description:
- Name of a service to add/remove to/from firewalld.
- The service must be listed in output of firewall-cmd --get-services.
type: str
port:
description:
- 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.
type: str
rich_rule:
description:
- Rich rule to add/remove to/from firewalld.
type: str
source:
description:
- The source/network you would like to add/remove to/from firewalld.
type: str
version_added: "2.0"
interface:
description:
- The interface you would like to add/remove to/from a zone in firewalld.
type: str
version_added: "2.1"
icmp_block:
description:
- The ICMP block you would like to add/remove to/from a zone in firewalld.
type: str
version_added: "2.8"
icmp_block_inversion:
description:
- Enable/Disable inversion of ICMP blocks for a zone in firewalld.
type: str
version_added: "2.8"
zone:
description:
- The firewalld zone to add/remove to/from.
- Note that the default zone can be configured per system but C(public) is default from upstream.
- Available choices can be extended based on per-system configs, listed here are "out of the box" defaults.
- Possible values include C(block), C(dmz), C(drop), C(external), C(home), C(internal), C(public), C(trusted), C(work).
type: str
permanent:
description:
- Should this configuration be in the running firewalld configuration or persist across reboots.
- As of Ansible 2.3, permanent operations can operate on firewalld configs when it is not running (requires firewalld >= 3.0.9).
- Note that if this is C(no), immediate is assumed C(yes).
type: bool
immediate:
description:
- Should this configuration be applied immediately, if set as permanent.
type: bool
default: no
version_added: "1.9"
state:
description:
- Enable or disable a setting.
- 'For ports: Should this port accept (enabled) or reject (disabled) connections.'
- The states C(present) and C(absent) can only be used in zone level operations (i.e. when no other parameters but zone and state are set).
type: str
required: true
choices: [ absent, disabled, enabled, present ]
timeout:
description:
- The amount of time the rule should be in effect for when non-permanent.
type: int
default: 0
masquerade:
description:
- The masquerade setting you would like to enable/disable to/from zones within firewalld.
type: str
version_added: "2.1"
offline:
description:
- Whether to run this module even when firewalld is offline.
type: bool
version_added: "2.3"
notes:
- Not tested on any Debian based system.
- Requires the python2 bindings of firewalld, which may not be installed by default.
- For distributions where the python2 firewalld bindings are unavailable (e.g Fedora 28 and later) you will have to set the
ansible_python_interpreter for these hosts to the python3 interpreter path and install the python3 bindings.
- Zone transactions (creating, deleting) can be performed by using only the zone and state parameters "present" or "absent".
Note that zone transactions must explicitly be permanent. This is a limitation in firewalld.
This also means that you will have to reload firewalld after adding a zone that you wish to perform immediate actions on.
The module will not take care of this for you implicitly because that would undo any previously performed immediate actions which were not
permanent. Therefore, if you require immediate access to a newly created zone it is recommended you reload firewalld immediately after the zone
creation returns with a changed state and before you perform any other immediate, non-permanent actions on that zone.
requirements:
- firewalld >= 0.2.11
author:
- Adam Miller (@maxamillion)
sƒ
- firewalld:
service: https
permanent: yes
state: enabled
- firewalld:
port: 8081/tcp
permanent: yes
state: disabled
- firewalld:
port: 161-162/udp
permanent: yes
state: enabled
- firewalld:
zone: dmz
service: http
permanent: yes
state: enabled
- firewalld:
rich_rule: rule service name="ftp" audit limit value="1/m" accept
permanent: yes
state: enabled
- firewalld:
source: 192.0.2.0/24
zone: internal
state: enabled
- firewalld:
zone: trusted
interface: eth2
permanent: yes
state: enabled
- firewalld:
masquerade: yes
state: enabled
permanent: yes
zone: dmz
- firewalld:
zone: custom
state: present
permanent: yes
- firewalld:
zone: drop
state: present
permanent: yes
icmp_block_inversion: yes
- firewalld:
zone: drop
state: present
permanent: yes
icmp_block: echo-request
- name: Redirect port 443 to 8443 with Rich Rule
firewalld:
rich_rule: rule family=ipv4 forward-port port=443 protocol=tcp to-port=8443
zone: public
permanent: yes
immediate: yes
state: enabled
( t
AnsibleModule( t FirewallTransactiont
fw_offline( t Rich_Rule( t FirewallClientZoneSettingst IcmpBlockTransactionc B` s\ e Z d Z d d d e e d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z RS( s
IcmpBlockTransaction
c C` s8 t t | ƒ j | d | d | d | d | d | ƒd S( Nt action_argst
desired_statet zonet permanentt immediate( t superR
t __init__( t selft moduleR R R R R ( ( sD /usr/lib/python2.7/site-packages/ansible/modules/system/firewalld.pyR Ê s c C` s | | j j | j ƒ k S( N( t fwt
getIcmpBlocksR ( R t
icmp_blockt timeout( ( sD /usr/lib/python2.7/site-packages/ansible/modules/system/firewalld.pyt get_enabled_immediateÏ s c C` s" | j ƒ \ } } | | j ƒ k S( N( t get_fw_zone_settingsR ( R R R t fw_zonet fw_settings( ( sD /usr/lib/python2.7/site-packages/ansible/modules/system/firewalld.pyt get_enabled_permanentÒ s c C` s | j j | j | | ƒ d S( N( R t addIcmpBlockR ( R R R ( ( sD /usr/lib/python2.7/site-packages/ansible/modules/system/firewalld.pyt set_enabled_immediateÖ s c C` s3 | j ƒ \ } } | j | ƒ | j | | ƒ d S( N( R R t update_fw_settings( R R R R R ( ( sD /usr/lib/python2.7/site-packages/ansible/modules/system/firewalld.pyt set_enabled_permanentÙ s
c C` s | j j | j | ƒ d S( N( R t removeIcmpBlockR ( R R R ( ( sD /usr/lib/python2.7/site-packages/ansible/modules/system/firewalld.pyt set_disabled_immediateÞ s c C` s3 | j ƒ \ } } | j | ƒ | j | | ƒ d S( N( R R$ R" ( R R R R R ( ( sD /usr/lib/python2.7/site-packages/ansible/modules/system/firewalld.pyt set_disabled_permanentá s
N( t __name__t
__module__t __doc__t Nonet FalseR R R R! R# R% R&