Add certbot renewal and nftables role
This commit is contained in:
parent
fd1f692b88
commit
fb864fb54d
6 changed files with 40 additions and 3 deletions
1
roles/certbot/files/http-certbot.conf
Normal file
1
roles/certbot/files/http-certbot.conf
Normal file
|
@ -0,0 +1 @@
|
|||
tcp dport http accept comment "Allow http to all for certbot renewal"
|
2
roles/certbot/meta/main.yml
Normal file
2
roles/certbot/meta/main.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
dependencies:
|
||||
- role: install-nftables
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
14
roles/install-nftables/tasks/main.yml
Normal file
14
roles/install-nftables/tasks/main.yml
Normal 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
|
Loading…
Reference in a new issue