Open thomasrebele opened 1 year ago
It seems that ansible-letsencrypt does not yet support Debian bullseye.
I've updated the buster block to add a condition for "bullseye" in tasks/main.yml:
- name: install certbot (Debian stretch or buster)
include: debian-stretch-buster.yml
when: ansible_distribution == "Debian" and (ansible_distribution_release == "stretch" or ansible_distribution_release == "buster" or ansible_distribution_release == "bullseye" )
If this works I might consider a PR.
Also I get several warnings:
[DEPRECATION WARNING]: Invoking "apt" only once while using a loop via squash_actions is deprecated. Instead of using a loop to supply multiple items and specifying `pkg: "{{item}}"`, please use `pkg: ['certbot']` and remove the
loop. This feature will be removed from ansible-base in version 2.11. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
Not sure how to fix those.
I use the following patch to add support for newer Ubuntu/Debian versions and remove some very outdated ones.
Index: README.md
===================================================================
--- README.md (Revision 6269)
+++ README.md (Revision 13557)
@@ -6,10 +6,14 @@
the web server has been configured or even installed.
# Supported platforms
-- Debian Jessie
- Debian Stretch
- Debian Buster
-- Ubuntu Xenial
+- Debian Bullseye
+- Debian Bookworm
+- Debian Sid
+- Ubuntu Focal
+- Ubuntu Jammy
+- Ubuntu Kinetic
On other platforms this role will try to install letsencrypt using pip, which is not officially supported and may break over upgrades at least.
Index: tasks/ubuntu-xenial.yml
===================================================================
--- tasks/ubuntu-xenial.yml (Revision 6269)
+++ tasks/ubuntu-xenial.yml (nicht existent)
@@ -1,19 +0,0 @@
----
-- name: update the apt cache
- apt: update_cache=yes cache_valid_time=7200
- become: yes
-
-- name: add certbot apt ppa repository
- apt_repository:
- repo: "ppa:certbot/certbot"
- become: yes
-
-- name: install certbot ubuntu
- apt: pkg={{item}} state=latest
- with_items:
- - certbot
- become: yes
-
-- name: change the path to letsencrypt
- set_fact:
- letsencrypt_path: "/usr/bin/letsencrypt"
Index: tasks/debian-jessie.yml
===================================================================
--- tasks/debian-jessie.yml (Revision 6269)
+++ tasks/debian-jessie.yml (nicht existent)
@@ -1,28 +0,0 @@
----
-- name: Add jessie backports
- apt_repository:
- repo: deb http://ftp.debian.org/debian jessie-backports main contrib non-free
- state: present
- filename: 'backports'
- register: jbp_added
- become: yes
-
-- name: update the apt cache
- apt: update_cache=yes cache_valid_time=7200
- become: yes
-
-# if jessie-backports has been added we should update the cache
-- name: force update the apt cache
- apt: update_cache=yes
- when: jbp_added.changed
- become: yes
-
-- name: install certbot from backports
- apt: pkg={{item}} default_release=jessie-backports state=latest
- with_items:
- - certbot
- become: yes
-
-- name: change the path to letsencrypt
- set_fact:
- letsencrypt_path: "/usr/bin/letsencrypt"
Index: tasks/main.yml
===================================================================
--- tasks/main.yml (Revision 6269)
+++ tasks/main.yml (Revision 13557)
@@ -13,21 +13,37 @@
when: virtualenv_package_name is not defined
tags: install
- - name: install certbot (Debian jessie)
- include: debian-jessie.yml
- when: ansible_distribution == "Debian" and ansible_distribution_release == "jessie"
-
- - name: install certbot (Debian stretch or buster)
+ - name: install certbot (Debian Stretch or Buster)
include: debian-stretch-buster.yml
when: ansible_distribution == "Debian" and (ansible_distribution_release == "stretch" or ansible_distribution_release == "buster")
- - name: install certbot (Ubuntu Xenial)
- include: ubuntu-xenial.yml
- when: ansible_distribution == "Ubuntu" and ansible_distribution_release == "xenial"
+ - name: install certbot (Debian Bullseye)
+ include: debian-bullseye.yml
+ when: ansible_distribution == "Debian" and ansible_distribution_release == "bullseye"
+ - name: install certbot (Debian Bookworm)
+ include: debian-bookworm.yml
+ when: ansible_distribution == "Debian" and ansible_distribution_release == "bookworm"
+
+ - name: install certbot (Debian Sid)
+ include: debian-sid.yml
+ when: ansible_distribution == "Debian" and ansible_distribution_release == "sid"
+
+ - name: install certbot (Ubuntu Focal)
+ include: ubuntu-focal.yml
+ when: ansible_distribution == "Ubuntu" and ansible_distribution_release == "focal"
+
+ - name: install certbot (Ubuntu Jammy)
+ include: ubuntu-jammy.yml
+ when: ansible_distribution == "Ubuntu" and ansible_distribution_release == "jammy"
+
+ - name: install certbot (Ubuntu Kinetic)
+ include: ubuntu-kinetic.yml
+ when: ansible_distribution == "Ubuntu" and ansible_distribution_release == "kinetic"
+
- name: install certbot (using pip)
include: install-with-pip.yml
- when: ansible_distribution != "Debian" and (ansible_distribution != "Ubuntu" or ansible_distribution_release != "xenial")
+ when: ansible_distribution != "Debian" and ansible_distribution != "Ubuntu"
- name: Ensure webroot exists
file:
Index: tasks/ubuntu-kinetic.yml
===================================================================
--- tasks/ubuntu-kinetic.yml (nicht existent)
+++ tasks/ubuntu-kinetic.yml (Revision 13557)
@@ -0,0 +1,14 @@
+---
+- name: update the apt cache
+ apt: update_cache=yes cache_valid_time=7200
+ become: yes
+
+- name: install certbot ubuntu
+ apt: pkg={{item}} state=latest
+ with_items:
+ - certbot
+ become: yes
+
+- name: change the path to letsencrypt
+ set_fact:
+ letsencrypt_path: "/usr/bin/letsencrypt"
\ No newline at end of file
Index: tasks/ubuntu-jammy.yml
===================================================================
--- tasks/ubuntu-jammy.yml (nicht existent)
+++ tasks/ubuntu-jammy.yml (Revision 13557)
@@ -0,0 +1,14 @@
+---
+- name: update the apt cache
+ apt: update_cache=yes cache_valid_time=7200
+ become: yes
+
+- name: install certbot ubuntu
+ apt: pkg={{item}} state=latest
+ with_items:
+ - certbot
+ become: yes
+
+- name: change the path to letsencrypt
+ set_fact:
+ letsencrypt_path: "/usr/bin/letsencrypt"
\ No newline at end of file
Index: tasks/debian-bookworm.yml
===================================================================
--- tasks/debian-bookworm.yml (nicht existent)
+++ tasks/debian-bookworm.yml (Revision 13557)
@@ -0,0 +1,14 @@
+---
+- name: update the apt cache
+ apt: update_cache=yes cache_valid_time=7200
+ become: yes
+
+- name: install certbot
+ apt: pkg={{item}} state=latest
+ with_items:
+ - certbot
+ become: yes
+
+- name: change the path to letsencrypt
+ set_fact:
+ letsencrypt_path: "/usr/bin/letsencrypt"
Index: tasks/debian-bullseye.yml
===================================================================
--- tasks/debian-bullseye.yml (nicht existent)
+++ tasks/debian-bullseye.yml (Revision 13557)
@@ -0,0 +1,14 @@
+---
+- name: update the apt cache
+ apt: update_cache=yes cache_valid_time=7200
+ become: yes
+
+- name: install certbot
+ apt: pkg={{item}} state=latest
+ with_items:
+ - certbot
+ become: yes
+
+- name: change the path to letsencrypt
+ set_fact:
+ letsencrypt_path: "/usr/bin/letsencrypt"
Index: tasks/debian-sid.yml
===================================================================
--- tasks/debian-sid.yml (nicht existent)
+++ tasks/debian-sid.yml (Revision 13557)
@@ -0,0 +1,14 @@
+---
+- name: update the apt cache
+ apt: update_cache=yes cache_valid_time=7200
+ become: yes
+
+- name: install certbot
+ apt: pkg={{item}} state=latest
+ with_items:
+ - certbot
+ become: yes
+
+- name: change the path to letsencrypt
+ set_fact:
+ letsencrypt_path: "/usr/bin/letsencrypt"
Index: tasks/ubuntu-focal.yml
===================================================================
--- tasks/ubuntu-focal.yml (nicht existent)
+++ tasks/ubuntu-focal.yml (Revision 13557)
@@ -0,0 +1,14 @@
+---
+- name: update the apt cache
+ apt: update_cache=yes cache_valid_time=7200
+ become: yes
+
+- name: install certbot ubuntu
+ apt: pkg={{item}} state=latest
+ with_items:
+ - certbot
+ become: yes
+
+- name: change the path to letsencrypt
+ set_fact:
+ letsencrypt_path: "/usr/bin/letsencrypt"
\ No newline at end of file
I've executed a
apt upgrade
on a Debian 11.6 and now I get these error messages with a new ansible-letsencrypt roleI've found several discussions (example) that recommend deleting the certbot-auto virtual environment to recreate it. Does the advice apply to this repo, too? If yes, how to do that? I've tried renaming /usr/local/share/letsencrypt/ to recreate it, but then ansible-letsencrypt complains that the directory has not been found.