From 574c0843c8620f299ff67acbf35c9a6aa45121d0 Mon Sep 17 00:00:00 2001
From: Jeff Geerling <geerlingguy@mac.com>
Date: Tue, 31 Oct 2017 10:09:41 -0500
Subject: [PATCH] Fixes #37: Make renew command configurable.

---
 README.md            | 1 +
 defaults/main.yml    | 1 +
 tasks/renew-cron.yml | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 5c04cf7..5bce80b 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@ The variable `certbot_install_from_source` controls whether to install Certbot f
     certbot_auto_renew_user: "{{ ansible_user }}"
     certbot_auto_renew_hour: 3
     certbot_auto_renew_minute: 30
+    certbot_auto_renew_options: "--quiet --no-self-upgrade"
 
 By default, this role configures a cron job to run under the provided user account at the given hour and minute, every day. The defaults run `certbot renew` (or `certbot-auto renew`) via cron every day at 03:30:00 by the user you use in your Ansible playbook. It's preferred that you set a custom user/hour/minute so the renewal is during a low-traffic period and done by a non-root user account.
 
diff --git a/defaults/main.yml b/defaults/main.yml
index 7f6f0d3..395b47d 100644
--- a/defaults/main.yml
+++ b/defaults/main.yml
@@ -4,6 +4,7 @@ certbot_auto_renew: true
 certbot_auto_renew_user: "{{ ansible_user }}"
 certbot_auto_renew_hour: 3
 certbot_auto_renew_minute: 30
+certbot_auto_renew_options: "--quiet --no-self-upgrade"
 
 # To install from source (on older OSes or if you need a specific or newer
 # version of Certbot), set this variable to `yes` and configure other options.
diff --git a/tasks/renew-cron.yml b/tasks/renew-cron.yml
index 7678a7c..394a30e 100644
--- a/tasks/renew-cron.yml
+++ b/tasks/renew-cron.yml
@@ -2,7 +2,7 @@
 - name: Add cron job for certbot renewal (if configured).
   cron:
     name: Certbot automatic renewal.
-    job: "{{ certbot_script }} renew --quiet --no-self-upgrade"
+    job: "{{ certbot_script }} renew {{ certbot_auto_renew_options }}"
     minute: "{{ certbot_auto_renew_minute }}"
     hour: "{{ certbot_auto_renew_hour }}"
     user: "{{ certbot_auto_renew_user }}"
-- 
GitLab