diff options
-rw-r--r-- | lib/puppet/parser/functions/basename.rb (renamed from plugins/puppet/parser/functions/basename.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/dirname.rb (renamed from plugins/puppet/parser/functions/dirname.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/gsub.rb (renamed from plugins/puppet/parser/functions/gsub.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/hostname.rb | 13 | ||||
-rw-r--r-- | lib/puppet/parser/functions/prefix_with.rb (renamed from plugins/puppet/parser/functions/prefix_with.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/re_escape.rb (renamed from plugins/puppet/parser/functions/re_escape.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/sha1.rb (renamed from plugins/puppet/parser/functions/sha1.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/slash_escape.rb (renamed from plugins/puppet/parser/functions/slash_escape.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/split.rb (renamed from plugins/puppet/parser/functions/split.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/strlength.rb (renamed from plugins/puppet/parser/functions/strlength.rb) | 0 | ||||
-rw-r--r-- | lib/puppet/parser/functions/substitute.rb (renamed from plugins/puppet/parser/functions/substitute.rb) | 0 | ||||
-rw-r--r-- | manifests/classes/lsb_release.pp | 39 |
12 files changed, 13 insertions, 39 deletions
diff --git a/plugins/puppet/parser/functions/basename.rb b/lib/puppet/parser/functions/basename.rb index 226d6e5..226d6e5 100644 --- a/plugins/puppet/parser/functions/basename.rb +++ b/lib/puppet/parser/functions/basename.rb diff --git a/plugins/puppet/parser/functions/dirname.rb b/lib/puppet/parser/functions/dirname.rb index 44b4a00..44b4a00 100644 --- a/plugins/puppet/parser/functions/dirname.rb +++ b/lib/puppet/parser/functions/dirname.rb diff --git a/plugins/puppet/parser/functions/gsub.rb b/lib/puppet/parser/functions/gsub.rb index e2410ff..e2410ff 100644 --- a/plugins/puppet/parser/functions/gsub.rb +++ b/lib/puppet/parser/functions/gsub.rb diff --git a/lib/puppet/parser/functions/hostname.rb b/lib/puppet/parser/functions/hostname.rb new file mode 100644 index 0000000..7bc477f --- /dev/null +++ b/lib/puppet/parser/functions/hostname.rb @@ -0,0 +1,13 @@ +# get an uniq array of ipaddresses for a hostname +require 'resolv' + +module Puppet::Parser::Functions + newfunction(:hostname, :type => :rvalue) do |args| + res = Array.new + Resolv::DNS.new.each_address(args[0]){ |addr| + res << addr + } + res.uniq + end +end + diff --git a/plugins/puppet/parser/functions/prefix_with.rb b/lib/puppet/parser/functions/prefix_with.rb index 6e64a4a..6e64a4a 100644 --- a/plugins/puppet/parser/functions/prefix_with.rb +++ b/lib/puppet/parser/functions/prefix_with.rb diff --git a/plugins/puppet/parser/functions/re_escape.rb b/lib/puppet/parser/functions/re_escape.rb index 6e5904b..6e5904b 100644 --- a/plugins/puppet/parser/functions/re_escape.rb +++ b/lib/puppet/parser/functions/re_escape.rb diff --git a/plugins/puppet/parser/functions/sha1.rb b/lib/puppet/parser/functions/sha1.rb index b5aa813..b5aa813 100644 --- a/plugins/puppet/parser/functions/sha1.rb +++ b/lib/puppet/parser/functions/sha1.rb diff --git a/plugins/puppet/parser/functions/slash_escape.rb b/lib/puppet/parser/functions/slash_escape.rb index 04d3b95..04d3b95 100644 --- a/plugins/puppet/parser/functions/slash_escape.rb +++ b/lib/puppet/parser/functions/slash_escape.rb diff --git a/plugins/puppet/parser/functions/split.rb b/lib/puppet/parser/functions/split.rb index 5237c92..5237c92 100644 --- a/plugins/puppet/parser/functions/split.rb +++ b/lib/puppet/parser/functions/split.rb diff --git a/plugins/puppet/parser/functions/strlength.rb b/lib/puppet/parser/functions/strlength.rb index 147b24a..147b24a 100644 --- a/plugins/puppet/parser/functions/strlength.rb +++ b/lib/puppet/parser/functions/strlength.rb diff --git a/plugins/puppet/parser/functions/substitute.rb b/lib/puppet/parser/functions/substitute.rb index 4c97def..4c97def 100644 --- a/plugins/puppet/parser/functions/substitute.rb +++ b/lib/puppet/parser/functions/substitute.rb diff --git a/manifests/classes/lsb_release.pp b/manifests/classes/lsb_release.pp deleted file mode 100644 index 73a9114..0000000 --- a/manifests/classes/lsb_release.pp +++ /dev/null @@ -1,39 +0,0 @@ -# common/manifests/classes/lsb_release.pp -- request the installation of -# lsb_release to get to lsbdistcodename, which is used throughout the manifests -# -# Copyright (C) 2007 David Schmitt <david@schmitt.edv-bus.at> -# See LICENSE for the full license granted to you. - -# Changelog: -# 2007-08-26: micah <micah@riseup.net> reported, that lsb_release can report -# nonsensical values for lsbdistcodename; assert_lsbdistcodename now -# recognises "n/a" and acts accordingly - -# This lightweight class only asserts that $lsbdistcodename is set. -# If the assertion fails, an error is printed on the server -# -# To fail individual resources on a missing lsbdistcodename, require -# Exec[assert_lsbdistcodename] on the specific resource -class assert_lsbdistcodename { - - case $lsbdistcodename { - '': { - err("Please install lsb_release or set facter_lsbdistcodename in the environment of $fqdn") - } - 'n/a': { - case $operatingsystem { - "Debian": { - err("lsb_release was unable to report your distcodename; This seems to indicate a broken apt/sources.list on $fqdn") - } - default: { - err("lsb_release was unable to report your distcodename; please set facter_lsbdistcodename in the environment of $fqdn") - } - } - exec { "false # assert_lsbdistcodename": alias => assert_lsbdistcodename } - } - } - -} - -# To fail the complete compilation, include this class -class require_lsbdistcodename inherits assert_lsbdistcodename {} |