Re: generate with spaces?

Luke Kanies
Thu, 24 Jan 2008 04:10:27 -0000

On Jan 24, 2008, at 8:38 AM, Gary Richardson wrote:

> I hit another snag with this. It seems that generate() doesn''t
strip
> the \n''s off the end of the output. I was trying to:
>
> exec { ["mkhomedir -s $skel -u $uid -g $gid -h $home_dir -m
$mode"] :
>
> and it kept trying to execute mkhomedir -s /etc/skel, then -u 1000,
> then -g 1000 etc.. Is there a way to strip the \n off of a variable
> inside puppet? Would this be considered a bug with generate?

Use a function insead of a generator; then you have total control of
the output.

See the wiki page that''s something like WritingYourOwnFunctions.

--
Men never do evil so completely and cheerfully as when they do it from a
religious conviction. --Blaise Pascal
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com