Remove smarthost_port from nodeinfo
authorPeter Palfrader <peter@palfrader.org>
Sat, 21 Sep 2019 16:18:59 +0000 (18:18 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 21 Sep 2019 16:21:16 +0000 (18:21 +0200)
modules/exim/manifests/init.pp
modules/exim/templates/eximconf.erb
modules/puppetmaster/lib/puppet/parser/functions/yamlinfo.rb

index a76653e..fec2db5 100644 (file)
@@ -4,6 +4,7 @@ class exim (
   Boolean $is_rtmaster = false,
   Boolean $is_packagesmaster = false,
   Boolean $is_packagesqamaster = false,
+  Integer $smarthost_port = 587,
 ) {
   include exim::vdomain::setup
   include debian_org::mail_incoming_port
index bea1faa..c8be351 100644 (file)
@@ -229,7 +229,7 @@ if not scope.lookupvar('deprecated::nodeinfo')['mail_port'].to_s.empty?
 end
 
 if @is_mailrelay
-  ports << scope.lookupvar('deprecated::nodeinfo')['smarthost_port']
+  ports << @smarthost_port
 end
 
 out += ports.uniq.sort.join(" : ")
@@ -1577,24 +1577,17 @@ remote_smtp:
   tls_certificate = /etc/exim4/ssl/thishost.crt
   tls_privatekey = /etc/exim4/ssl/thishost.key
 
-<%=
-out = ""
-if not scope.lookupvar('deprecated::nodeinfo')['smarthost'].empty?
-out = '
+<%- if not scope.lookupvar('deprecated::nodeinfo')['smarthost'].empty? -%>
 remote_smtp_smarthost:
   debug_print = "T: remote_smtp_smarthost for $local_part@$domain"
   driver = smtp
   delay_after_cutoff = false
-  port = '
-  out += scope.lookupvar('deprecated::nodeinfo')['smarthost_port'].to_s + "\n"
-  out += '  tls_tempfail_tryclear = false
+  port = <%= @marthost_port -%>
+  tls_tempfail_tryclear = false
   hosts_require_tls = ' + scope.lookupvar('deprecated::nodeinfo')['smarthost'] + '
   tls_certificate = /etc/exim4/ssl/thishost.crt
   tls_privatekey = /etc/exim4/ssl/thishost.key
-'
-end
-out
-%>
+<%- end -%>
 # Send the message to procmail
 procmail_pipe:
   driver = pipe
index 42a4795..5839b75 100644 (file)
@@ -26,7 +26,6 @@ module Puppet::Parser::Functions
       results['mail_port']      = ''
       results['smarthost']      = ''
       results['heavy_exim']     = ''
-      results['smarthost_port'] = 587
 
       if yaml['host_settings'].kind_of?(Hash)
         yaml['host_settings'].each_pair do |property, values|