From 61ba4b98e111b8f97d58ee5acd33cb5e2234353e Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 3 Nov 2015 12:12:39 -0500 Subject: [PATCH] made ctstate default to [] and evaluation conditional on the list being popoulated --- lib/ansible/modules/extras/system/iptables.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/system/iptables.py b/lib/ansible/modules/extras/system/iptables.py index e78295cc29..8c2a67eb63 100644 --- a/lib/ansible/modules/extras/system/iptables.py +++ b/lib/ansible/modules/extras/system/iptables.py @@ -262,8 +262,9 @@ def construct_rule(params): append_param(rule, params['to_ports'], '--to-ports', False) append_comm(rule, params['comment']) append_param(rule, params['comment'], '--comment', False) - append_conntrack(rule, params['ctstate']) - append_param(rule, ','.join(params['ctstate']), '--ctstate', False) + if params['ctstate']: + append_conntrack(rule, params['ctstate']) + append_param(rule, ','.join(params['ctstate']), '--ctstate', False) return rule