# ansible -m iptables -a 'table=nat chain=PREROUTING protocol=tcp match=tcp destination_port=8001 jump=REDIRECT to_destination=192.168.100.131 to_ports=22' gateway --ask-pass
gateway | FAILED! => {
"changed": false,
"cmd": "/usr/sbin/iptables -t nat -A PREROUTING -p tcp -m tcp -j REDIRECT --to-destination 192.168.100.131 --destination-port 8001 --to-ports 22",
"failed": true,
"msg": "iptables v1.4.21: unknown option \"--to-destination\"\nTry `iptables -h' or 'iptables --help' for more information.",
"rc": 2,
"stderr": "iptables v1.4.21: unknown option \"--to-destination\"\nTry `iptables -h' or 'iptables --help' for more information.\n",
"stdout": "",
"stdout_lines": []
}
I already check https://docs.ansible.com/ansible/iptables_module.html
Pleas tell me which option I should use?
Thanks