From da107d3f0ced9f6d05d56ad2b98ba3dbddd23fb4 Mon Sep 17 00:00:00 2001 From: rgbkrk Date: Wed, 11 Jun 2014 11:10:38 -0500 Subject: [PATCH] Error checking and reporting on interface ufw rule --- library/system/ufw | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/system/ufw b/library/system/ufw index 8496997b279..40bbb313edc 100644 --- a/library/system/ufw +++ b/library/system/ufw @@ -205,6 +205,9 @@ def main(): if len(commands) < 1: module.fail_json(msg="Not any of the command arguments %s given" % commands) + if('interface' in params and 'direction' not in params): + module.fail_json(msg="Direction must be specified when creating a rule on an interface") + # Ensure ufw is available ufw_bin = module.get_bin_path('ufw', True)