FAQ
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.

Search Discussions

  • Ryan Coleman at Aug 24, 2012 at 5:07 pm
    Hi Sanda,

    On Fri, Aug 24, 2012 at 8:32 AM, Sandra Schlichting
    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 at Aug 24, 2012 at 6:13 pm
    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 at Aug 24, 2012 at 7:26 pm

    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 at Aug 24, 2012 at 8:13 pm

    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.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppuppet-users @
categoriespuppet
postedAug 24, '12 at 3:32p
activeAug 24, '12 at 8:13p
posts5
users3
websitepuppetlabs.com

People

Translate

site design / logo © 2022 Grokbase