From cb88569fe1022bdd1c2bb48dcc6b0d42f5d98b7a Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Wed, 23 Aug 2023 12:33:12 +0300 Subject: [PATCH] Add variables for certs --- defaults/main.yml | 2 ++ tasks/configure_prometheus_exporters_certificates.yml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 711a2b1..5407b58 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,5 @@ --- # Default values for variables of the role # variable_name: value +letsencrypt_account_email: certs@example.org +domain: example.org diff --git a/tasks/configure_prometheus_exporters_certificates.yml b/tasks/configure_prometheus_exporters_certificates.yml index 5061056..2f9a724 100644 --- a/tasks/configure_prometheus_exporters_certificates.yml +++ b/tasks/configure_prometheus_exporters_certificates.yml @@ -23,11 +23,11 @@ state: stopped - name: Request certificate for node-metrics - shell: "certbot certonly --agree-tos --email certs@susurrando.com --standalone -n -d node-metrics-{{ inventory_hostname }}" + shell: "certbot certonly --agree-tos --email {{ letsencrypt_account_email }} --standalone -n -d node-metrics-{{ inventory_hostname }}.{{ domain }}" args: creates: "/etc/letsencrypt/live/node-metrics-{{ inventory_hostname }}/fullchain.pem" - name: Request certificate for postfix-metrics - shell: "certbot certonly --agree-tos --email certs@susurrando.com --standalone --agree-tos --email gestor@susurrando.com -n -d postfix-metrics-{{ inventory_hostname }}" + shell: "certbot certonly --agree-tos --email {{ letsencrypt_account_email }} --standalone -n -d postfix-metrics-{{ inventory_hostname }}.{{ domain }}" args: creates: "/etc/letsencrypt/live/postfix-metrics-{{ inventory_hostname }}/fullchain.pem"