saving copy of template on puppetmaster

19 views
Skip to first unread message

warden

unread,
Nov 21, 2013, 12:55:51 PM11/21/13
to puppet...@googlegroups.com

I am using puppet to manage files on the nodes with the ERB templates. Plain old standard. What I need to do is to get a copy of the generated (parsed) template file on the puppet master server. What I want to achieve is that I want to see the current version of the file as it is on the client, but on the server...

I was going through the documentation but I didn't find anything useful. The closest thing was the "backup" feature of file resource what I think does exactly what I want, but for the previous version, not the current one.

so, by example, given the following definition:

file { "/some/file":
  source => template("sometemplate");
}

I want to have the /some/file contents on puppetmaster server too, not only on the client. I see in the docs that I can do something like:

$variable = template("xx");

but how to put that then in the file on the puppetmaster?

Felix Frank

unread,
Nov 25, 2013, 10:59:48 AM11/25/13
to puppet...@googlegroups.com
Hi,

you might use that to cobble something together (using generate?) but
that will most certainly end up very, very ugly.

Instead, you may want to look for the documentation on how to recompile
the catalog for a specific agent. You will need to configure the master
to keep the requests (including facts etc.) around.

The rendered template is part of the catalog.

If you have trouble finding the information, come back here and I'll
have a closer look.

HTH,
Felix
Reply all
Reply to author
Forward
0 new messages