From 01d801c4b71cb6e345e89622b142049da40b1017 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 4 Apr 2017 21:42:16 -0500 Subject: [PATCH] PR #19 follow-up: Docs fixes and reordering defaults. --- README.md | 16 +++++++--------- defaults/main.yml | 17 +++++++++-------- handlers/main.yml | 2 -- 3 files changed, 16 insertions(+), 19 deletions(-) delete mode 100644 handlers/main.yml diff --git a/README.md b/README.md index e05050e..482c55b 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Installs and configures Certbot (for Let's Encrypt). ## Requirements -If one wants to install Certbot from upstream Git repository instead of distribution's package management, this role requires Git to be installed. You can install Git using the `geerlingguy.git` role. +If installing from source, Git is required. You can install Git using the `geerlingguy.git` role. ## Role Variables @@ -19,18 +19,16 @@ The variable `certbot_install_from_source` controls whether to install Certbot f 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. -### Variables Relavant for Source Installation from Git +### Source Installation from Git -Instead of installing Certbot from distribution's package management, installing from Git repository is also an option. This might be useful in several cases, but especially when older LTS distributions don't ship Certbot yet. These include CentOS < 7, Ubuntu < 16.10 and Debian < 8. Debian 8 includes Certbot package when packports repository is enabled. +You can install Certbot from it's Git source repository if desired. This might be useful in several cases, but especially when older distributions don't have Certbot packages available (e.g. CentOS < 7, Ubuntu < 16.10 and Debian < 8). -In case source installation from Git is intended, the following variables are relevant: - - certbot_install_from_source: yes + certbot_install_from_source: no certbot_repo: https://github.com/certbot/certbot.git certbot_version: master certbot_keep_updated: yes -Certbot Git repository options. This clones the configured `certbot_repo`, respecting the `certbot_version` setting. If `certbot_keep_updated` is set to `yes`, the repository is updated every time this role runs. +Certbot Git repository options. To install from source, set `certbot_install_from_source` to `yes`. This clones the configured `certbot_repo`, respecting the `certbot_version` setting. If `certbot_keep_updated` is set to `yes`, the repository is updated every time this role runs. certbot_dir: /opt/certbot @@ -43,12 +41,12 @@ None. ## Example Playbook - hosts: servers - + vars: certbot_auto_renew_user: your_username_here certbot_auto_renew_minute: 20 certbot_auto_renew_hour: 5 - + roles: - geerlingguy.certbot diff --git a/defaults/main.yml b/defaults/main.yml index cf4bb2b..7f6f0d3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,15 +1,16 @@ --- -# Where to get Certbot. +# Certbot auto-renew cron job configuration (for certificate renewals). +certbot_auto_renew: true +certbot_auto_renew_user: "{{ ansible_user }}" +certbot_auto_renew_hour: 3 +certbot_auto_renew_minute: 30 + +# 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. certbot_install_from_source: no certbot_repo: https://github.com/certbot/certbot.git certbot_version: master certbot_keep_updated: yes -# Where to put Certbot when cloning from Git. +# Where to put Certbot when installing from source. certbot_dir: /opt/certbot - -# How to keep Certbot certs up to date. -certbot_auto_renew: true -certbot_auto_renew_user: "{{ ansible_user }}" -certbot_auto_renew_hour: 3 -certbot_auto_renew_minute: 30 diff --git a/handlers/main.yml b/handlers/main.yml deleted file mode 100644 index 9fa4d47..0000000 --- a/handlers/main.yml +++ /dev/null @@ -1,2 +0,0 @@ ---- -# TODO