move plugin directory to fit new 0.25 style
authormh <mh@immerda.ch>
Sat, 31 Oct 2009 14:16:37 +0000 (15:16 +0100)
committerMicah Anderson <micah@riseup.net>
Thu, 2 Sep 2010 22:11:43 +0000 (18:11 -0400)
12 files changed:
lib/puppet/parser/functions/basename.rb [moved from plugins/puppet/parser/functions/basename.rb with 100% similarity]
lib/puppet/parser/functions/dirname.rb [moved from plugins/puppet/parser/functions/dirname.rb with 100% similarity]
lib/puppet/parser/functions/gsub.rb [moved from plugins/puppet/parser/functions/gsub.rb with 100% similarity]
lib/puppet/parser/functions/hostname.rb [new file with mode: 0644]
lib/puppet/parser/functions/prefix_with.rb [moved from plugins/puppet/parser/functions/prefix_with.rb with 100% similarity]
lib/puppet/parser/functions/re_escape.rb [moved from plugins/puppet/parser/functions/re_escape.rb with 100% similarity]
lib/puppet/parser/functions/sha1.rb [moved from plugins/puppet/parser/functions/sha1.rb with 100% similarity]
lib/puppet/parser/functions/slash_escape.rb [moved from plugins/puppet/parser/functions/slash_escape.rb with 100% similarity]
lib/puppet/parser/functions/split.rb [moved from plugins/puppet/parser/functions/split.rb with 100% similarity]
lib/puppet/parser/functions/strlength.rb [moved from plugins/puppet/parser/functions/strlength.rb with 100% similarity]
lib/puppet/parser/functions/substitute.rb [moved from plugins/puppet/parser/functions/substitute.rb with 100% similarity]
manifests/classes/lsb_release.pp [deleted file]

diff --git a/lib/puppet/parser/functions/hostname.rb b/lib/puppet/parser/functions/hostname.rb
new file mode 100644 (file)
index 0000000..7bc477f
--- /dev/null
@@ -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/manifests/classes/lsb_release.pp b/manifests/classes/lsb_release.pp
deleted file mode 100644 (file)
index 73a9114..0000000
+++ /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 {}