From 8749894ebc761cbc6329d20703c1ae90500bb5ee Mon Sep 17 00:00:00 2001 From: mwellmeyer Date: Thu, 14 Sep 2017 18:12:26 +0200 Subject: [PATCH] add possibility for log messages via log_prefix (#30358) --- lib/ansible/modules/system/iptables.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/modules/system/iptables.py b/lib/ansible/modules/system/iptables.py index e17d99ede1..eaf6b54654 100644 --- a/lib/ansible/modules/system/iptables.py +++ b/lib/ansible/modules/system/iptables.py @@ -121,6 +121,10 @@ options: below). If this option is omitted in a rule (and the goto parameter is not used), then matching the rule will have no effect on the packet's fate, but the counters on the rule will be incremented. + log_prefix: + description: + - Specifies a log text for the rule. Only make sense with a LOG jump. + version_added: "2.5" goto: description: - This specifies that the processing should continue in a user specified @@ -377,6 +381,7 @@ def construct_rule(params): append_param(rule, params['match'], '-m', True) append_tcp_flags(rule, params['tcp_flags'], '--tcp-flags') append_param(rule, params['jump'], '-j', False) + append_param(rule, params['log_prefix'], '--log-prefix', 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) @@ -486,6 +491,7 @@ def main(): match=dict(type='list', default=[]), tcp_flags=dict(type='dict', default={}), jump=dict(type='str'), + log_prefix=dict(type='str'), goto=dict(type='str'), in_interface=dict(type='str'), out_interface=dict(type='str'),