feat: initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
---
|
||||
- name: Configurer UFW sur Ubuntu
|
||||
hosts: ubuntu
|
||||
become: yes
|
||||
tasks:
|
||||
- name: Installer UFW
|
||||
ansible.builtin.apt:
|
||||
name: ufw
|
||||
state: present
|
||||
|
||||
- name: Autoriser SSH
|
||||
community.general.ufw:
|
||||
rule: allow
|
||||
port: '22'
|
||||
proto: tcp
|
||||
|
||||
- name: Autoriser MySQL seulement depuis le réseau privé des VMs
|
||||
community.general.ufw:
|
||||
rule: allow
|
||||
from_ip: "{{ mysql_network_cidr }}"
|
||||
to_port: "{{ mysql_port }}"
|
||||
proto: tcp
|
||||
|
||||
- name: Activer UFW avec refus entrant par défaut
|
||||
community.general.ufw:
|
||||
state: enabled
|
||||
policy: deny
|
||||
direction: incoming
|
||||
Reference in New Issue
Block a user