From 3e31eaf4196dd0cd0acd5132e06027f7fd804814 Mon Sep 17 00:00:00 2001 From: ovcharenko Date: Tue, 23 Aug 2016 11:14:22 +0300 Subject: [PATCH] ufw fails asking for a direction for rules without an interface specified [#2758] (#2759) --- lib/ansible/modules/extras/system/ufw.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/modules/extras/system/ufw.py b/lib/ansible/modules/extras/system/ufw.py index e88c145697..c692211d12 100644 --- a/lib/ansible/modules/extras/system/ufw.py +++ b/lib/ansible/modules/extras/system/ufw.py @@ -228,7 +228,7 @@ def main(): if len(commands) < 1: module.fail_json(msg="Not any of the command arguments %s given" % commands) - if('interface' in params and params['direction'] is None): + if(params['interface'] is not None and params['direction'] is None): module.fail_json(msg="Direction must be specified when creating a rule on an interface") # Ensure ufw is available