diff --git a/tasks/postfix.yml b/tasks/postfix.yml index ccf14db..c66ca14 100644 --- a/tasks/postfix.yml +++ b/tasks/postfix.yml @@ -9,7 +9,7 @@ - name: "Postfix | Copy master.cf" ansible.builtin.template: - src: postfix/master.cf + src: postfix/master.cf.j2 dest: /etc/postfix/master.cf mode: "0644" notify: restart postfix diff --git a/tasks/tls-helper.yml b/tasks/tls-helper.yml index 324ed54..391b5ec 100644 --- a/tasks/tls-helper.yml +++ b/tasks/tls-helper.yml @@ -13,7 +13,7 @@ - name: "TLS-help | Copy allowlist" ansible.builtin.template: - src: postfix/allowlist.txt + src: postfix/allowlist.txt.j2 dest: /opt/mail-tls-helper/allowlist.txt mode: "0644" @@ -63,6 +63,6 @@ - name: "TLS-helper | Create new logrotate configuration" ansible.builtin.template: - src: logrotate.conf + src: logrotate.conf.j2 dest: /etc/logrotate.d/maillog mode: "0644" diff --git a/templates/logrotate.conf b/templates/logrotate.conf.j2 similarity index 94% rename from templates/logrotate.conf rename to templates/logrotate.conf.j2 index b432526..e728514 100644 --- a/templates/logrotate.conf +++ b/templates/logrotate.conf.j2 @@ -1,3 +1,5 @@ +{{ ansible_managed | comment }} + /var/log/mail.log /var/log/mail.info /var/log/mail.warn diff --git a/templates/nginx/mta-sts.j2 b/templates/nginx/mta-sts.j2 index 41aa3cf..7cbed9a 100644 --- a/templates/nginx/mta-sts.j2 +++ b/templates/nginx/mta-sts.j2 @@ -1,3 +1,5 @@ +{{ ansible_managed | comment }} + server { listen 80; server_name mta-sts.{{ item.name }}; diff --git a/templates/postfix/allowlist.txt b/templates/postfix/allowlist.txt.j2 similarity index 70% rename from templates/postfix/allowlist.txt rename to templates/postfix/allowlist.txt.j2 index 69fd1ff..207ca2b 100644 --- a/templates/postfix/allowlist.txt +++ b/templates/postfix/allowlist.txt.j2 @@ -1,4 +1,4 @@ -# {{ ansible_managed }} +{{ ansible_managed | comment }} {% for domain in postfix_tls_helper_allowlist %} {{ domain }} diff --git a/templates/postfix/conf.d/authorized_submit_users.j2 b/templates/postfix/conf.d/authorized_submit_users.j2 index 062b8b8..6f5da8a 100644 --- a/templates/postfix/conf.d/authorized_submit_users.j2 +++ b/templates/postfix/conf.d/authorized_submit_users.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_authorized_submit_users is defined %} {% for user in postfix_authorized_submit_users %} diff --git a/templates/postfix/conf.d/bad_smtp_auth_users.j2 b/templates/postfix/conf.d/bad_smtp_auth_users.j2 index 55ba7ae..1e8880b 100644 --- a/templates/postfix/conf.d/bad_smtp_auth_users.j2 +++ b/templates/postfix/conf.d/bad_smtp_auth_users.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} # Use this file to block SMTP-Auth access for users. # Example: diff --git a/templates/postfix/conf.d/bogus_mx.j2 b/templates/postfix/conf.d/bogus_mx.j2 index 0679512..1c0be60 100644 --- a/templates/postfix/conf.d/bogus_mx.j2 +++ b/templates/postfix/conf.d/bogus_mx.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_bogus_mx is defined %} {% for mx in postfix_bogus_mx %} diff --git a/templates/postfix/conf.d/canonical.j2 b/templates/postfix/conf.d/canonical.j2 index 4505398..7152caf 100644 --- a/templates/postfix/conf.d/canonical.j2 +++ b/templates/postfix/conf.d/canonical.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_canonical is defined %} {% for map in postfix_canonical %} diff --git a/templates/postfix/conf.d/client_checks.j2 b/templates/postfix/conf.d/client_checks.j2 index afa40f3..2deef6a 100644 --- a/templates/postfix/conf.d/client_checks.j2 +++ b/templates/postfix/conf.d/client_checks.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} ### With this file you can allow or disallow clients to connect to the SMTP server. diff --git a/templates/postfix/conf.d/destination_limit.j2 b/templates/postfix/conf.d/destination_limit.j2 index 68f122f..122542c 100644 --- a/templates/postfix/conf.d/destination_limit.j2 +++ b/templates/postfix/conf.d/destination_limit.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_dlimit_domains is defined %} {% for domain in postfix_dlimit_domains %} diff --git a/templates/postfix/conf.d/header_add.j2 b/templates/postfix/conf.d/header_add.j2 index 79ce3a6..9b76b6e 100644 --- a/templates/postfix/conf.d/header_add.j2 +++ b/templates/postfix/conf.d/header_add.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_header_add is defined %} {% for header in postfix_header_add %} diff --git a/templates/postfix/conf.d/header_checks.j2 b/templates/postfix/conf.d/header_checks.j2 index e3c1ca3..c6e4342 100644 --- a/templates/postfix/conf.d/header_checks.j2 +++ b/templates/postfix/conf.d/header_checks.j2 @@ -1,4 +1,4 @@ -# Managed by Ansible +{{ ansible_managed | comment }} /^Content-(Disposition|Type).*name\s*=\s*"?([^;]*(\.|=2E)( ade|adp|asp|bas|bat|chm|cmd|com|cpl|dll|exe| diff --git a/templates/postfix/conf.d/header_treatment.j2 b/templates/postfix/conf.d/header_treatment.j2 index a5bd4ec..bf1882a 100644 --- a/templates/postfix/conf.d/header_treatment.j2 +++ b/templates/postfix/conf.d/header_treatment.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} # Remove sensible headers /^Mail-System-Version:/ IGNORE diff --git a/templates/postfix/conf.d/helo_checks.j2 b/templates/postfix/conf.d/helo_checks.j2 index 2833e1d..de0c8aa 100644 --- a/templates/postfix/conf.d/helo_checks.j2 +++ b/templates/postfix/conf.d/helo_checks.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_default_helo_checks is defined %} {% for check in postfix_default_helo_checks %} diff --git a/templates/postfix/conf.d/permit_sasl_login_mismatch.j2 b/templates/postfix/conf.d/permit_sasl_login_mismatch.j2 index 0bab62b..cddde1a 100644 --- a/templates/postfix/conf.d/permit_sasl_login_mismatch.j2 +++ b/templates/postfix/conf.d/permit_sasl_login_mismatch.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} ### Enable sender spoofing for selected accounts {% if postfix_permit_login_mismatch is defined %} diff --git a/templates/postfix/conf.d/postscreen_access.j2 b/templates/postfix/conf.d/postscreen_access.j2 index 1c1ce37..e1096d7 100644 --- a/templates/postfix/conf.d/postscreen_access.j2 +++ b/templates/postfix/conf.d/postscreen_access.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_default_postscreen_access is defined %} {% for source in postfix_default_postscreen_access %} diff --git a/templates/postfix/conf.d/relay_by_sender.j2 b/templates/postfix/conf.d/relay_by_sender.j2 index e1d1d72..3318b7c 100644 --- a/templates/postfix/conf.d/relay_by_sender.j2 +++ b/templates/postfix/conf.d/relay_by_sender.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} ### http://www.postfix.org/postconf.5.html#sender_dependent_relayhost_maps {% if postfix_relay_by_sender is defined %} diff --git a/templates/postfix/conf.d/relay_checks.j2 b/templates/postfix/conf.d/relay_checks.j2 index 75dfe63..5c02948 100644 --- a/templates/postfix/conf.d/relay_checks.j2 +++ b/templates/postfix/conf.d/relay_checks.j2 @@ -1 +1 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} diff --git a/templates/postfix/conf.d/relay_domains.j2 b/templates/postfix/conf.d/relay_domains.j2 index 6f9983a..3313da6 100644 --- a/templates/postfix/conf.d/relay_domains.j2 +++ b/templates/postfix/conf.d/relay_domains.j2 @@ -1,4 +1,4 @@ -# {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_domains is defined %} {% for domain in postfix_domains %} diff --git a/templates/postfix/conf.d/sender_canonical.j2 b/templates/postfix/conf.d/sender_canonical.j2 index 0077ddf..606c185 100644 --- a/templates/postfix/conf.d/sender_canonical.j2 +++ b/templates/postfix/conf.d/sender_canonical.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_sender_canonical is defined %} {% for map in postfix_sender_canonical %} diff --git a/templates/postfix/conf.d/sender_checks.j2 b/templates/postfix/conf.d/sender_checks.j2 index 8ba408e..a7495f3 100644 --- a/templates/postfix/conf.d/sender_checks.j2 +++ b/templates/postfix/conf.d/sender_checks.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_sender_checks is defined %} {% for sender in postfix_sender_checks %} diff --git a/templates/postfix/conf.d/smtp_sasl_auth_password.j2 b/templates/postfix/conf.d/smtp_sasl_auth_password.j2 index f5a68a4..00f40bc 100644 --- a/templates/postfix/conf.d/smtp_sasl_auth_password.j2 +++ b/templates/postfix/conf.d/smtp_sasl_auth_password.j2 @@ -1,4 +1,4 @@ -#{{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_smtp_sasl_auth_enabled is defined and postfix_smtp_sasl_auth_enabled %} {{ "%-50s %s:%s" | format(postfix_smtp_sasl_auth_relay, postfix_smtp_sasl_auth_user, postfix_smtp_sasl_auth_password) }} diff --git a/templates/postfix/conf.d/transport_global_exceptions.j2 b/templates/postfix/conf.d/transport_global_exceptions.j2 index c3052f0..8c8c830 100644 --- a/templates/postfix/conf.d/transport_global_exceptions.j2 +++ b/templates/postfix/conf.d/transport_global_exceptions.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} # Use this file for mail addresses that should be treated specially. diff --git a/templates/postfix/conf.d/transport_relay.j2 b/templates/postfix/conf.d/transport_relay.j2 index decb42d..ea4730f 100644 --- a/templates/postfix/conf.d/transport_relay.j2 +++ b/templates/postfix/conf.d/transport_relay.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_domains is defined %} {% for domain in postfix_domains %} diff --git a/templates/postfix/conf.d/transport_tor.j2 b/templates/postfix/conf.d/transport_tor.j2 index b802048..d81c48a 100644 --- a/templates/postfix/conf.d/transport_tor.j2 +++ b/templates/postfix/conf.d/transport_tor.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_default_transport_tor_domains is defined %} {% for domain in postfix_default_transport_tor_domains %} diff --git a/templates/postfix/conf.d/virtual_aliases.j2 b/templates/postfix/conf.d/virtual_aliases.j2 index f2dcd31..22e4f1a 100644 --- a/templates/postfix/conf.d/virtual_aliases.j2 +++ b/templates/postfix/conf.d/virtual_aliases.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} # Example # diff --git a/templates/postfix/conf.d/virtual_domains.j2 b/templates/postfix/conf.d/virtual_domains.j2 index f67c599..8483b73 100644 --- a/templates/postfix/conf.d/virtual_domains.j2 +++ b/templates/postfix/conf.d/virtual_domains.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} {% if postfix_domains is defined %} {% for domain in postfix_domains %} diff --git a/templates/postfix/main.cf.j2 b/templates/postfix/main.cf.j2 index 610b119..96f11b0 100644 --- a/templates/postfix/main.cf.j2 +++ b/templates/postfix/main.cf.j2 @@ -1,5 +1,5 @@ -### {{ ansible_managed }} -### {{ template_path }} +{{ ansible_managed | comment }} +{{ template_path | comment }} {% if postfix_smtp_banner is defined %} smtpd_banner = {{ postfix_smtpd_banner }} diff --git a/templates/postfix/master.cf b/templates/postfix/master.cf.j2 similarity index 99% rename from templates/postfix/master.cf rename to templates/postfix/master.cf.j2 index 8869d6a..fa15c61 100644 --- a/templates/postfix/master.cf +++ b/templates/postfix/master.cf.j2 @@ -1,4 +1,4 @@ -### {{ ansible_managed }} +{{ ansible_managed | comment }} # ========================================================================== # service type private unpriv chroot wakeup maxproc command + args