From e316679e1359fb80d5f3d10c8b2b7f9ca590c9de Mon Sep 17 00:00:00 2001 From: Solal Nathan Date: Thu, 4 Feb 2021 23:34:53 +0100 Subject: [PATCH] Add additional role for mailserver --- roles/re2o_service_mailserver/tasks/main.yml | 15 +++++++++++++++ .../templates/cron.d/re2o-services-mail-server.j2 | 3 +++ 2 files changed, 18 insertions(+) create mode 100644 roles/re2o_service_mailserver/tasks/main.yml create mode 100644 roles/re2o_service_mailserver/templates/cron.d/re2o-services-mail-server.j2 diff --git a/roles/re2o_service_mailserver/tasks/main.yml b/roles/re2o_service_mailserver/tasks/main.yml new file mode 100644 index 0000000..cc2cce5 --- /dev/null +++ b/roles/re2o_service_mailserver/tasks/main.yml @@ -0,0 +1,15 @@ +--- +# Additional configuration for the re2o-service mailserver, you have to deploy the re2o_service first + +- name: Create generated directory + file: + path: /var/local/re2o-services/mail-server/generated + state: directory + mode: "0755" + owner: root + group: root + +- name: Deploy cron for re2o-mail-server + template: + src: cron.d/re2o-services-mail-server.j2 + dest: /etc/cron.d/re2o-services-mail-server diff --git a/roles/re2o_service_mailserver/templates/cron.d/re2o-services-mail-server.j2 b/roles/re2o_service_mailserver/templates/cron.d/re2o-services-mail-server.j2 new file mode 100644 index 0000000..a1b0231 --- /dev/null +++ b/roles/re2o_service_mailserver/templates/cron.d/re2o-services-mail-server.j2 @@ -0,0 +1,3 @@ +{{ ansible_managed | comment }} +# Regenerate Postfix configuration Re2o API every 5 minutes +*/5 * * * * root /usr/bin/python3 /var/local/re2o-services/mail-server/main.py