Hi, I try some like this... I need virtual parametriced class. *@class {backup::client:* * backup => xxxxxx* *}* Is posible to do something like this? If To realice... This don''t works. (err: Could not retrieve catalog from remote server: Error 400 on SERVER: Resource* type class *doesn''t exist at ......) *Class <| title == ''backup::client'' |> {* * backup => $backup_remote* *}* This works fine but i can''t set any parameter ( I need set the param value) *realize(''backup::client'')* So, the question is... How i can do to realize a virtual parametriced class? 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
This seems like entirely the wrong way to use classes. Classes are a set of resources that can be applied to a node. The easiest way to use classes is to include them in a node definition like so node ''blah.example.com'' { include blackup::client } if you need to set the variable for a class you can use hiera or an enc or do something like this. node ''blah.example.com'' { class{''backup::client'': backup => ''blah'', } for more detailed explanations of classes please have a look here. http://docs.puppetlabs.com/puppet/3/reference/lang_classes.html On 9 April 2013 20:20, Israel Calvete <icalvete@gmail.com> wrote:> Hi, > > I try some like this... > > I need virtual parametriced class. > > *@class {backup::client:* > * backup => xxxxxx* > *}* > > Is posible to do something like this? If > > > To realice... > > This don''t works. (err: Could not retrieve catalog from remote server: > Error 400 on SERVER: Resource* type class *doesn''t exist at ......) > > *Class <| title == ''backup::client'' |> {* > * backup => $backup_remote* > *}* > > This works fine but i can''t set any parameter ( I need set the param value) > > *realize(''backup::client'')* > > > So, the question is... How i can do to realize a virtual parametriced > class? > > 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?hl=en. > For more options, visit https://groups.google.com/groups/opt_out. > > >-- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On Tuesday, April 9, 2013 5:20:36 AM UTC-5, Israel Calvete wrote:> > Hi, > > I try some like this... > > I need virtual parametriced class. >Why do you think you need such a thing?> > *@class {backup::client:* > * backup => xxxxxx* > *}* > > Is posible to do something like this? If > > > To realice... > > This don''t works. (err: Could not retrieve catalog from remote server: > Error 400 on SERVER: Resource* type class *doesn''t exist at ......) >There is no other way to declare a virtual resource, so evidently the answer to your question is "no." Although for the last couple of years PuppetLabs has actively worked to obscure the distinction between classes and (other) resources, the fact remains that classes are special. I advise you to thinking of them as resources at all. That will save you from any number of false starts.> > *Class <| title == ''backup::client'' |> {* > * backup => $backup_remote* > *}* > > This works fine but i can''t set any parameter ( I need set the param value) >You cannot override a class''s parameters once it is declared. There is actually an open issue on this topic, but it it is not possible to completely solve it. You need to bind the correct parameter values to for your class in the first place.> > *realize(''backup::client'')* > > > So, the question is... How i can do to realize a virtual parametriced > class? > >You don''t. So let''s get back to my opening question: why do you think you need to do so? There are surely alternatives that will help you accomplish the same overall objective, but I can''t suggest any specifics because I don''t know what that objective is. John -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
On Wednesday, April 10, 2013 8:11:49 AM UTC-5, jcbollinger wrote:> > I advise you to thinking of them as resources at all. > >That is, I advise you to *avoid* thinking of them as resources at all. John -- 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?hl=en. For more options, visit https://groups.google.com/groups/opt_out.