I see plenty of examples of classes or modules such as ntp or sudo or ssd. But none of these examples pass an argument to a class or a module. If I wanted to pass the rpm name to a module or a class, what would be the call to that class in site.pp and what would be the class definition in init.pp? Thank you -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Joehillen
2012-Jan-26 22:22 UTC
[Puppet Users] Re: passing argument to a class or a module
You can''t pass arguments to classes, only defines. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/Y9ZjlgMsQHAJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nan Liu
2012-Jan-26 22:48 UTC
Re: [Puppet Users] Re: passing argument to a class or a module
On Thu, Jan 26, 2012 at 5:22 PM, Joehillen <joehillen@gmail.com> wrote:> You can''t pass arguments to classes, only defines. >Classes support parameters since 2.6.0, here''s the documentation: http://docs.puppetlabs.com/learning/modules2.html Nan -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Joehillen
2012-Jan-26 23:47 UTC
Re: [Puppet Users] Re: passing argument to a class or a module
whoa, my bad. I learned puppet before 2.6 Now I don''t know why there is a distinction between classes and defines. I''ll have to read up. Thanks -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To view this discussion on the web visit https://groups.google.com/d/msg/puppet-users/-/8StUMI-Bg5oJ. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Thank you On Jan 26, 5:48 pm, Nan Liu <n...@puppetlabs.com> wrote:> On Thu, Jan 26, 2012 at 5:22 PM, Joehillen <joehil...@gmail.com> wrote: > > You can''t pass arguments to classes, only defines. > > Classes support parameters since 2.6.0, here''s the documentation:http://docs.puppetlabs.com/learning/modules2.html > > Nan-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Ryan Bowlby
2012-Jan-27 02:20 UTC
[Puppet Users] Re: passing argument to a class or a module
Classes can only be declared once while defines can be declared multiple times. So if you wanted two vhost files a define would be needed. On Jan 26, 3:47 pm, Joehillen <joehil...@gmail.com> wrote:> whoa, my bad. I learned puppet before 2.6 > > Now I don''t know why there is a distinction between classes and defines. > I''ll have to read up. > > Thanks-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.