Ask Your Question
1

How do I set defaults for modules?

asked 2013-09-05 11:35:05 -0600

Rob Ogilvie gravatar image

I'm a Puppet newbie in the early stages of evaluating it to manage our ~30 *nix nodes.

I'm trying to configure Puppet using modules as often as possible to avoid writing my own self-managed code; so I'm building on already-defined stuff.

It seems to make the most sense to build classes for various roles servers might have, and then apply those classes to the nodes in question. The first role (class) I'm attempting to build is the ntpclient class, but it is definitely not working:

class ntpclient {
        include ::ntp: {
                servers         => [ 'time', 'pool.ntp.org' ],
                restrict        => [ 'restrict ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-09-05 11:45:05 -0600

Ancillas gravatar image

updated 2013-09-05 16:52:14 -0600

When you build your own modules, then you can specify defaults, but when you're using a module from the forge, like the puppetlabs/ntp module, you need to depend on the module developer for sane defaults, and then pass in your parameters to change the behavior. It looks like you got half way there.

There are two ways to add a module to your catalog. You can read all about them here, but I'll give you the 10,000ft summary.

include

Example

include ntp
  • Can't use parameters with include
  • Can call 'include ntp' multiple places in your ...
(more)
edit flag offensive delete link more

Comments

What in there links it back to the puppetlabs ntp module?

Rob Ogilvie gravatar imageRob Ogilvie ( 2013-09-05 11:53:59 -0600 )edit

To quote Gru.... "Light Bulb."

Rob Ogilvie gravatar imageRob Ogilvie ( 2013-09-05 12:00:04 -0600 )edit

Once you get your mind wrapped around this concept, you can look into advanced features like Puppet 3.0+ data bindings, which automatically call hiera to auto-fill parameters. That allows ...(more)

Ancillas gravatar imageAncillas ( 2013-09-05 16:54:49 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2013-09-05 11:35:05 -0600

Seen: 121 times

Last updated: Sep 05 '13