From de14ee24760509e391baf5fa244b343e558f3d8c Mon Sep 17 00:00:00 2001 From: Nikolaos Kakouros Date: Wed, 6 Sep 2017 22:57:59 +0200 Subject: [PATCH] Checks if domain names are given --- defaults/main.yml | 3 +-- tasks/generate-certs.yml | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 7a71d80..fefbe1d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -29,8 +29,7 @@ certbot_register_email: '' certbot_register_command: "{{ certbot_script }} register --non-interactive --agree-tos --email {{ certbot_register_email }}" # The domains to generate certs for -certbot_domains: -- 'example.com' +certbot_domains: [] # The command to run to generate the certificates certbot_cert_command: "{{ certbot_script }} certonly --noninteractive --standalone" diff --git a/tasks/generate-certs.yml b/tasks/generate-certs.yml index ee6c913..5f3e797 100644 --- a/tasks/generate-certs.yml +++ b/tasks/generate-certs.yml @@ -6,6 +6,12 @@ - "certbot_register_email != ''" msg: "You need to provide an email address you own to register with Let's Encrypt." +- name: Make sure we have domains + assert: + that: + - "certbot_domains != []" + msg: "You need to provide at least one domain to generate certificates for." + - name: Register with Let's Encrypt command: "{{ certbot_register_command }}" args: