On Thu, 21 Jul 2011 16:10:02 -0400, David Kavanagh wrote: > > I need to convert a value from facter to lower case for inclusion in a > path. Is there a built-in function for that? > > David >
Hm...doesn't actually look like there is. % ls -1 lib/puppet/parser/functions create_resources.rb defined.rb extlookup.rb fail.rb file.rb fqdn_rand.rb generate.rb include.rb inline_template.rb md5.rb realize.rb regsubst.rb require.rb search.rb sha1.rb shellquote.rb split.rb sprintf.rb tagged.rb tag.rb template.rb versioncmp.rb It would be pretty easy to add a custom function that does this (and we really should have to_lower, and to_upper functions that are available out of the box). In the meantime, you should be able to do this with something like (replacing upcase with downcase): file { "/tmp/bar": ensure => file, content => inline_template("<%= hostname.upcase %>") } This was only tested against the current master branch of Puppet, so your mileage may vary. -- Jacob Helwig ,---- | Join us for PuppetConf, September 22nd and 23rd in Portland, OR | http://bit.ly/puppetconfsig `----
signature.asc
Description: Digital signature