mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-09-03 08:56:01 +02:00
Merged client playbook and server playbook
This commit is contained in:
12
roles/server_native-certbot-nginx/handlers/main.yml
Normal file
12
roles/server_native-certbot-nginx/handlers/main.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
- name: "reload certbot service"
|
||||
systemd:
|
||||
name: certbot.service
|
||||
state: reloaded
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
||||
- name: "restart certbot timer"
|
||||
systemd:
|
||||
name: certbot.timer
|
||||
state: restarted
|
||||
enabled: yes
|
||||
daemon_reload: yes
|
3
roles/server_native-certbot-nginx/meta/main.yml
Normal file
3
roles/server_native-certbot-nginx/meta/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
dependencies:
|
||||
- native-nginx
|
||||
- native-systemd-email
|
16
roles/server_native-certbot-nginx/tasks/main.yml
Normal file
16
roles/server_native-certbot-nginx/tasks/main.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
- name: install certbot
|
||||
pacman:
|
||||
name: [certbot,certbot-nginx]
|
||||
state: present
|
||||
|
||||
- name: configure certbot.service.tpl
|
||||
template:
|
||||
src: certbot.service.j2
|
||||
dest: /etc/systemd/system/certbot.service
|
||||
notify: reload certbot service
|
||||
|
||||
- name: configure certbot.timer.tpl
|
||||
template:
|
||||
src: certbot.timer.j2
|
||||
dest: /etc/systemd/system/certbot.timer
|
||||
notify: restart certbot timer
|
@@ -0,0 +1,8 @@
|
||||
[Unit]
|
||||
Description=Let's Encrypt renewal
|
||||
OnFailure=systemd-email@%n.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/bin/certbot renew --quiet --agree-tos
|
||||
ExecStartPost=/bin/systemctl reload nginx.service
|
10
roles/server_native-certbot-nginx/templates/certbot.timer.j2
Normal file
10
roles/server_native-certbot-nginx/templates/certbot.timer.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=Renewal of Let's Encrypt's certificates
|
||||
|
||||
[Timer]
|
||||
OnCalendar=0/12:00:00
|
||||
RandomizedDelaySec={{randomized_delay_sec}}
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Reference in New Issue
Block a user