summaryrefslogtreecommitdiff
path: root/system/iptables.py
diff options
context:
space:
mode:
authorElena Washington <washingtoneg@users.noreply.github.com>2016-05-26 12:51:31 -0400
committerMatt Davis <nitzmahone@users.noreply.github.com>2016-05-26 09:51:31 -0700
commit3ca06bf1c809b3cf21e690e28252ceb8b778079d (patch)
tree358415b544ab12609e27c99d1112045ac34a16e6 /system/iptables.py
parent1ea51b2f99138c88bd32bfcb63c2ec8f9174787b (diff)
downloadansible-modules-extras-3ca06bf1c809b3cf21e690e28252ceb8b778079d.tar.gz
iptables: option to configure Source NAT (#2292)
* Clean up trailing whitespace * Add `--to-source` option to allow Source NAT (fix for #2291)
Diffstat (limited to 'system/iptables.py')
-rw-r--r--system/iptables.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/system/iptables.py b/system/iptables.py
index d874161c..f0f458a5 100644
--- a/system/iptables.py
+++ b/system/iptables.py
@@ -226,6 +226,13 @@ options:
this, the destination address is never altered."
required: false
default: null
+ to_source:
+ version_added: "2.2"
+ description:
+ - "This specifies a source address to use with SNAT: without
+ this, the source address is never altered."
+ required: false
+ default: null
set_dscp_mark:
version_added: "2.1"
description:
@@ -277,8 +284,8 @@ options:
icmp_type:
version_added: "2.2"
description:
- - "This allows specification of the ICMP type, which can be a numeric ICMP type,
- type/code pair, or one of the ICMP type names shown by the command
+ - "This allows specification of the ICMP type, which can be a numeric ICMP type,
+ type/code pair, or one of the ICMP type names shown by the command
'iptables -p icmp -h'"
required: false
'''
@@ -336,6 +343,7 @@ def construct_rule(params):
append_param(rule, params['match'], '-m', True)
append_param(rule, params['jump'], '-j', False)
append_param(rule, params['to_destination'], '--to-destination', False)
+ append_param(rule, params['to_source'], '--to-source', False)
append_param(rule, params['goto'], '-g', False)
append_param(rule, params['in_interface'], '-i', False)
append_param(rule, params['out_interface'], '-o', False)
@@ -401,6 +409,7 @@ def main():
chain=dict(required=True, default=None, type='str'),
protocol=dict(required=False, default=None, type='str'),
source=dict(required=False, default=None, type='str'),
+ to_source=dict(required=False, default=None, type='str'),
destination=dict(required=False, default=None, type='str'),
to_destination=dict(required=False, default=None, type='str'),
match=dict(required=False, default=[], type='list'),