Tasks Update: Move Certbot to Podman container

This commit is contained in:
Christer Warén
2024-12-16 19:54:36 +02:00
parent ecfa10fe1c
commit f0601c105c
2 changed files with 34 additions and 34 deletions

View File

@ -1,15 +1,24 @@
---
- name: "Deployer - Certbot - Renew Certificates"
command: "certbot renew --config-dir ~/data/letsencrypt/config --logs-dir ~/data/letsencrypt/logs --work-dir ~/data/letsencrypt/work"
containers.podman.podman_container:
name: certbot
image: "docker.io/certbot/certbot:latest"
state: started
network: host
volumes:
- "{{ ansible_facts.user_dir }}/data/certbot:/etc/letsencrypt"
command: "renew"
detach: false
register: task
changed_when: task.stdout.find("No renewals were attempted.") == -1
changed_when:
- task.stdout.find("No renewals were attempted.") == -1
tags:
- certbot
- tls
- name: "Deployer - Certbot - Copy Certificates"
copy:
src: "~/data/letsencrypt/live/{{ cert }}/"
src: "~/data/certbot/live/{{ cert }}/"
dest: "~/data/certificates/{{ cert }}/"
follow: true
loop: "{{ certs }}"