Ask Your Question
0

multiply function in puppet

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

Chutki gravatar image

Hi,

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

I have below line in my manifests

$value=$::memorysize*0.9

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
4

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

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

Comments

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 -0500 )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

Stats

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

Seen: 820 times

Last updated: Jan 21 '15