projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
baeh puppet
[mirror/dsa-puppet.git]
/
modules
/
puppetmaster
/
lib
/
puppet
/
parser
/
functions
/
nodeinfo.rb
diff --git
a/modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb
b/modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb
index
5eb6c97
..
d77d65c
100644
(file)
--- a/
modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb
+++ b/
modules/puppetmaster/lib/puppet/parser/functions/nodeinfo.rb
@@
-1,8
+1,8
@@
module Puppet::Parser::Functions
newfunction(:nodeinfo, :type => :rvalue) do |args|
module Puppet::Parser::Functions
newfunction(:nodeinfo, :type => :rvalue) do |args|
+ host = args[0]
+ yamlfile = args[1]
begin
begin
- host = args[0]
- yamlfile = args[1]
require '/var/lib/puppet/lib/puppet/parser/functions/ldapinfo.rb'
require '/var/lib/puppet/lib/puppet/parser/functions/whohosts.rb'
require '/var/lib/puppet/lib/puppet/parser/functions/ldapinfo.rb'
require '/var/lib/puppet/lib/puppet/parser/functions/whohosts.rb'
@@
-13,12
+13,19
@@
module Puppet::Parser::Functions
raise Puppet::ParseError, "Host #{host} does not have ipHostNumber values in ldap"
end
nodeinfo['hoster'] = function_whohosts(nodeinfo['ldap']['ipHostNumber'], "/etc/puppet/modules/debian-org/misc/hoster.yaml")
raise Puppet::ParseError, "Host #{host} does not have ipHostNumber values in ldap"
end
nodeinfo['hoster'] = function_whohosts(nodeinfo['ldap']['ipHostNumber'], "/etc/puppet/modules/debian-org/misc/hoster.yaml")
+ nodeinfo['buildd'] = nodeinfo['ldap']['purpose'] && nodeinfo['ldap']['purpose'].include?('buildd')
+
+ if lookupvar('::mta') == 'exim4'
+ unless nodeinfo['heavy_exim']
+ nodeinfo['smarthost'] = 'mailout.debian.org'
+ end
+ end
nodeinfo['misc'] = {}
nodeinfo['misc'] = {}
- fqdn = lookupvar('fqdn')
+ fqdn = lookupvar('
::
fqdn')
if fqdn and fqdn == host
if fqdn and fqdn == host
- v4ips = lookupvar('v4ips')
- if v4ips
+ v4ips = lookupvar('
::
v4ips')
+ if v4ips
and v4ips.to_s != "" and v4ips.to_s != 'undefined'
nodeinfo['misc']['v4addrs'] = v4ips.split(',')
# find out if we are behind nat
nodeinfo['misc']['v4addrs'] = v4ips.split(',')
# find out if we are behind nat
@@
-26,8
+33,8
@@
module Puppet::Parser::Functions
nodeinfo['misc']['natted'] = intersection.empty?
end
nodeinfo['misc']['natted'] = intersection.empty?
end
- v6ips = lookupvar('v6ips')
- if v6ips and v6ips
!= "no"
+ v6ips = lookupvar('
::
v6ips')
+ if v6ips and v6ips
.to_s != "" and v6ips.to_s != 'undefined'
nodeinfo['misc']['v6addrs'] = v6ips.split(',')
end
end
nodeinfo['misc']['v6addrs'] = v6ips.split(',')
end
end
@@
-39,8
+46,8
@@
module Puppet::Parser::Functions
if nodeinfo['hoster']['allow_dns_query']
raise Puppet::ParseError, "No nameservers listed for #{nodeinfo['hoster']['name']} yet we should answer somebody's queries? That makes no sense."
end
if nodeinfo['hoster']['allow_dns_query']
raise Puppet::ParseError, "No nameservers listed for #{nodeinfo['hoster']['name']} yet we should answer somebody's queries? That makes no sense."
end
- elsif (nodeinfo['
hoster']['nameservers'] & nodeinfo['misc']['v4addrs']).size > 0
or
- (nodeinfo['
hoster']['nameservers'] & nodeinfo['misc']['v6addrs']).size > 0
+ elsif (nodeinfo['
misc']['v4addrs'] and (nodeinfo['hoster']['nameservers'] & nodeinfo['misc']['v4addrs']).size > 0)
or
+ (nodeinfo['
misc']['v6addrs'] and (nodeinfo['hoster']['nameservers'] & nodeinfo['misc']['v6addrs']).size > 0)
# this host is listed as a nameserver at this location
nodeinfo['misc']['resolver-recursive'] = true
# this host is listed as a nameserver at this location
nodeinfo['misc']['resolver-recursive'] = true
@@
-53,7
+60,7
@@
module Puppet::Parser::Functions
return(nodeinfo)
rescue => e
return(nodeinfo)
rescue => e
- raise Puppet::ParseError, "Error
while trying to match addr #{addr} for net #{net
}: #{e.message}\n#{e.backtrace}"
+ raise Puppet::ParseError, "Error
in nodeinfo for node #{host}, yamlfile #{yamlfile
}: #{e.message}\n#{e.backtrace}"
end
end
end
end
end
end