33 lines
613 B
YAML
33 lines
613 B
YAML
|
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
||
|
#
|
||
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||
|
|
||
|
---
|
||
|
- name: Install ufw
|
||
|
become: true
|
||
|
ansible.builtin.apt:
|
||
|
update_cache: true
|
||
|
cache_valid_time: 3600
|
||
|
pkg:
|
||
|
- ufw
|
||
|
|
||
|
- name: Set logging
|
||
|
become: true
|
||
|
community.general.ufw:
|
||
|
logging: "on"
|
||
|
|
||
|
- name: Allow port 22 and enable UFW
|
||
|
become: true
|
||
|
community.general.ufw:
|
||
|
state: enabled
|
||
|
rule: allow
|
||
|
proto: tcp
|
||
|
port: "22"
|
||
|
|
||
|
- name: Enable and start ufw service
|
||
|
become: true
|
||
|
ansible.builtin.service:
|
||
|
name: ufw
|
||
|
enabled: true
|
||
|
state: started
|