From 41e117eaf6e52dbd48935b3b80d49f9a61cebef6 Mon Sep 17 00:00:00 2001 From: Mischa ter Smitten Date: Wed, 20 Mar 2024 14:24:36 +0100 Subject: [PATCH] Consistency changes --- README.md | 4 ++-- defaults/main.yml | 2 +- handlers/main.yml | 2 +- tasks/main.yml | 2 +- templates/etc/aliases.j2 | 2 +- templates/etc/postfix/main.cf.j2 | 4 ++-- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2e6da51..6f7c6f5 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ None * `postfix_compatibility_level` [optional]: With backwards compatibility turned on (the compatibility_level value is less than the Postfix built-in value), Postfix looks for settings that are left at their implicit default value, and logs a message when a backwards-compatible default setting is required (e.g. `2`, `Postfix >= 3.0`) * `postfix_default_database_type` [default: `hash`]: The default database type for use in `newaliases`, `postalias` and `postmap` commands - * `postfix_alias_database_type` [default: `"{{ postfix_default_database_type }}"`]: The database type for aliases * `postfix_aliases` [default: `[]`]: Aliases to ensure present in `/etc/aliases` + * `postfix_aliases_database_type` [default: `"{{ postfix_default_database_type }}"`]: The database type for aliases * `postfix_virtual_aliases` [default: `[]`]: Virtual aliases to ensure present in `/etc/postfix/virtual` * `postfix_sender_canonical_maps` [default: `[]`]: Sender address rewriting in `/etc/postfix/sender_canonical_maps` ([see](http://www.postfix.org/postconf.5.html#transport_maps)) * `postfix_sender_canonical_maps_database_type` [default: `"{{ postfix_default_database_type }}"`]: The database type for use in `postfix_sender_canonical_maps` @@ -186,7 +186,7 @@ Aliases with regexp table (forward all local mail to specified address): roles: - oefenweb.postfix vars: - postfix_alias_database_type: regexp + postfix_aliases_database_type: regexp postfix_aliases: - user: /.*/ alias: you@yourdomain.org diff --git a/defaults/main.yml b/defaults/main.yml index 5dffdbe..7ff626f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -11,8 +11,8 @@ postfix_hostname: "{{ ansible_fqdn }}" postfix_mailname: "{{ ansible_fqdn }}" postfix_default_database_type: hash -postfix_alias_database_type: "{{ postfix_default_database_type }}" postfix_aliases: [] +postfix_aliases_database_type: "{{ postfix_default_database_type }}" postfix_virtual_aliases: [] postfix_sender_canonical_maps: [] postfix_sender_canonical_maps_database_type: "{{ postfix_default_database_type }}" diff --git a/handlers/main.yml b/handlers/main.yml index cbafc2f..ce2d541 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -3,7 +3,7 @@ - name: new aliases ansible.builtin.command: > newaliases - when: postfix_alias_database_type != 'regexp' + when: postfix_aliases_database_type != 'regexp' changed_when: true - name: new virtual aliases diff --git a/tasks/main.yml b/tasks/main.yml index cc4bd46..e50749c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -96,7 +96,7 @@ path: "{{ postfix_aliases_file }}.db" register: _aliasesdb changed_when: not _aliasesdb.stat.exists - when: postfix_alias_database_type == 'hash' + when: postfix_aliases_database_type == 'hash' notify: - new aliases - restart postfix diff --git a/templates/etc/aliases.j2 b/templates/etc/aliases.j2 index f75b950..3652d01 100644 --- a/templates/etc/aliases.j2 +++ b/templates/etc/aliases.j2 @@ -1,7 +1,7 @@ {{ ansible_managed | comment }} # See man 5 aliases for format -{% if postfix_alias_database_type == "regexp" %} +{% if postfix_aliases_database_type == 'regexp' %} {% for alias in postfix_aliases %} {{ alias.user }} {{ alias.alias }} {% endfor %} diff --git a/templates/etc/postfix/main.cf.j2 b/templates/etc/postfix/main.cf.j2 index a72c03f..8fbb392 100644 --- a/templates/etc/postfix/main.cf.j2 +++ b/templates/etc/postfix/main.cf.j2 @@ -37,8 +37,8 @@ smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache myhostname = {{ postfix_hostname }} default_database_type = {{ postfix_default_database_type }} -alias_maps = {{ postfix_alias_database_type }}:{{ postfix_aliases_file }} -alias_database = {{ postfix_alias_database_type }}:{{ postfix_aliases_file }} +alias_maps = {{ postfix_aliases_database_type }}:{{ postfix_aliases_file }} +alias_database = {{ postfix_aliases_database_type }}:{{ postfix_aliases_file }} {% if postfix_virtual_aliases %} virtual_alias_maps = {{ postfix_default_database_type }}:{{ postfix_virtual_aliases_file }} {% endif %}