From 926bca852276b2db8a4f8427b2e16a9e38df3908 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 11 Nov 2017 18:12:13 +0100 Subject: [PATCH 1/2] Add managed by ansible header --- templates/opendkim/KeyTable | 2 ++ templates/opendkim/SigningTable | 2 ++ templates/opendkim/opendkim.conf | 2 ++ templates/postfix/aliases | 2 ++ templates/postfix/main.cf | 2 ++ templates/postfix/master.cf | 1 + templates/postfix/password_map | 1 + templates/postfix/transport_map | 2 +- templates/postfix/virtual | 1 + 9 files changed, 14 insertions(+), 1 deletion(-) diff --git a/templates/opendkim/KeyTable b/templates/opendkim/KeyTable index 80ba011..dd460b2 100644 --- a/templates/opendkim/KeyTable +++ b/templates/opendkim/KeyTable @@ -1,3 +1,5 @@ +### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ### + {% 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 diff --git a/templates/opendkim/SigningTable b/templates/opendkim/SigningTable index 5241654..8f24b1e 100644 --- a/templates/opendkim/SigningTable +++ b/templates/opendkim/SigningTable @@ -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 }} diff --git a/templates/opendkim/opendkim.conf b/templates/opendkim/opendkim.conf index 0d9b40e..1f35a20 100644 --- a/templates/opendkim/opendkim.conf +++ b/templates/opendkim/opendkim.conf @@ -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 '' }} diff --git a/templates/postfix/aliases b/templates/postfix/aliases index 87d7700..5259b3a 100644 --- a/templates/postfix/aliases +++ b/templates/postfix/aliases @@ -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 %} diff --git a/templates/postfix/main.cf b/templates/postfix/main.cf index 2dbe582..6556ac8 100644 --- a/templates/postfix/main.cf +++ b/templates/postfix/main.cf @@ -1,3 +1,5 @@ +### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ### + # configuration myhostname = {{ mta_override_hostname | default(inventory_hostname) }} myorigin = $myhostname diff --git a/templates/postfix/master.cf b/templates/postfix/master.cf index 23b99ac..5352879 100644 --- a/templates/postfix/master.cf +++ b/templates/postfix/master.cf @@ -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 diff --git a/templates/postfix/password_map b/templates/postfix/password_map index 0169db4..6b18060 100644 --- a/templates/postfix/password_map +++ b/templates/postfix/password_map @@ -1 +1,2 @@ +### THIS FILE IS MANAGED BY ANSIBLE -- DO NOT EDIT! ### {{ mta_relayhost }} {{ mta_relayhost_auth.username }}:{{ mta_relayhost_password }} diff --git a/templates/postfix/transport_map b/templates/postfix/transport_map index 4464faa..1fd394a 100644 --- a/templates/postfix/transport_map +++ b/templates/postfix/transport_map @@ -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 %} diff --git a/templates/postfix/virtual b/templates/postfix/virtual index 330108f..dc7d604 100644 --- a/templates/postfix/virtual +++ b/templates/postfix/virtual @@ -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(", ")) }} From d2468c563050610d53a208f9ca65d007ba9a510b Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Sat, 11 Nov 2017 18:19:21 +0100 Subject: [PATCH 2/2] Manage /etc/mailname --- tasks/main.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/main.yml b/tasks/main.yml index 7247032..a0ef037 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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