Your template file should look something like:

$restricted <%= fqdn %>
$ideal_load <%= num_cpu.to_i + 0.5 %>
$max_load <%= num_cpu.to_i * 1.2 %>

(the to_i is to ensure the conversion to integer - as I'm not sure
what the input data looks like :-)

Read the docs to get the full picture:

http://docs.puppetlabs.com/guides/templating.html

ken.

On Wed, Jun 15, 2011 at 12:22 PM, Sans <r.santanu....@gmail.com> wrote:
> I've added a custom fact, namely "num_cpu",  to Facter and
> pluginsync'ing to distribute to the clients. Now I want to write a
> template (as the num_cpu differs from client to client) file, which
> will generate a file like this, in return:
>
>
> $restricted myserv.ac.uk
> $ideal_load 8.5
> $max_load 9.6
>
>
> for values for $ideal_load and $max_load are calculated like this:
> "num_cpu + 0.5" and "num_cpu * 1.2" respectively. Can anyone give me
> some idea how should I do that please? Cheers!!
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to 
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to