Updated
This commit is contained in:
1 parent
1c6c25f442
commit
63d79f7f76
12 files changed
+687
-67
No files matched your search
Executable
+38
@@ -0,0 +1,38 @@
|
||||
---
|
||||
# open-all-ports.yml
|
||||
#
|
||||
# Opens all inbound ports on the target Ubuntu servers.
|
||||
#
|
||||
# Default behavior: UFW stays enabled but its default incoming
|
||||
# policy is set to allow, so every port is reachable.
|
||||
#
|
||||
# To turn the firewall OFF entirely instead, run with:
|
||||
# ansible-playbook -i inventory.ini open-all-ports.yml -e "disable_ufw=true"
|
||||
#
|
||||
# Uses the community.general.ufw module.
|
||||
#
|
||||
# Usage:
|
||||
# ansible-playbook -i inventory.ini open-all-ports.yml
|
||||
|
||||
- name: Open all inbound ports
|
||||
hosts: ubuntu_servers
|
||||
become: true
|
||||
|
||||
vars:
|
||||
disable_ufw: false
|
||||
|
||||
tasks:
|
||||
- name: Set default incoming policy to allow (opens all ports)
|
||||
community.general.ufw:
|
||||
direction: incoming
|
||||
policy: allow
|
||||
|
||||
- name: Set default outgoing policy to allow
|
||||
community.general.ufw:
|
||||
direction: outgoing
|
||||
policy: allow
|
||||
|
||||
- name: Optionally disable UFW entirely
|
||||
community.general.ufw:
|
||||
state: disabled
|
||||
when: disable_ufw | bool
|
||||
Reference in new issue
Block a user