From 42281b1bb5723134104af91eb240069dc6d03254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?GOLDERWEB=20=E2=80=93=20Jonathan=20Golder?= Date: Fri, 9 Sep 2016 22:44:56 +0200 Subject: [PATCH] Prepare defaults and vars Especially to be conform to RFC 2142 there are some predefinitions needed Also we need to make sure that those always are applied except they are explicitly overwritten https://tools.ietf.org/html/rfc2142 --- defaults/main.yml | 9 +++++++++ tasks/main.yml | 2 ++ vars/main.yml | 7 +++++++ 3 files changed, 18 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 995d537..da930c1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -2,3 +2,12 @@ # defaults file for dotqmail dotqmail_prefix : ".qmail-" +# Set root dotqmail file to maildir by default +dotqmail_rootfile: ["./Maildir/"] + +# Those must be always present according to rfc2142 +# @see https://tools.ietf.org/html/rfc2142 +dotqmail_default_files: + "abuse": ["{{ansible_env.USER}}"] + "hostmaster": ["{{ansible_env.USER}}"] + "postmaster": ["{{ansible_env.USER}}"] diff --git a/tasks/main.yml b/tasks/main.yml index 4afa0b3..9206038 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -39,6 +39,8 @@ # For the other files the we get a key-value pair with the dotqmail extention # as key and the list of lines as value while looping over dotqmail_files +# (which is a combination of dotqmail_config_files from inventory over +# dotqmail_default_files from role defaults) - name: generate/update other dotqmail-files template: src: templates/dotqmail.j2 diff --git a/vars/main.yml b/vars/main.yml index 33f7103..f846b81 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,2 +1,9 @@ --- # vars file for dotqmail + +# combine dotqmail_default_files from role's default with configuration +# Will make sure that every dotqmail file from default config will be present +# the content hence can be adjusted by defining the extention in e.g. inventory +# which will be prefered +# This is done to be conform with rfc2142 +dotqmail_files: "{{dotqmail_default_files|combine(dotqmail_config_files)}}"