On 2020-12-09 09:38, Damiano Venturin wrote:
Hello everyone,
I've this virtual machine called "nc" dedicated to Nextcloud (no other
service unrelated to Nextcloud installed) where I've got Letsencrypt
certificates generated by the PKI role (I'm not using the DNS challenge
in this case). I've built the vm from scratch with debops about 3 months
ago.
A few days ago Letsencrypt certificates were due to renewal but it
didn't happen.
I ran:
`debops service/pki -l nc`
but the certificates (already expired) did not renew.
I had to move /etc/pki/realm/<domain> and run again `debops service/pki
-l nc` to fix the issue.
Checking ansible logs I see:
TASK [cron : Generate crontab configuration file]
************************************************
ok: [nc]
These are the cron jobs:
root@nc:~# ls /etc/cron.hourly /etc/cron.daily /etc/cron.weekly
/etc/cron.monthly /etc/cron.d
/etc/cron.d:
owncloud php pki-realm-scheduler
/etc/cron.daily:
apt-compat aptitude automysqlbackup bsdmainutils cracklib-runtime
dpkg etckeeper locate logrotate man-db ntp passwd
/etc/cron.hourly:
/etc/cron.monthly:
/etc/cron.weekly:
man-db
This is the content of `pki-realm-scheduler`:
#Ansible: Process PKI system realms
@weekly root test -x "/usr/local/lib/pki/pki-realm" &&
"/usr/local/lib/pki/pki-realm" schedule
Running by hand `/usr/local/lib/pki/pki-realm schedule` doesn't produce
any output.
This is my pki.yml:
---
# NC
pki_enabled: True
pki_acme: True
pki_acme_home_create: False
pki_realms:
- name: "cloud.{{ ansible_domain }}"
acme: True
#acme_ca: "le-staging-v2"
acme_ca: "le-live-v2" #for production
and this is the part of my owncloud.yml related to pki:
---
# NC
owncloud__deploy_state: "present"
owncloud__webserver: "nginx"
owncloud__variant: "nextcloud"
owncloud__release: "18"
owncloud__deploy_path_mode: "0755"
owncloud__data_path: "/mnt/data/nextcloud"
owncloud__admin_username: "admin"
owncloud__domain: "{{ ansible_domain }}"
owncloud__fqdn: "cloud.{{ ansible_domain }}"
Clearly, I expect the same issue to happen in about 90 days.
What's your take on this?
Thanks!
The really interesting log is /etc/pki/realm/<domain>/acme/error.log. Every time I
had an issue with renewal not working, the root cause was in that log ;-)
When you fixed it, delete the log file and rerun the pki role.
--
Live long and prosper
Robin `ypid` Schneider --
https://me.ypid.de/