Skip to content

Commit

Permalink
Add direction to the default policy
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinkortman committed Mar 5, 2019
1 parent a4f4f57 commit 48e82cb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ Role Variables

Set the default policy:

ufw_default_policy: deny
ufw_default_policy:
- { direction: "incoming", policy: "deny" }


Add or remove rules:

Expand Down
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
ufw_rules_to_create: []
ufw_rules_to_delete: []

ufw_default_policy: deny
ufw_default_policy:
- { direction: "incoming", policy: "deny" }

4 changes: 3 additions & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

- name: set default policy
ufw:
policy: "{{ ufw_default_policy }}"
policy: "{{ item.policy }}"
direction: "{{ item.direction }}"
with_items: "{{ ufw_default_policy }}"

- name: enable and start ufw
ufw:
Expand Down

0 comments on commit 48e82cb

Please sign in to comment.