Add components to help keep certs up to date.

This commit is contained in:
Hyperling 2021-04-07 20:32:12 -05:00
parent 79916fb743
commit 81f11b72de
8 changed files with 31 additions and 5 deletions

10
hosts
View File

@ -50,6 +50,14 @@ x570 amdgpu=true nanominer=true nanominer_gpu=eth nanominer_gpus=0 nanominer_gpu
; influxdb2 : Set to anything for this server to be configured as an Influx 2 DB + web server.
; Example: true
;
; certbot : Set to anything to add cron job for `certbot renew`
; Example: true
;
onlyoffice domain=hyperling.com onlyoffice=true
grafana domain=hyperling.com grafana=true influxdb1=true
test
test
hyperling certbot=true
hyperling.com certbot=true
tmcvideos certbot=true
tmcvideos.com certbot=true
reverse-proxy certbot=true

View File

@ -123,18 +123,21 @@
become: true
tasks:
- include: tasks/server/onlyoffice.yml
- include: tasks/server/software/onlyoffice.yml
when: onlyoffice is defined and ansible_pkg_mgr == "apt"
- include: tasks/server/influxdb1.yml
- include: tasks/server/software/influxdb1.yml
when: influxdb1 is defined and ansible_pkg_mgr == "apt"
- include: tasks/server/influxdb2.yml
- include: tasks/server/software/influxdb2.yml
when: influxdb2 is defined and ansible_pkg_mgr == "apt"
- include: tasks/server/grafana.yml
- include: tasks/server/software/grafana.yml
when: grafana is defined and ansible_pkg_mgr == "apt"
post_tasks:
- include: tasks/server/cron/certbot.yml
when: certbot is defined
# Provide information for analysis.

View File

@ -0,0 +1,15 @@
---
# Ensure certbot renews certs on time.
- name: Server | Cron | Certbot | Find Executable
shell: which certbot
register: certbot
- name: Server | Cron | Certbot | Monthly Renewal
cron:
user: root
name: Monthly Renewal
job: "{{ certbot.stdout }} renew && reboot"
special_time: monthly
state: present
disabled: no