Skip to content

Commit

Permalink
Renew service should not be limited on one domain
Browse files Browse the repository at this point in the history
Certbot take care of all registred certificates by default. We should make use of it and not override this behaviour.
  • Loading branch information
wsmirnow committed Jan 10, 2025
1 parent 09fbc58 commit 5290275
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 28 deletions.
6 changes: 3 additions & 3 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---

- name: Restart certbot
systemd:
- name: Enable certbot
ansible.builtin.systemd:
name: certbot-renew.timer
state: restarted
enabled: true
daemon_reload: true
7 changes: 3 additions & 4 deletions meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@ galaxy_info:
company: ELAN e.V.
description: Configure TLS certificate renewal via certbot for Opencast
license: BSD-3-Clause
min_ansible_version: 2.9
min_ansible_version: "2.9"
galaxy_tags:
- opencast
platforms:
- name: EL
versions:
- 7
- 8
- 9
- "8"
- "9"
- name: Debian
versions:
- all
Expand Down
15 changes: 9 additions & 6 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@
ansible.builtin.package:
name: certbot

- name: Install certbot services
ansible.builtin.template:
src: '{{ item }}'
dest: /etc/systemd/system/{{ item }}
mode: '0644'
# This task should remove custom service definitions created by previous version of this role.
# Certbot package come with a renew service definitions itself, why not using it?
# It will renew all registred certificates by default and does not limit us on some domains.
# You can remove this task on later versions.
- name: Remove custom certbot services definition
ansible.builtin.file:
path: '/etc/systemd/system/{{ item }}'
state: absent
loop:
- certbot-renew.service
- certbot-renew.timer
notify: Restart certbot
notify: Enable certbot

- name: Start certbot service
ansible.builtin.service:
Expand Down
7 changes: 0 additions & 7 deletions templates/certbot-renew.service

This file was deleted.

8 changes: 0 additions & 8 deletions templates/certbot-renew.timer

This file was deleted.

0 comments on commit 5290275

Please sign in to comment.