From e47ce1f1dcdac0f11cae0aff10e79ca64589ed37 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Thu, 7 May 2009 00:14:33 +0100 Subject: [PATCH] Pull the information out of the yaml file so we don't have to restart puppetmaster to move a service Signed-off-by: Stephen Gran --- .../lib/puppet/parser/functions/nodeinfo.rb | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb b/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb index 02c9e6173..91255b218 100644 --- a/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb +++ b/files/etc/puppet/lib/puppet/parser/functions/nodeinfo.rb @@ -21,11 +21,21 @@ module Puppet::Parser::Functions end end - results['bugsmaster'] = host == 'rietz.debian.org' - results['qamaster'] = host == 'merkel.debian.org' - results['mailrelay'] = host == 'spohr.debian.org' - results['rtmaster'] = host == 'spohr.debian.org' - results['packagesmaster'] = host == 'powell.debian.org' + if yaml.has_key?('services') + ['bugsmaster', 'qamaster', 'mailrelay', 'rtmaster', 'packagesmaster'].each do |service| + if yaml['services'].has_key?(service) + results[service] = host == yaml['services'][service] + end + end + end + + if yaml.has_key?('need_smarthost') and yaml['need_smarthost'].include?(host) + results['smarthost'] = "mailout.debian.org" + results['smarthost_port'] = 587 + else + results['smarthost'] = '' + results['smarthost_port'] = '' + end results['reservedaddrs'] = case host when "ball.debian.org" -- 2.20.1