Sandra Schlichting
2012-Aug-24 15:32 UTC
[Puppet Users] How to set default values for downloaded modules?
Dear readers, I would like to use the saz-ntp module from https://github.com/saz/puppet-ntp When installed the class is called "ntp". Ideally would I like each node to look like node testsrv { include ntp } Problem I don''t want to modify the downloaded module, but I would like to be able to specify my own ntp servers class { ''ntp'': server_list => [ ''yourLocalServer1'', ''yourLocalServer2'', ] } Question Is it possible to override the ntp class name, so I can create an ntp class with contains my ntp server names? Or is it possible to create an myconfig::ntp so the node would just become?: node testsrv { include myconfig::ntp } Hugs, Sandra -- 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/-/v9yh3GsPKUAJ. 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 Coleman
2012-Aug-24 17:07 UTC
Re: [Puppet Users] How to set default values for downloaded modules?
Hi Sanda, On Fri, Aug 24, 2012 at 8:32 AM, Sandra Schlichting <littlesandra88@gmail.com> wrote:> Is it possible to override the ntp class name, so I can create an ntp class > with contains my ntp server names?The author built his ntp module with parameterized classes [1] so that you could modify its behavior and data without touching the Puppet manifests at all. If you''d like to create an ntp class with your own ntp server names, you declare the class [2] exactly like you suggested. class { ''ntp'': server_list => [ ''server1'', ''server2'', ''etc'' ], } This is equivalent to writing include ntp but without just accepting the default behavior and data.> Hugs, > Sandra >Hugs back! --Ryan [1] http://docs.puppetlabs.com/learning/modules2.html [2] http://docs.puppetlabs.com/puppet/2.7/reference/lang_classes.html#declaring-a-class-like-a-resource -- 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.
Sandra Schlichting
2012-Aug-24 18:13 UTC
Re: [Puppet Users] How to set default values for downloaded modules?
Hi Ryan, [snip] This is equivalent to writing include ntp but without just accepting> the default behavior and data. >Yes, the following works node testsrv { class { ''ntp'': server_list => [ ''server1'', ''server2'', ''etc'' ], } } but I would really like to have this instead node testsrv { include ntp } or node testsrv { include myconfig::ntp } Is that possible, or are we talking about different things? =) Hugs, Sandra -- 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/-/k3SGg0Q4KtQJ. 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.
Calvin Walton
2012-Aug-24 19:26 UTC
Re: [Puppet Users] How to set default values for downloaded modules?
On Fri, 2012-08-24 at 11:13 -0700, Sandra Schlichting wrote:> Hi Ryan, > > [snip] > > This is equivalent to writing include ntp but without just accepting > > the default behavior and data. > > > > Yes, the following works > > node testsrv { > class { ''ntp'': > server_list => [ ''server1'', ''server2'', ''etc'' ], > } > } > > but I would really like to have this instead > > node testsrv { include ntp } > or > node testsrv { include myconfig::ntp }using something like ''myconfig::ntp'' (or any different name, ''ntp_local'', etc.) would work fine. This would look like class myconfig::ntp { class { ''ntp'': server_list => [ ''a.example.com'', ''b.example.com'' ] } } note testsrv { include myconfig::ntp } -- Calvin Walton <calvin.walton@kepstin.ca> -- 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.
Sandra Schlichting
2012-Aug-24 20:13 UTC
Re: [Puppet Users] How to set default values for downloaded modules?
> > using something like ''myconfig::ntp'' (or any different name, > ''ntp_local'', etc.) would work fine. This would look like > > class myconfig::ntp { > class { ''ntp'': > server_list => [ ''a.example.com'', ''b.example.com'' ] > } > } > > note testsrv { > include myconfig::ntp > } >Awesome! Thanks a lot =) -- 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/-/S60LHDSDzd0J. 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.