summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn R Barker <john@johnrbarker.com>2018-05-12 16:07:54 +0100
committerGitHub <noreply@github.com>2018-05-12 16:07:54 +0100
commit7764d9ce4596fcc4fa754a46640f045e2443016d (patch)
tree137a4c1add1480a50c86a30884dc23071f24dcb3
parent6a46e3a44b41c2b8c4b74de5af42c1451f135f5b (diff)
downloadansible-7764d9ce4596fcc4fa754a46640f045e2443016d.tar.gz
"route" has to be the first option in ufw command (#31756) (#40019)
* "route" has to be the first option in ufw command (#31756) For supporting deletion of ufw routes, route option has to be placed before delete option (cherry picked from commit 21004d86f9486684005672a19e90a3bd13b8ad5a) * Changelog
-rw-r--r--changelogs/fragments/ufw-route-first-option.yaml2
-rw-r--r--lib/ansible/modules/system/ufw.py4
2 files changed, 4 insertions, 2 deletions
diff --git a/changelogs/fragments/ufw-route-first-option.yaml b/changelogs/fragments/ufw-route-first-option.yaml
new file mode 100644
index 0000000000..11f67862f2
--- /dev/null
+++ b/changelogs/fragments/ufw-route-first-option.yaml
@@ -0,0 +1,2 @@
+bugfixes:
+- Fix ufw module, "route" has to be the first option in ufw command https://github.com/ansible/ansible/pull/31756
diff --git a/lib/ansible/modules/system/ufw.py b/lib/ansible/modules/system/ufw.py
index 7b8eb75c71..a887b37514 100644
--- a/lib/ansible/modules/system/ufw.py
+++ b/lib/ansible/modules/system/ufw.py
@@ -314,11 +314,11 @@ def main():
elif command == 'rule':
# Rules are constructed according to the long format
#
- # ufw [--dry-run] [delete] [insert NUM] [route] allow|deny|reject|limit [in|out on INTERFACE] [log|log-all] \
+ # ufw [--dry-run] [route] [delete] [insert NUM] allow|deny|reject|limit [in|out on INTERFACE] [log|log-all] \
# [from ADDRESS [port PORT]] [to ADDRESS [port PORT]] \
# [proto protocol] [app application] [comment COMMENT]
- cmd.append([module.boolean(params['delete']), 'delete'])
cmd.append([module.boolean(params['route']), 'route'])
+ cmd.append([module.boolean(params['delete']), 'delete'])
cmd.append([params['insert'], "insert %s" % params['insert']])
cmd.append([value])
cmd.append([params['direction'], "%s" % params['direction']])