|
|
@ -400,6 +400,8 @@ def main():
|
|
|
|
execute(cmd + [[command], [value]])
|
|
|
|
execute(cmd + [[command], [value]])
|
|
|
|
|
|
|
|
|
|
|
|
elif command == 'default':
|
|
|
|
elif command == 'default':
|
|
|
|
|
|
|
|
if params['direction'] not in ['outgoing', 'incoming', 'routed']:
|
|
|
|
|
|
|
|
module.fail_json(msg='For default, direction must be one of "outgoing", "incoming" and "routed".')
|
|
|
|
if module.check_mode:
|
|
|
|
if module.check_mode:
|
|
|
|
regexp = r'Default: (deny|allow|reject) \(incoming\), (deny|allow|reject) \(outgoing\), (deny|allow|reject|disabled) \(routed\)'
|
|
|
|
regexp = r'Default: (deny|allow|reject) \(incoming\), (deny|allow|reject) \(outgoing\), (deny|allow|reject|disabled) \(routed\)'
|
|
|
|
extract = re.search(regexp, pre_state)
|
|
|
|
extract = re.search(regexp, pre_state)
|
|
|
@ -416,6 +418,8 @@ def main():
|
|
|
|
execute(cmd + [[command], [value], [params['direction']]])
|
|
|
|
execute(cmd + [[command], [value], [params['direction']]])
|
|
|
|
|
|
|
|
|
|
|
|
elif command == 'rule':
|
|
|
|
elif command == 'rule':
|
|
|
|
|
|
|
|
if params['direction'] not in ['in', 'out', None]:
|
|
|
|
|
|
|
|
module.fail_json(msg='For rules, direction must be one of "in" and "out".')
|
|
|
|
# Rules are constructed according to the long format
|
|
|
|
# Rules are constructed according to the long format
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# ufw [--dry-run] [route] [delete] [insert NUM] 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] \
|
|
|
|