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 Aug 10, 2023
1 parent 2262b12 commit a09ab4e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 30 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
22 changes: 10 additions & 12 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@
- name: Install certbot package
ansible.builtin.package:
name: certbot
notify: Enable 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

- name: Start certbot service
ansible.builtin.service:
name: certbot-renew.timer
state: started
enabled: true
notify: Enable certbot

- name: Generate initial certificate
ansible.builtin.shell:
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 a09ab4e

Please sign in to comment.