Ashish Jaiswal
2014-Nov-07  11:15 UTC
[Puppet Users] Puppet custom function for arithmetic operation
Hello,
Just trying to write a custom function. Basically looking to pass an 
argument from manifest and value should get calculated.
module Puppet::Parser::Functions
         newfunction(:shmmax, :type => :rvalue) do |args|
                 def shmmax(args)
                         product = args * 1024 * 1024 * 1024
                         return product
                 end
         end
end
@ foo.pp
     $shmmax_variable = shmmax(2)
     sysctl { "kernel.shmmax"        :       val =>
$shmmax_variable }
In this case I'm expecting a value of 2147483648 for kernel.shmmax in 
sysctl.conf file
Its just fails, Any pointer what is wrong here ?
Regards,
Ashish Jaiswal.
-- 
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/545CA9BE.4010600%40gmail.com.
For more options, visit https://groups.google.com/d/optout.