Skip to content

Commit 80e7ad5

Browse files
authored
Merge pull request #27 from coopdevs/feature/ubuntu_focal
Ubuntu 20.04 support
2 parents d3566b6 + a90918e commit 80e7ad5

4 files changed

Lines changed: 19 additions & 4 deletions

File tree

defaults/main.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
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

meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ galaxy_info:
1313
versions:
1414
- xenial
1515
- bionic
16+
- focal
1617

1718
galaxy_tags:
1819
- certbot

tasks/certificate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
--cert-name '{{ certbot_nginx_cert_name }}'
2323
{% endif %}
2424
{% if letsencrypt_staging %} --staging {% endif %}
25-
when: letsencrypt_cert.stat.exists and certbot_force_update is defined
25+
{% if ansible_distribution_version >= "20.04" %} --non-interactive {% endif %}
26+
when: letsencrypt_cert.stat.exists and certbot_force_update | bool
2627
notify: reload nginx

tasks/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
---
2+
- name: Set Certbot package name and versions (Ubuntu >= 20.04)
3+
set_fact:
4+
certbot_version: 0.40.0-1
5+
certbot_nginx_version: 0.40.0-0ubuntu0.1
6+
certbot_nginx_name: python3-certbot-nginx
7+
when: ansible_distribution_version >= "20.04"
8+
9+
- name: Set Certbot package name and versions (Ubuntu < 20.04)
10+
set_fact:
11+
certbot_version: 0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1
12+
certbot_nginx_version: 0.31.0-1+ubuntu{{ ansible_distribution_version }}.1+certbot+1
13+
certbot_nginx_name: python-certbot-nginx
14+
when: ansible_distribution_version < "20.04"
15+
216
- name: Add certbot repository
317
apt_repository:
418
repo: 'ppa:certbot/certbot'
519
state: present
20+
when: ansible_distribution_version < "20.04"
621

722
- name: Install certbot
823
package:
@@ -11,7 +26,7 @@
1126

1227
- name: Install certbot-nginx plugin
1328
package:
14-
name: "python-certbot-nginx={{ certbot_nginx_version }}"
29+
name: "{{ certbot_nginx_name }}={{ certbot_nginx_version }}"
1530
state: present
1631

1732
- import_tasks: certificate.yml

0 commit comments

Comments
 (0)