From: mh Date: Sat, 31 Oct 2009 14:16:37 +0000 (+0100) Subject: move plugin directory to fit new 0.25 style X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=97e15ea5a84bf414529e110a4215d9fe7f9f20e0;p=puppet-common.git move plugin directory to fit new 0.25 style --- diff --git a/plugins/puppet/parser/functions/basename.rb b/lib/puppet/parser/functions/basename.rb similarity index 100% rename from plugins/puppet/parser/functions/basename.rb rename to lib/puppet/parser/functions/basename.rb diff --git a/plugins/puppet/parser/functions/dirname.rb b/lib/puppet/parser/functions/dirname.rb similarity index 100% rename from plugins/puppet/parser/functions/dirname.rb rename to lib/puppet/parser/functions/dirname.rb diff --git a/plugins/puppet/parser/functions/gsub.rb b/lib/puppet/parser/functions/gsub.rb similarity index 100% rename from plugins/puppet/parser/functions/gsub.rb rename to 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 similarity index 100% rename from plugins/puppet/parser/functions/prefix_with.rb rename to 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 similarity index 100% rename from plugins/puppet/parser/functions/re_escape.rb rename to lib/puppet/parser/functions/re_escape.rb diff --git a/plugins/puppet/parser/functions/sha1.rb b/lib/puppet/parser/functions/sha1.rb similarity index 100% rename from plugins/puppet/parser/functions/sha1.rb rename to lib/puppet/parser/functions/sha1.rb diff --git a/plugins/puppet/parser/functions/slash_escape.rb b/lib/puppet/parser/functions/slash_escape.rb similarity index 100% rename from plugins/puppet/parser/functions/slash_escape.rb rename to lib/puppet/parser/functions/slash_escape.rb diff --git a/plugins/puppet/parser/functions/split.rb b/lib/puppet/parser/functions/split.rb similarity index 100% rename from plugins/puppet/parser/functions/split.rb rename to lib/puppet/parser/functions/split.rb diff --git a/plugins/puppet/parser/functions/strlength.rb b/lib/puppet/parser/functions/strlength.rb similarity index 100% rename from plugins/puppet/parser/functions/strlength.rb rename to lib/puppet/parser/functions/strlength.rb diff --git a/plugins/puppet/parser/functions/substitute.rb b/lib/puppet/parser/functions/substitute.rb similarity index 100% rename from plugins/puppet/parser/functions/substitute.rb rename to 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 -# See LICENSE for the full license granted to you. - -# Changelog: -# 2007-08-26: micah 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 {}