Thanks everyone for your quick responses to my questions. I''m trying to get templates working. I want to pull the template down from the puppet server, then use it. It looks like the require parameter is not being enforced when using the content parameter so the template can''t be found. This doesn''t work: file { "/etc/lighttpd/lighttpd.conf" : require => file["/var/lib/puppet/templates/lighttpd.conf.erb"], content => template("/var/lib/puppet/templates/lighttpd.conf.erb"), } file { "/var/lib/puppet/templates/lighttpd.conf.erb": path => "/var/lib/puppet/templates/lighttpd.conf.erb", source => "/tmp/lighttpd.conf.erb", } Whereas this does: file { "/etc/lighttpd/lighttpd.conf" : require => file["/var/lib/puppet/templates/lighttpd.conf.erb"], source => "/var/lib/puppet/templates/lighttpd.conf.erb", } file { "/var/lib/puppet/templates/lighttpd.conf.erb": path => "/var/lib/puppet/templates/lighttpd.conf.erb", source => "/tmp/lighttpd.conf.erb", } Am I missing something or should I file a bug report? Thanks, Christian
Christian G. Warden wrote:> Thanks everyone for your quick responses to my questions. > > I''m trying to get templates working. I want to pull the template down > from the puppet server, then use it. It looks like the require > parameter is not being enforced when using the content parameter so the > template can''t be found.Templates are compiled on the server, not on the client, so you don''t need to pull them down the client. Templates are entirely a function of the parser -- there is no difference to the client between using a template and specifying all of the file contents as a string. Your server has a ''templatedir'' setting (defaults to $vardir/templates, which is usually either /var/puppet/templates or /var/lib/puppet/templates, depending on /etc/puppet/puppetmasterd.conf). Just drop your templates in there, and the parser will automatically look there for unqualified templates (i.e., those with relative paths). Alternatively, you can always fully qualify your templates, but it''s always on the server. I''ll go over the templating docs to make sure this is clear. -- I used to get high on life but lately I''ve built up a resistance. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Luke Kanies <luke@madstop.com> writes:> I''ll go over the templating docs to make sure this is clear.FWIW, I was a little confused by that as well. While you are looking over the template doc please note that the examples have many "<" and ">" and other characters missing. It took awhile to figure out the correct template syntax. -Brett.
Brett Viren wrote:> While you are looking over the template doc please note that the > examples have many "<" and ">" and other characters missing. It took > awhile to figure out the correct template syntax.I blame this on BlueCloth, the Ruby markdown implementation. It seems to want to actually interpret the ERB example in the code, which I find painful and scary. I''ll recheck it, though, and see if I can make it work a bit better. Thanks. -- A conservative is a man who believes that nothing should be done for the first time. --Alfred E. Wiggam --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
On Fri, Sep 01, 2006 at 03:43:35PM -0500, Luke Kanies wrote:> Christian G. Warden wrote: > > Thanks everyone for your quick responses to my questions. > > > > I''m trying to get templates working. I want to pull the template down > > from the puppet server, then use it. It looks like the require > > parameter is not being enforced when using the content parameter so the > > template can''t be found. > > Templates are compiled on the server, not on the client, so you don''t > need to pull them down the client. Templates are entirely a function of > the parser -- there is no difference to the client between using a > template and specifying all of the file contents as a string.Excellent. It works swimmingly.> I''ll go over the templating docs to make sure this is clear.Thanks. I assume the --configprint option will be in a forthcoming release? Christian
Christian G. Warden wrote:> > Excellent. It works swimmingly.Great.> Thanks. I assume the --configprint option will be in a forthcoming release?Yep. I don''t know why it took me so long to realize how useful this is, but clearly it''s a good idea. -- 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