diff options
author | Dan Fandrich <danf@mageia.org> | 2024-10-04 19:28:06 -0700 |
---|---|---|
committer | Dan Fandrich <danf@mageia.org> | 2024-10-04 19:28:06 -0700 |
commit | 2c7da66570999dcd21f11f976dc6ec27d820f45c (patch) | |
tree | b97dd9f25df691c66b2be31b658cc6fec638d47e /modules/postfix/templates | |
parent | a69863ece1973cf3eae488f30c657b57dfb89779 (diff) | |
download | puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar.gz puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar.bz2 puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.tar.xz puppet-2c7da66570999dcd21f11f976dc6ec27d820f45c.zip |
Use @ when accessing variables in templates
Access without the @ symbol is the older method and is discouraged.
Diffstat (limited to 'modules/postfix/templates')
-rw-r--r-- | modules/postfix/templates/group_aliases.conf | 10 | ||||
-rw-r--r-- | modules/postfix/templates/ldap_aliases.conf | 12 | ||||
-rw-r--r-- | modules/postfix/templates/main.cf | 22 | ||||
-rw-r--r-- | modules/postfix/templates/simple_relay_main.cf | 6 | ||||
-rw-r--r-- | modules/postfix/templates/sympa_aliases | 6 | ||||
-rw-r--r-- | modules/postfix/templates/transport_regexp | 8 | ||||
-rw-r--r-- | modules/postfix/templates/virtual_aliases | 20 |
7 files changed, 42 insertions, 42 deletions
diff --git a/modules/postfix/templates/group_aliases.conf b/modules/postfix/templates/group_aliases.conf index eac16dab..a230a070 100644 --- a/modules/postfix/templates/group_aliases.conf +++ b/modules/postfix/templates/group_aliases.conf @@ -1,15 +1,15 @@ <%- ldap = ldap_servers.map { |l| "ldaps://#{l}:636" } -%> -server_host = <%= ldap.join(' ') %> -search_base = <%= dc_suffix %> +server_host = <%= @ldap.join(' ') %> +search_base = <%= @dc_suffix %> query_filter = (&(cn=mga-%u)(objectClass=groupOfNames)) result_attribute = mail special_result_attribute = member bind = yes -bind_dn = cn=postfix-<%= hostname %>,ou=System Accounts,<%= dc_suffix %> -bind_pw = <%= ldap_password %> +bind_dn = cn=postfix-<%= @hostname %>,ou=System Accounts,<%= @dc_suffix %> +bind_pw = <%= @ldap_password %> # postfix complain on url # warning: dict_ldap_open: URL scheme ldaps requires protocol version 3 version = 3 -domain = group.<%= domain %> +domain = group.<%= @domain %> diff --git a/modules/postfix/templates/ldap_aliases.conf b/modules/postfix/templates/ldap_aliases.conf index 40d7da13..232cf02e 100644 --- a/modules/postfix/templates/ldap_aliases.conf +++ b/modules/postfix/templates/ldap_aliases.conf @@ -7,14 +7,14 @@ end ldap = ldap_servers.map { |l| "ldaps://#{l}:636" } -%> -server_host = <%= ldap.join(' ') %> -search_base = <%= dc_suffix %> -query_filter = (&(uid=%u)(|<%= query_string %>)) +server_host = <%= @ldap.join(' ') %> +search_base = <%= @dc_suffix %> +query_filter = (&(uid=%u)(|<%= @query_string %>)) result_attribute = mail bind = yes -bind_dn = cn=postfix-<%= hostname %>,ou=System Accounts,<%= dc_suffix %> -bind_pw = <%= ldap_password %> +bind_dn = cn=postfix-<%= @hostname %>,ou=System Accounts,<%= @dc_suffix %> +bind_pw = <%= @ldap_password %> # postfix complain on url # warning: dict_ldap_open: URL scheme ldaps requires protocol version 3 version = 3 -domain = <%= domain %> +domain = <%= @domain %> diff --git a/modules/postfix/templates/main.cf b/modules/postfix/templates/main.cf index 7fe0f073..9fe072b2 100644 --- a/modules/postfix/templates/main.cf +++ b/modules/postfix/templates/main.cf @@ -21,7 +21,7 @@ mailq_path = /usr/bin/mailq queue_directory = /var/spool/postfix mail_owner = postfix <% if all_tags.include?('postfix::simple_relay') || all_tags.include?('postfix::server::secondary') %> -relayhost = sucuk.<%= domain %> +relayhost = sucuk.<%= @domain %> <%- end -%> # User configurable parameters @@ -40,21 +40,21 @@ smtp_address_preference = ipv4 # FIXME Do not hardcode this mynetworks = 212.85.158.144/28 [2a02:2178:2:7::]/64 127.0.0.1 163.172.148.228 [2001:bc8:4400:2800::4115] -myhostname = <%= fqdn %> -mydomain = <%= domain %> +myhostname = <%= @fqdn %> +mydomain = <%= @domain %> <%- if all_tags.include?('postfix::server::secondary') -%> -relay_domains = <%= domain %>, - ml.<%= domain %>, - group.<%= domain %> +relay_domains = <%= @domain %>, + ml.<%= @domain %>, + group.<%= @domain %> <%- end -%> -mydestination = <%= fqdn %> - ml.<%= domain %> +mydestination = <%= @fqdn %> + ml.<%= @domain %> <%- if all_tags.include?('postfix::server::primary') -%> -virtual_mailbox_domains = <%= domain %>, - group.<%= domain %> +virtual_mailbox_domains = <%= @domain %>, + group.<%= @domain %> # postfix complain if not set # Mar 22 23:51:20 alamut postfix/virtual[22952]: fatal: bad string length 0 < 1: virtual_mailbox_base = @@ -98,7 +98,7 @@ sympabounce_destination_recipient_limit = 1 <%- end -%> #delay_warning_time = 4h -smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (<%= lsbdistid %>) +smtpd_banner = $myhostname ESMTP $mail_name ($mail_version) (<%= @lsbdistid %>) unknown_local_recipient_reject_code = 450 smtp-filter_destination_concurrency_limit = 2 lmtp-filter_destination_concurrency_limit = 2 diff --git a/modules/postfix/templates/simple_relay_main.cf b/modules/postfix/templates/simple_relay_main.cf index e0c116a7..331166c2 100644 --- a/modules/postfix/templates/simple_relay_main.cf +++ b/modules/postfix/templates/simple_relay_main.cf @@ -20,8 +20,8 @@ mail_owner = postfix # User configurable parameters -myhostname = <%= fqdn %> -mydomain = <%= domain %> +myhostname = <%= @fqdn %> +mydomain = <%= @domain %> inet_protocols = all mynetworks_style = host #delay_warning_time = 4h @@ -38,7 +38,7 @@ smtpd_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt local_recipient_maps = fallback_transport_maps = regexp:/etc/postfix/transport_regexp transport_maps = regexp:/etc/postfix/transport_regexp -mydestination = ml.<%= domain %> +mydestination = ml.<%= @domain %> sympa_destination_recipient_limit = 1 sympabounce_destination_recipient_limit = 1 virtual_alias_maps = regexp:/etc/postfix/sympa_aliases diff --git a/modules/postfix/templates/sympa_aliases b/modules/postfix/templates/sympa_aliases index 436e7a28..63650c84 100644 --- a/modules/postfix/templates/sympa_aliases +++ b/modules/postfix/templates/sympa_aliases @@ -1,8 +1,8 @@ # everything is handled with transports in postfix, # but according to https://www.sympa.org/faq/postfix, we also need this one <% escaped_domain = ( 'ml.' + domain ).sub('.','\.') %> -/^(.*)-owner\@<%= escaped_domain %>$/ $1+owner@ml.<%= domain %> +/^(.*)-owner\@<%= @escaped_domain %>$/ $1+owner@ml.<%= @domain %> # redirect the mail from the ml domain to sysadmin -/^listmaster\@<%= escaped_domain %>$/ listmaster@<%= domain %> +/^listmaster\@<%= @escaped_domain %>$/ listmaster@<%= @domain %> # errors are sent there, so that should also be redirected -/^sympa-request\@<%= escaped_domain %>$/ listmaster@<%= domain %> +/^sympa-request\@<%= @escaped_domain %>$/ listmaster@<%= @domain %> diff --git a/modules/postfix/templates/transport_regexp b/modules/postfix/templates/transport_regexp index 3eb5494f..941b77df 100644 --- a/modules/postfix/templates/transport_regexp +++ b/modules/postfix/templates/transport_regexp @@ -2,9 +2,9 @@ ml_domain = 'ml\.' + domain.gsub('.','\.') %> <%- if classes.include?('sympa::server') -%> -/^.*+owner\@<%= ml_domain %>$/ sympabounce: -/^bounce+.*\@<%= ml_domain %>$/ sympabounce: -/^.*\@<%= ml_domain %>$/ sympa: +/^.*+owner\@<%= @ml_domain %>$/ sympabounce: +/^bounce+.*\@<%= @ml_domain %>$/ sympabounce: +/^.*\@<%= @ml_domain %>$/ sympa: <%- else -%> -/^.*\@<%= ml_domain %>$/ smtp:sucuk.mageia.org +/^.*\@<%= @ml_domain %>$/ smtp:sucuk.mageia.org <%- end -%> diff --git a/modules/postfix/templates/virtual_aliases b/modules/postfix/templates/virtual_aliases index 861e79c6..a3c9d125 100644 --- a/modules/postfix/templates/virtual_aliases +++ b/modules/postfix/templates/virtual_aliases @@ -1,32 +1,32 @@ # do not forget to add $domain or it will not work # do not hardcode the domain, or it will be harvested by bot -treasurer@<%= domain %> treasurer@group.<%= domain %> -president@<%= domain %> ennael@<%= domain %> -secretary@<%= domain %> obgr_seneca@<%= domain %> +treasurer@<%= @domain %> treasurer@group.<%= @domain %> +president@<%= @domain %> ennael@<%= @domain %> +secretary@<%= @domain %> obgr_seneca@<%= @domain %> -contact@<%= domain %> council@group.<%= domain %> -press@<%= domain %> council@group.<%= domain %> +contact@<%= @domain %> council@group.<%= @domain %> +press@<%= @domain %> council@group.<%= @domain %> # later switch to a team alias -root@<%= domain %> sysadmin@group.<%= domain %> +root@<%= @domain %> sysadmin@group.<%= @domain %> -security@<%= domain %> security@group.<%= domain %> +security@<%= @domain %> security@group.<%= @domain %> # Temporary(?) alias until there is a real board-commits@ list -board-commits@ml.<%= domain %> board-public@ml.<%= domain %> +board-commits@ml.<%= @domain %> board-public@ml.<%= @domain %> # TODO see https://www.ietf.org/rfc/rfc2142.txt <% ['postmaster','hostmaster','abuse','noc','listmaster','MAILER-DAEMON'].each { |a| %> -<%= a %>@<%= domain %> root@<%= domain %> +<%= @a %>@<%= @domain %> root@<%= @domain %> <% } ['webmaster','www'].each { |a| %> -<%= a %>@<%= domain %> web@group.<%= domain %> +<%= @a %>@<%= @domain %> web@group.<%= @domain %> <% } %> # TODO : |