Add certbot renewal and nftables role

This commit is contained in:
flyingscorpio@clevo 2022-03-13 11:46:24 +01:00
parent fd1f692b88
commit fb864fb54d
6 changed files with 40 additions and 3 deletions

View file

@ -0,0 +1 @@
tcp dport http accept comment "Allow http to all for certbot renewal"

View file

@ -0,0 +1,2 @@
dependencies:
- role: install-nftables

View file

@ -25,3 +25,10 @@
register: result
changed_when: "'already enabled' not in result.stdout"
notify: Reload apache2 service
- name: Allow certbot renewal
become: true
copy:
src: http-certbot.conf
dest: /etc/nftables/input.d/http-certbot.conf
notify: Reload nftables service

View file

@ -1,9 +1,9 @@
---
- name: Restart apache2 service
- name: Start apache2 service
become: true
systemd:
name: apache2
state: restarted
state: started
enabled: true
- name: Reload apache2 service
@ -18,3 +18,16 @@
name: mariadb
state: started
enabled: true
- name: Start nftables service
become: true
systemd:
name: nftables
state: restarted
enabled: true
- name: Reload nftables service
become: true
systemd:
name: nftables
state: reloaded

View file

@ -5,7 +5,7 @@
name: apache2
state: present
update_cache: yes
notify: Restart apache2 service
notify: Start apache2 service
- name: Remove default html dir
become: true

View file

@ -0,0 +1,14 @@
---
- name: Install nftables
become: true
apt:
name: nftables
state: present
update_cache: yes
notify: Start nftables service
- name: Enable nftables
become: true
systemd:
name: nftables
enabled: true