Skip to content

Commit 4233ece

Browse files
committed
Add option to set certbot version via variable
Currently the role breaks when the hard coded version is missing from the ppa. This adds the option to specify the version to be installed via a variable.
1 parent bfe66fa commit 4233ece

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ Role Variables
1515
domain_name: www.mydomain.io
1616
letsencrypt_email: myaccount@letsencrypt.org
1717
certbot_nginx_cert_name: mycert # optional
18+
certbot_version: 0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1 # optional
19+
certbot_nginx_version: 0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1 # optional
1820
```
1921
2022
if set, `certbot_nginx_cert_name`'s value will be passed to the certbot's `--cert-name` argument, which is used to identify the certificate in certbot command such as `certbot delete`. You will see a list of certificates identified with this name by running `certbot certificates`. This name will also be used as the file paths for the certificate in `/etc/letsencrypt/live/`.

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
---
22
letsencrypt_staging: false
3+
certbot_version: 0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1
4+
certbot_nginx_version: 0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1

tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77
- name: Install certbot
88
package:
9-
name: "certbot=0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1"
9+
name: "certbot={{ certbot_version }}"
1010
state: present
1111

1212
- name: Install certbot-nginx plugin
1313
package:
14-
name: "python-certbot-nginx=0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1"
14+
name: "python-certbot-nginx={{ certbot_nginx_version }}"
1515
state: present
1616

1717
- import_tasks: certificate.yml

0 commit comments

Comments
 (0)