From 4d5340587e0e6ad8a020bbca6515484ad993df4c Mon Sep 17 00:00:00 2001 From: Jarno Keskikangas Date: Sat, 8 Mar 2014 14:01:26 +0200 Subject: [PATCH] Insert rule to a specific num. --- library/system/ufw | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/system/ufw b/library/system/ufw index b1386ff602..e343f93428 100644 --- a/library/system/ufw +++ b/library/system/ufw @@ -57,6 +57,10 @@ options: - Toggles logging. Logged packets use the LOG_KERN syslog facility. choices: ['on', 'off', 'low', 'medium', 'high', 'full'] required: false + insert: + description: + - Insert the corresponding rule as rule number NUM + required: false rule: description: - Add firewall rule @@ -162,6 +166,7 @@ def main(): logging = dict(default=None, choises=['on', 'off', 'low', 'medium', 'high', 'full']), direction = dict(default=None, choises=['in', 'incoming', 'out', 'outgoing']), delete = dict(default=False, choices=BOOLEANS), + insert = dict(default=None), rule = dict(default=None, choices=['allow', 'deny', 'reject', 'limit']), interface = dict(default=None, aliases=['if']), log = dict(default=False, choices=BOOLEANS), @@ -223,6 +228,7 @@ def main(): # [from ADDRESS [port PORT]] [to ADDRESS [port PORT]] \ # [proto protocol] [app application] cmd.append([module.boolean(params['delete']), 'delete']) + cmd.append([params['insert'], "insert %s" % params['insert']]) cmd.append([value]) cmd.append([module.boolean(params['log']), 'log'])