Test Repo für Ansible Semaphore
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
861 B

---
- name: UFW Konfiguration
hosts: all
become: true
tasks:
- name: Setze Standard UFW Regel auf deny
community.general.ufw:
state: enabled
default: deny
- name: Erlaube SSH Zugriff von spezifischen IPs
community.general.ufw:
rule: allow
src: "{{ item }}"
proto: tcp
to_port: "22"
loop: "{{ ssh_ips }}"
- name: Erlaube spezifizierte TCP Ports
community.general.ufw:
rule: allow
to_port: "{{ item }}"
proto: tcp
loop: "{{ tcp_ports }}"
- name: Erlaube spezifizierte UDP Ports
community.general.ufw:
rule: allow
to_port: "{{ item }}"
proto: udp
loop: "{{ udp_ports }}"
- name: Aktiviere UFW
community.general.ufw:
state: enabled
default: deny
direction: incoming