Thursday, March 8, 2012

Tip: Joining lists in Puppet

Tip of the day: joining lists in Puppet
node default { include test } class test { $list = ['foo','bar',undef,'4',undef,'six'] $joined = inline_template("<%= (list).reject{|x| x == :undef} %>") notify{"see $joined":} }

No comments:

Post a Comment