Skip to content

Commit

Permalink
Consistency changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tersmitten committed Mar 20, 2024
1 parent 9ffb4fc commit 41e117e
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down Expand Up @@ -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: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
- name: new aliases

Check warning on line 3 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
ansible.builtin.command: >
newaliases
when: postfix_alias_database_type != 'regexp'
when: postfix_aliases_database_type != 'regexp'
changed_when: true

- name: new virtual aliases

Check warning on line 9 in handlers/main.yml

View workflow job for this annotation

GitHub Actions / Lint

name[casing]

All names should start with an uppercase letter.
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/etc/aliases.j2
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down
4 changes: 2 additions & 2 deletions templates/etc/postfix/main.cf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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 %}
Expand Down

0 comments on commit 41e117e

Please sign in to comment.