Ask Your Question

how to get string from local(not puppet server)and store in manifest

asked 2017-08-19 02:40:29 -0600

gra gravatar image

hi all

i would like to use value from local content. the purpose is use file resource's content value

like below

$content_value = cat /file

file{'/file': content => $content_value, notify => Exex['my notify'] }

exec{'my notify'}

/file is from download internet and extract then created. so , puppet server dont know the content.

relally i would like to realize is if the file md5 is changed execute exec resource that's means i woud like to know the file in archive is change or not.

custom function do work server side , not client(local) side. so i dont know if how realize this. have anyone good idea?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-08-19 11:31:19 -0600

bess gravatar image

You cannot do this. Variables are interpolated on the Master, not agent. Same goes for functions.

Only way to get this data via custom facts. Write a fact that executes 'cat' and returns the result as a variable. Facts can also return arrays and hashes.

edit flag offensive delete link more

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: 2017-08-19 02:40:29 -0600

Seen: 16 times

Last updated: Aug 19 '17