Ask Your Question

multiply function in puppet

asked 2015-01-21 11:31:12 -0600

Chutki gravatar image


I have requirement for limit.conf like "create memlock item => 90%" means utilize 90% of memory size.

I have below line in my manifests


but I am getting "left operand of * is not a number at line 1 on node" error. so how i can achieve this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2015-01-21 11:48:01 -0600

GregLarkin gravatar image

Replace $::memorysize with $::memorysize_mb and you will be all set.

puppet apply -e 'notice($::memorysize_mb * 0.9)'
Notice: Scope(Class[main]): 14745.6
Notice: Compiled catalog for gregorys-mbp in environment production in 0.04 seconds
Notice: Finished catalog run in 0.01 seconds
edit flag offensive delete link more


I should have mentioned that the memorysize fact doesn't work because it's value includes a non-numeric unit, such as "GB".

GregLarkin gravatar imageGregLarkin ( 2015-01-21 13:08:32 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2015-01-21 11:31:12 -0600

Seen: 887 times

Last updated: Jan 21 '15