On 19 Mar 2014, at 11:03, Adeel Arif Bhatti <[email protected]> wrote:
> Bundle of thanks !! But should this be a directory structure i.e.
> role/manifests/base ???
This is the basic concept of puppet modules.
On your master you have configured at least one module path (look into
puppet.conf on your master).
Within that directory you build your modules:
<modulepath>/<modulename>/manifests/<classname>.pp
> and what would be the name of the file class which has
> class role::base {
> include ntp
> include backup
> include security
> }
class role::base
role = modulename
base = filename without file ending in <modulepath>/<modulename>/manifests
http://docs.puppetlabs.com/puppet/latest/reference/modules_fundamentals.html
> is it base.pp in role/manifests/ directory ???
yes.
>
>
> On Wed, Mar 19, 2014 at 10:07 AM, Martin Alfke <[email protected]> wrote:
> Hi,
>
> this exactly is the reason why one should make use of roles and profiles
> see
> http://www.craigdunn.org/2012/05/239/
> http://projects.puppetlabs.com/projects/puppet/wiki/Infrastructure_Design_Guidelines
> http://docs.puppetlabs.com/pe/latest/puppet_assign_configurations.html#assigning-configuration-data-with-role-and-profile-modules
>
> Personally I prefer a module with the name "role"
>
> e.g.
> role/manifests/base.pp
>
> class role::base {
> include ntp
> include backup
> include security
> }
>
> And within my node I am using this role:
>
> node 'foobar' {
> include role::base
> ...
> }
>
>
> hth,
>
> Martin
>
>
> On 19 Mar 2014, at 09:58, AAB !! <[email protected]> wrote:
>
> > Hi,
> > Could someone tell me how can I have hierarchy in puppet classes ?.
> > I have some classes for services like ntp,ssh and many more. What I want
> > is, these classes should be included for every puppet agent/node. Could I
> > make a parent class and include these classes into in. And then in the node
> > file for agent I can include only this parent class.
> > Now in future if I have to include any new basic service like *backup* I
> > dont have to edit the node file for each node to include the backup class,
> > I will simply include the backup class in the parent class and all of my
> > nodes will have that backup configuration.
> >
> >
> >
> > Regards
> >
> >
> > --
> > 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 [email protected].
> > To view this discussion on the web visit
> > https://groups.google.com/d/msgid/puppet-users/6d7dc4aa-f6cb-4e52-8f3e-8e55b585af8e%40googlegroups.com.
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the Google
> Groups "Puppet Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/puppet-users/9bjoSmicfR0/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/53E5D619-5BD2-4406-BAAF-D14700C092A2%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/CALMMbv2AOBDQXpcjy2iWq3cf_J0EDVBRwTpfdm_G63xG%3DG-4Bw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/6306BD99-4449-4649-99FC-4A47CD3FB91F%40gmail.com.
For more options, visit https://groups.google.com/d/optout.