Sha256: c0634688c851c664d866fb40641f352adf3300bada2093cf3d22af453eb258b6
Contents?: true
Size: 653 Bytes
Versions: 23
Compression:
Stored size: 653 Bytes
Contents
# Translates module name to proper class name # This is especially useful if you want to give a nice name to # a configuration option and still want to use some class with # less readable name e.g. puppetmaster -> puppet::server # - if the argument matches known module name, it returns corresponding class name # - otherwise it returns argument that was specified # module Puppet::Parser::Functions newfunction(:class_name, :type => :rvalue) do |args| mapping = YAML.load_file(lookupvar('kafo_config_file'))[:mapping] mod = args[0].to_sym mapping[mod].nil? ? mod : "#{mapping[mod][:dir_name]}::#{mapping[mod][:manifest_name]}" end end
Version data entries
23 entries across 23 versions & 1 rubygems