Last modified: 2013-10-09 15:40:18 UTC
deployment-cache-upload03 is setup with the following classes: role::cache::upload puppetmaster::self $squid_coss_disks = vdb When running puppet it complains about get_var not being a function: err: Could not retrieve catalog from remote server: Error 400 on SERVER: Unknown function get_var at /etc/puppet/manifests/squid.pp:16 on node i-0000034b.pmtpa.wmflabs The relevant line is: # FIXME: Hack for arrays in LDAP - you suck puppet $squid_coss_disks = split(get_var('squid_coss_disks'), ',') Instance runs Lucid and puppet 2.7.7
The doc at http://projects.puppetlabs.com/projects/puppet/wiki/LDAP_Nodes says we must add an extension to puppet parser, maybe it is missing when using puppetmaster::self. By default the puppetVar LDAP attribute does not support arrays. In order to support an array with puppetVar you must add these two functions to your puppetmaster. /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/get_var.rb: # Evaluate the value of a variable that might have been defined globally. module Puppet::Parser::Functions newfunction(:get_var, :type => :rvalue) do |args| var = args[0] global_var = lookupvar(var) if global_var != "" and global_var != nil case global_var when "true" return true when "false" return false else return global_var end end if args.length > 1 return args[1] end return "" end end /usr/lib/ruby/site_ruby/1.8/puppet/parser/functions/split.rb: # Split a string variable into an array using the specified split # character. # # Usage: # # $string = 'value1,value2' # $array_var = split($string, ',') # # $array_var holds the result ['value1', 'value2'] # module Puppet::Parser::Functions newfunction(:split, :type => :rvalue) do |args| return args[0].split(args[1]) end end
beta is no more using puppet manifest for the upload cache
Change 88698 had a related patch set uploaded by Ori.livneh: Remove unused (and broken) labs config from squid manifest https://gerrit.wikimedia.org/r/88698