2023-02-17 12:07:48 +01:00
|
|
|
# tasks file
|
2021-02-13 14:20:18 +01:00
|
|
|
---
|
|
|
|
- name: facts | set
|
|
|
|
set_fact:
|
2023-02-17 12:07:48 +01:00
|
|
|
kernel_version: "{{ ansible_kernel | regex_search('^([0-9]+\\.[0-9]+\\.[0-9]+)') }}"
|
2021-02-13 14:20:18 +01:00
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
- ufw
|
|
|
|
- ufw-facts
|
|
|
|
|
|
|
|
# see https://askubuntu.com/a/1064533/261010, https://www.spinics.net/lists/netfilter-devel/msg55682.html
|
2023-04-06 20:15:29 +02:00
|
|
|
- include_tasks:
|
|
|
|
file: fix-dropped-ssh-sessions.yml
|
2021-02-13 14:20:18 +01:00
|
|
|
when:
|
|
|
|
- kernel_version is version('4.14', '>=')
|
|
|
|
- kernel_version is version('5', '<')
|
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
- ufw
|
|
|
|
- ufw-fix-dropped-ssh-sessions
|
|
|
|
|
2023-04-06 20:15:29 +02:00
|
|
|
- include_tasks:
|
|
|
|
file: install.yml
|
2021-02-13 14:20:18 +01:00
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
- ufw
|
|
|
|
- ufw-install
|
|
|
|
|
2023-04-06 20:15:29 +02:00
|
|
|
- include_tasks:
|
|
|
|
file: configure.yml
|
2021-02-13 14:20:18 +01:00
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
- ufw
|
|
|
|
- ufw-configure
|
|
|
|
|
|
|
|
- name: start and enable service
|
|
|
|
ufw:
|
|
|
|
state: enabled
|
|
|
|
tags:
|
|
|
|
- configuration
|
|
|
|
- ufw
|
|
|
|
- ufw-start-enable-service
|