I have to think I''m just missing something obvious, but the following snippet doesn''t work. I''m using the svn trunk of puppet. My manifest (test.pp): --------------------------------------------------- file { "/var/tmp/my.src" : ensure => file, content => "hello\n" } file { "/var/tmp/dst.txt" : require => file["/var/tmp/my.src"], content => template("/var/tmp/my.src") } --------------------------------------------------- When I run it: # puppet -v test.pp Could not find template /var/tmp/my.src in file test.pp at line 9 I''m not sure if this is a bug, it seems like a pretty common case, so I''m wondering if I''m just doing something ignorant? Thanks, Kief
On Jul 22, 2006, at 11:32 AM, Kief Morris wrote:> I have to think I''m just missing something obvious, but the following > snippet doesn''t work. I''m using the svn trunk of puppet. > > My manifest (test.pp): > --------------------------------------------------- > file { "/var/tmp/my.src" : > ensure => file, > content => "hello\n" > } > > file { "/var/tmp/dst.txt" : > require => file["/var/tmp/my.src"], > content => template("/var/tmp/my.src") > } > --------------------------------------------------- > > When I run it: > > # puppet -v test.pp > Could not find template /var/tmp/my.src in file test.pp at line 9 > > I''m not sure if this is a bug, it seems like a pretty common case, so > I''m wondering if I''m just doing something ignorant?Ah, I see what''s happening. This combination of copying templates down will never work. Templates are actually filled out at parse time, which is significantly before any files are ever created by Puppet. However, you shouldn''t need to do this kind of relationship anyway, since the templates only need to exist on the server. Given the way that templates are implemented right now (and are likely to stay) you''ll never be able to create templates and use them within the same run. Does that make sense? -- Luke Kanies http://madstop.com 615-594-8199
Luke Kanies wrote:> On Jul 22, 2006, at 11:32 AM, Kief Morris wrote: >> I have to think I''m just missing something obvious, but the following >> snippet doesn''t work. > > This combination of copying templates down will never work. Templates > are actually filled out at parse time, which is significantly before any > files are ever created by Puppet. However, you shouldn''t need to do > this kind of relationship anyway, since the templates only need to exist > on the server. > > Given the way that templates are implemented right now (and are likely > to stay) you''ll never be able to create templates and use them within > the same run. > > Does that make sense?It makes sense. What I''m doing in reality is pulling the templates from svn and then using them. So I shouldn''t be using puppet to do the svn checkout/update of my templates, but will need a wrapper script that does this and then calls puppet. Thanks, Kief