Hi, i have a rpoblem tryng to set firewalld rich rules with salstack
Salt 3002 on CnetOS 8.
I need to deploy some rules like this:
firewall-cmd --zone=public --permanent --add-rich-rule="rule family=\"ipv4\" destination address=\"10.208.108.212\" forward-port port=\"80\" protocol=\"tcp\" to-port=\"8089\""
So i prepared grains to have the data i need:
fwd_rules:
rule1:
ports:
http:
fromport: 80
toport: 8089
https:
fromport: 443
toport: 4089
ips:
- 10.208.108.200
- 10.208.108.201
And wrote a state (i've omitted iterations):
{{ ip }}-{{ port['fromport'] }}-{{ port['toport'] }}:
firewalld.present:
- name: public
- prune_services: False
rich_rules:
- family: ipv4
destination:
address: {{ ip }}
forward-port:
port: {{ port['fromport'] }}
protocol: tcp
to-port: {{ port['toport'] }}
But i recieve an error:
2020-12-04 13:17:03,860 [salt.loaded.int.module.cmdmod:851 ][ERROR ][47193] retcode: 122
2020-12-04 13:17:03,860 [salt.state :321 ][ERROR ][47193] Error: firewall-cmd failed: Error: INVALID_RULE: unknown element OrderedDict([(family,
2020-12-04 13:17:05,160 [salt.loaded.int.module.cmdmod:845 ][ERROR ][47193] Command '['/usr/bin/firewall-cmd', '--zone=public', '--add-rich-rule=OrderedDict([(family, ipv4), (destination, OrderedDict([(address, 10.208.4.5)])), (forward-port, OrderedDict([(port, 443), (protocol, tcp), (to-port, 5089)]))])', '--permanent']' failed with return code: 122
what am i doing wrong?
Thanks