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)}}"