On 2011-11-15 07:24 , Tom Hall wrote: > Hi, > > Can you round in variable assignment expressions? > > I would like to be able to set > > $my_var = floor(::processorcount * 0.8) > > Cheers, > Tom >
That should work just fine as long as you define an rvalue function called 'floor'. There should be a bunch of good examples of how to do this in the stdlib[0] repo in lib/puppet/parser/functions. [0] https://github.com/puppetlabs/puppetlabs-stdlib/ -- Jacob Helwig http://about.me/jhelwig
signature.asc
Description: OpenPGP digital signature