mirror of
https://github.com/KevinMidboe/playbooks-retailor.git
synced 2026-02-13 12:59:23 +00:00
ansible playbooks for retailor.io infrastructure
This commit is contained in:
23
roles/firewall/tasks/main.yml
Normal file
23
roles/firewall/tasks/main.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
---
|
||||
- name: Update apt cache if older than 1 hour
|
||||
apt:
|
||||
update_cache: yes
|
||||
cache_valid_time: 3600
|
||||
|
||||
- name: Add ufw
|
||||
apt: pkg=ufw state=latest
|
||||
|
||||
- name: Enable access via ssh
|
||||
ufw:
|
||||
rule: allow
|
||||
port: "22"
|
||||
|
||||
- name: Enable custom firewall ports
|
||||
ufw:
|
||||
rule: allow
|
||||
port: "{{ item }}"
|
||||
loop: "{{ custom_firewall_ports | default([]) }}"
|
||||
|
||||
- name: Start ufw
|
||||
ufw:
|
||||
state: enabled
|
||||
Reference in New Issue
Block a user