imfreedom/email-ansible

Add a certbot hook for dovecot
draft
2021-05-23, Gary Kramlich
6b3839d73fa6
Parents 737268985cb9
Children 1ea5ffec0df8
Add a certbot hook for dovecot
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/mail/files/dovecot.certbot Sun May 23 02:27:41 2021 -0500
@@ -0,0 +1,4 @@
+#!/bin/sh -eu
+
+systemctl reload dovecot
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/roles/mail/tasks/certbot.yaml Sun May 23 02:27:41 2021 -0500
@@ -0,0 +1,12 @@
+---
+- name: "create /etc/letsencrypt/renewal-hooks/deploy directory"
+ file:
+ path: "/etc/letsencrypt/renewal-hooks/deploy"
+ state: "directory"
+- name: "install hooks for certbot"
+ copy:
+ src: "{{ item }}.certbot"
+ dest: "/etc/letsencrypt/renewal-hooks/deploy/{{ item }}"
+ mode: "0755"
+ loop:
+ - "dovecot"
--- a/roles/mail/tasks/main.yaml Tue May 11 02:53:50 2021 -0500
+++ b/roles/mail/tasks/main.yaml Sun May 23 02:27:41 2021 -0500
@@ -23,3 +23,13 @@
- mail
tags:
- always
+
+- include_tasks: "certbot.yaml"
+ args:
+ apply:
+ tags:
+ - "mail"
+ - "certbot"
+ tags:
+ - "always"
+