Skip to content

Commit 83d9710

Browse files
committed
[FEATURE] #38: Use dehydrated instead of acme-tiny
1 parent 39b55eb commit 83d9710

File tree

6 files changed

+251
-180
lines changed

6 files changed

+251
-180
lines changed

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
# Let’s encrypt/acme-tiny role for Ansible
22

3-
Installs and configures [acme-tiny](https://github.com/diafygi/acme-tiny), a small Python-based client for
3+
Installs and configures [dehydrated](https://github.com/lukas2511/dehydrated), a small Shell-based client for
44
[Let’s encrypt](https://letsencrypt.org).
55

6-
It automates the following tasks:
7-
8-
* creating an account key for Let’s encrypt
9-
* creating private keys and Certificate Signature Requests (CSR) for hosts
10-
* configuring a cron job that automatically renews the certificates after 60 days
6+
This role historically used acme-tiny, a Python-based implementation of the ACME protocol. As this client was too
7+
limited in functionality, we switched over to dehydrated in april 2017.
118

129
During each role run, the certificate renewal script is also executed (as with the cron job), to ensure you get new
1310
certificates as soon as you have configured them.
1411

12+
**IMPORTANT:** This package is currently in the transition from acme-tiny to dehydrated. Use with caution and always
13+
manually verify if everything worked ok!
14+
1515

1616
## Requirements
1717

1818
For every hostname you want to support, you need to have a webserver configured and add an alias that points to the
19-
directory configured with `acme_tiny_challenges_directory`. For Apache, such an alias should look like this:
19+
directory configured with `dehydrated_challenges_directory`. For Apache, such an alias should look like this:
2020

21-
Alias "/.well-known/acme-challenge" "{{ acme_tiny_challenges_directory }}"
21+
Alias "/.well-known/acme-challenge" "{{ dehydrated_challenges_directory }}"
2222

2323
Hint: You can also put this into a global variable and then use this variable in the definition of every vHost.
2424

@@ -42,9 +42,9 @@ When you use Letencrypt on multiple servers, it may be simpler to have only one
4242

4343
You might want to adjust these variables that control where the software and data are located:
4444

45-
* `acme_tiny_software_directory`: The location to which acme-tiny is cloned
46-
* `acme_tiny_data_directory`: The location where the account key and certificate signature requests (CSR) are placed
47-
* `acme_tiny_challenges_directory`: The (web-reachable) directory that contains the temporary challenges used for
45+
* `dehydrated_software_directory`: The location to which dehydrated is cloned
46+
* `dehydrated_base_directory`: The location where the configuration, account key(s) and the certificate list (domains.txt) are placed
47+
* `dehydrated_challenges_directory`: The (web-reachable) directory that contains the temporary challenges used for
4848
verifying your domain ownership
4949
* `letsencrypt_intermediate_cert_path`: the path to which the intermediate certificate of Let’s encrypt will be
5050
downloaded.

defaults/main.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
---
22

3-
acme_tiny_repo: 'https://github.com/diafygi/acme-tiny.git'
4-
acme_tiny_commit: '7a5a2558c8d6e5ab2a59b9fec9633d9e63127971'
5-
3+
# leaving these variables in to enable removal of the software
64
acme_tiny_software_directory: '/usr/local/letsencrypt'
75
acme_tiny_data_directory: '/var/lib/letsencrypt'
8-
acme_tiny_challenges_directory: '/var/www/letsencrypt'
6+
7+
dehydrated_repo: 'https://github.com/lukas2511/dehydrated.git'
8+
dehydrated_commit: 'v0.4.0'
9+
10+
dehydrated_base_directory: '/etc/dehydrated'
11+
dehydrated_certs_directory: '/etc/ssl/letsencrypt/certs'
12+
dehydrated_accounts_directory: '{{ dehydrated_base_directory }}/accounts'
13+
dehydrated_config_file: '/etc/dehydrated/config'
14+
dehydrated_domains_file: '{{ dehydrated_base_directory }}/domains.txt'
15+
dehydrated_software_directory: '/usr/local/dehydrated'
16+
dehydrated_challenges_directory: '/var/www/letsencrypt'
17+
18+
dehydrated_ca: 'https://acme-v01.api.letsencrypt.org/directory'
919

1020
# Path to the local file containing the account key to copy to the server.
1121
# Secure this file using Git-crypt for example.
@@ -21,11 +31,7 @@ acme_tiny_challenges_directory: '/var/www/letsencrypt'
2131
# KWXliiWjUORxDxI1c56Rw2VCIExnFjWJAdSLv6/XaQWo2T7U28bkKbAlCF9=
2232
# -----END RSA PRIVATE KEY-----
2333

24-
letsencrypt_account_key: '{{ acme_tiny_data_directory }}/account.key'
25-
26-
letsencrypt_intermediate_cert_path: '/etc/ssl/certs/lets-encrypt-x3-cross-signed.pem'
27-
letsencrypt_intermediate_cert_url: 'https://letsencrypt.org/certs/lets-encrypt-x3-cross-signed.pem'
28-
letsencrypt_intermediate_cert_sha256sum: 'e446c5e9dbef9d09ac9f7027c034602492437a05ff6c40011d7235fca639c79a'
34+
letsencrypt_account_key: '{{ dehydrated_base_directory }}/private_key.pem'
2935

3036
letsencrypt_key_dir: '/etc/ssl/letsencrypt/keys'
3137
letsencrypt_certs_dir: '/etc/ssl/letsencrypt/certs'
@@ -53,6 +59,6 @@ letsencrypt_min_renewal_age: 60
5359
# the days of a month the cronjob should be run. Make sure to run it rather often, three times per month is a pretty
5460
# good value. It does not harm to run it often, as it will only regenerate certificates that have passed a certain age
5561
# (60 days by default).
56-
letsencrypt_cronjob_daysofmonth: 1,11,21
62+
letsencrypt_cronjob_daysofmonth: "*"
5763

5864
...

0 commit comments

Comments
 (0)