Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Improvements #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
- include: postfix.yml
- include: opendkim.yml
when: mta_dkim | default(False)

- name: update /etc/mailname
copy: dest=/etc/mailname content={{ mta_override_hostname | default(inventory_hostname) }}
owner=root group=root mode=644
2 changes: 2 additions & 0 deletions templates/opendkim/KeyTable
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that already done in our ansible repos? I remember the header looking like {{ ansible_managed }}.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or does that only cover ansible.git, but not the ansible-mta submodule?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Usually, I would also vote for {{ ansible_managed }}. There are two reason for not using it:

  1. It only works in templates and not in static files.
  2. All other roles in our ansible repo use this static line. I just copied it. :)


{% if mta_dkim_sign -%}
{%- for domain in mta_dkim_domains %}
{{ domain.key }}._domainkey.{{ domain.name }} {{ domain.name }}:{{ domain.key }}:/etc/opendkim/keys/{{ domain.name }}/{{ domain.key }}.private
Expand Down
2 changes: 2 additions & 0 deletions templates/opendkim/SigningTable
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###

{% if mta_dkim_sign -%}
{%- for domain in mta_dkim_domains %}
*@{{ domain.name }} {{ domain.key }}._domainkey.{{ domain.name }}
Expand Down
2 changes: 2 additions & 0 deletions templates/opendkim/opendkim.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###

PidFile /var/run/opendkim/opendkim.pid

Mode {{ 's' if mta_dkim_sign else '' }}{{ 'v' if mta_dkim_verify else '' }}
Expand Down
2 changes: 2 additions & 0 deletions templates/postfix/aliases
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###

{% for entry in item.map|dictsort(by='key') %}
{{ entry[0] }}: {{ entry[1] if entry[1] is string else (entry[1] | join(", ")) }}
{% endfor %}
2 changes: 2 additions & 0 deletions templates/postfix/main.cf
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###

# configuration
myhostname = {{ mta_override_hostname | default(inventory_hostname) }}
myorigin = $myhostname
Expand Down
1 change: 1 addition & 0 deletions templates/postfix/master.cf
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###
#
# Postfix master process configuration file. For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
Expand Down
1 change: 1 addition & 0 deletions templates/postfix/password_map
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###
{{ mta_relayhost }} {{ mta_relayhost_auth.username }}:{{ mta_relayhost_password }}
2 changes: 1 addition & 1 deletion templates/postfix/transport_map
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Managed by ansible ###
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###
{% for entry in mta_transport_map | dictsort(by='key') %}
{{ entry[0] }} {{ entry[1] }}
{% endfor %}
1 change: 1 addition & 0 deletions templates/postfix/virtual
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ###
{{ '#' }} virtual table for domain {{ item.domain }}
{% for entry in item.map|dictsort(by='key') %}
{{ entry[0] }}@{{ item.domain }} {{ entry[1] if entry[1] is string else (entry[1] | join(", ")) }}
Expand Down