From 71152fe652b9f0b6a079daff7bf2de9b88be2757 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 27 Oct 2025 23:27:30 +0100 Subject: [PATCH] ocserv: dehardcode site name in cert expiry message --- roles/ocserv/tasks/main.yml | 6 +++--- .../notify-expiring-certs.j2} | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) rename roles/ocserv/{files/notify-expiring-certs => templates/notify-expiring-certs.j2} (76%) diff --git a/roles/ocserv/tasks/main.yml b/roles/ocserv/tasks/main.yml index 84bf8a8..11bbb59 100644 --- a/roles/ocserv/tasks/main.yml +++ b/roles/ocserv/tasks/main.yml @@ -93,9 +93,9 @@ sysctl_set: true - name: Install user certificate expiry notification script - copy: - dest: /usr/local/bin/ - src: notify-expiring-certs + template: + dest: /usr/local/bin/notify-expiring-certs + src: notify-expiring-certs.j2 mode: "0755" - name: Schedule user certificate expiry notification script diff --git a/roles/ocserv/files/notify-expiring-certs b/roles/ocserv/templates/notify-expiring-certs.j2 similarity index 76% rename from roles/ocserv/files/notify-expiring-certs rename to roles/ocserv/templates/notify-expiring-certs.j2 index 2b8f4f3..6030e49 100644 --- a/roles/ocserv/files/notify-expiring-certs +++ b/roles/ocserv/templates/notify-expiring-certs.j2 @@ -24,11 +24,11 @@ for cert in /var/lib/ocserv/certs/*.crt ; do To: ${email} Bcc: root Date: $(date -R) -Subject: Potek certifikata za FRI VPN +Subject: Potek certifikata za {{ dns_name }} Spoštovani, -čez ${validity} dni bo potekel FRI VPN certifikat za ${email}. Če dostop še potrebujete, kontaktirajte RC FRI za podaljšanje. +čez ${validity} dni bo potekel certifikat ${email} za dostop do {{ dns_name }}. Če dostop še potrebujete, kontaktirajte RC FRI za podaljšanje. Lep pozdrav, RC FRI @@ -37,7 +37,7 @@ RC FRI Hello, -in ${validity} days the FRI VPN certificate for ${email} will expire. If you still need access, contact RC FRI for renewal. +in ${validity} days the certificate ${email} to access {{ dns_name }} will expire. If you still need access, contact RC FRI for renewal. Best regards, RC FRI