From 5ef3c252dffc6d178bc1117d4a4cfcece624dbb1 Mon Sep 17 00:00:00 2001 From: Nikolaos Kakouros Date: Wed, 6 Sep 2017 22:15:15 +0200 Subject: [PATCH] Checks if email is given --- defaults/main.yml | 4 +++- tasks/generate-certs.yml | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 55d2072..7a71d80 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -21,7 +21,9 @@ certbot_dir: /opt/certbot # Set to true to have this role register and generate certificates for your # domains. certbot_handle_certs: true -certbot_register_email: user@example.com + +# The email to register with (required). +certbot_register_email: '' # The command to run to register with Let's Encrypt certbot_register_command: "{{ certbot_script }} register --non-interactive --agree-tos --email {{ certbot_register_email }}" diff --git a/tasks/generate-certs.yml b/tasks/generate-certs.yml index 78633c7..ff3a236 100644 --- a/tasks/generate-certs.yml +++ b/tasks/generate-certs.yml @@ -1,5 +1,11 @@ --- +- name: Make sure we have an email + assert: + that: + - "certbot_register_email is defined" + msg: "You need to provide an email address you own to register with Let's Encrypt." + - name: Register with Let's Encrypt command: "{{ certbot_register_command }}"