I am experimenting with Ansible and want to set a port forward rule in firewalld.
I've tried the following:
- name: Port forward for 443
become: true
ansible.posix.firewalld:
port_forward:
- port: 443
proto: tcp
toport: 2443
state: enabled
This resulted in:
ERROR: Exception caught: queryForwardPort() got an unexpected keyword argument ''to_port''
If I format it as a list it says
Only one port forward supported at a time
and if I format it as a dict I get:
argument port_forward is of type <class ''dict''> and we were unable to convert to list: <class ''dict''> cannot be converted to a list'
I'm using a Debian 11 VM with Ansible 2.10.8. I've installed the latest ansible.posix (1.3.0) as the included version was older (1.1.1). I can manually create the rule on the target machine (OEL 8).
This is as far as I got using the documentation.
Any idea how to get this working?
Thank you in advance!