Ansible role for Certbot (for Let's Encrypt)
Go to file
Jakub Sokołowski 17986a8090
create: ignore stop/start errors
Service might not yet exist.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2024-03-18 18:37:10 +01:00
defaults service: set explicit certificate name 2024-03-15 14:20:13 +01:00
meta meta: use full names of Ansible roles 2024-03-15 14:14:09 +01:00
tasks create: ignore stop/start errors 2024-03-18 18:37:10 +01:00
templates allow specifying container user UID, provide paths 2023-01-17 16:25:39 +01:00
.gitignore Make ansible-lint work again. 2021-02-22 16:12:59 -06:00
LICENSE Add a LICENSE file for MIT license. [ci skip] 2017-03-31 11:23:15 -05:00
README.md refactor to drop non-ubuntu OSes, use systemd timer 2021-05-13 13:14:58 +02:00

README.md

Description

Installs and configures Certbot (for Let's Encrypt).

Requirements

If installing from source, Git is required. You can install Git using the geerlingguy.git role.

Generally, installing from source (see section Source Installation from Git) leads to a better experience using Certbot and Let's Encrypt, especially if you're using an older OS release.

Configuration

Controls how Certbot is installed. Available options are 'package', 'snap', and 'source'.

certbot_admin_email: 'admin@example.org'
certbot_auto_renew: true
certbot_auto_renew_user: 'www-data'
certbot_auto_renew_frequency: 'daily'
certbot_auto_renew_options: "--quiet --no-self-upgrade"
certbot_certs:
  - domains: 'something.example.org'

The email address used to agree to Let's Encrypt's TOS and subscribe to cert-related notifications. This should be customized and set to an email address that you or your organization regularly monitors.

By default, this role configures a systemd timer to run under the provided user every day. The defaults run certbot renew (or certbot-auto renew). The account used should be a non-root account.

Standalone Certificate Generation

Services that should be stopped while certbot runs it's own standalone server on ports 80 and 443. Other valid values might be apache2, or any other serivce that might use these ports.

certbot_create_standalone_stop_services:
  - nginx

These services will only be stopped the first time a new cert is generated.

Certbot certificate auto-renewal

You can test the auto-renewal (without actually renewing the cert) with the command:

/opt/certbot/certbot renew --dry-run

See full documentation and options on the Certbot website.

License

MIT / BSD

Author Information

This role was created in 2016 by Jeff Geerling, author of Ansible for DevOps.