firewalld: Add support for firewalld port forwarding

Fixes: ansible-collections/ansible.posix#100
This commit is contained in:
Evan Anderson
2021-01-16 17:01:10 -06:00
parent 41d49e4e08
commit 1e7d82af6d
3 changed files with 214 additions and 3 deletions

View File

@@ -173,6 +173,21 @@ Parameters
<div>Must be in the form PORT/PROTOCOL or PORT-PORT/PROTOCOL for port ranges.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
<b>port_forward</b>
<a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
<div style="font-size: small">
<span style="color: purple">string</span>
</div>
</td>
<td>
</td>
<td>
<div>Port and protocol to forward using firewalld.</div>
</td>
</tr>
<tr>
<td colspan="1">
<div class="ansibleOptionAnchor" id="parameter-"></div>
@@ -360,9 +375,13 @@ Examples
permanent: yes
icmp_block: echo-request
- name: Redirect port 443 to 8443 with Rich Rule
- name: Redirect port 443 to 8443
become: yes
ansible.posix.firewalld:
rich_rule: rule family=ipv4 forward-port port=443 protocol=tcp to-port=8443
port_forward:
- port: 443
proto: tcp
toport: 8443
zone: public
permanent: yes
immediate: yes
@@ -370,7 +389,6 @@ Examples
Status
------