diff options
| author | Joe Carstairs <me@joeac.net> | 2026-08-13 10:40:17 +0100 |
|---|---|---|
| committer | Joe Carstairs <me@joeac.net> | 2026-08-13 15:51:40 +0100 |
| commit | f32d030ff966fb1046d57fe8b05085ce6cd73d5e (patch) | |
| tree | 11028dadc012a7e6012f5bf07f84d90189cb0d56 /ansible/roles/tls/tasks | |
| parent | b51e063e525f9e2021508d4d08ecd2a47f45aa1d (diff) | |
gets missing tls certs by certbot-dns-ovh
Diffstat (limited to 'ansible/roles/tls/tasks')
| -rw-r--r-- | ansible/roles/tls/tasks/main.yml | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ansible/roles/tls/tasks/main.yml b/ansible/roles/tls/tasks/main.yml index b9b76b1..f637ff5 100644 --- a/ansible/roles/tls/tasks/main.yml +++ b/ansible/roles/tls/tasks/main.yml @@ -16,24 +16,30 @@ ansible.builtin.setup: filter: ansible_local -- name: Install certbot and nginx +- name: Install certbot and certbot-dns-ovh community.general.apk: name: - certbot - - nginx - state: present + - certbot-dns-ovh - name: Renew all TLS certificates that are near expiry when: ( ansible_local.certbot.invalid_certificates | length ) > 0 ansible.builtin.shell: certbot renew --non-interactive +- name: Install OVH DNS credentials + ansible.builtin.copy: + src: ovh-dns-credentials.ini + dest: /etc/ovh-dns-credentials.ini + mode: "400" + - name: Install missing TLS certificates loop: "{{ subdomains }}" when: not ( ( item.name ~ ".joeac.net" ) in ansible_local.certbot.certificates ) ansible.builtin.shell: certbot certonly \ - --nginx \ + --dns-ovh \ + --dns-ovh-credentials /etc/ovh-dns-credentials.ini \ --cert-name {{ item.name }}.joeac.net \ --domain {{ item.full_domain }} \ --non-interactive |
