FAQ
Hi,

I've been doing some tests with some internal methods just to mess a little
and learn a bit about puppet internals but found myself in a situation
which I don't really understand and I was hoping someone around could help
me to get it.

I have a test module with the following init.pp:

class test1
{

   file
{'/tmp/test1':

     content =>
template('test1/test1.erb'),


}



   Test1::Print <| |> ->
File['/tmp/test1']

}

The define test1::print looks like:

define test1::print
(


$message

)
{

   notify{$message:
}

}

So nothing really special, then in the template I try to catch all the
resources in the catalog with "scope.catalog.resources" method, nothing I
came up with by myself I saw it in a module and thought it was a neat trick
and wanted to try it and learn what else I could do with this kind of stuff.

The problem I'm having is that the template seems to be "compiled" before
all the resources are in the catalog as the file only contains the
following list of resources:

Stage[main]
Class[Settings]
Class[main]
Node[default]
Class[Test1]

In puppet's output, the relationships seem to be well defined but feels
like puppet is somehow applying (catching?) the template even before
creating the actual file.

The template has the following content:

<% @test = scope.catalog.resources.select { |r| r.type } -%>
<% @test.each do |t| -%>
<%= t %>
<% end %>

Am I missing anything? I expected to see in the file the defined type
test1::print...

Thanks!

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 5 | next ›
Discussion Overview
grouppuppet-users @
categoriespuppet
postedSep 9, '13 at 11:13p
activeSep 11, '13 at 1:37p
posts5
users2
websitepuppetlabs.com

2 users in discussion

Jcbollinger: 3 posts Sjr: 2 posts

People

Translate

site design / logo © 2022 Grokbase