andreash <hilb...@gmail.com> writes:

> i'm not sure as to how to call the subject of this post, as i'm totally new
> to puppet -- so please forgive me if this is misleading ...
>
> for my servers, i'm planning to do something like this (pseudo-code):
>
> class (?) base-config:
>     include ntp::client
>     include resolver
>     ...
>
> all servers should by default include the base-config class.

I would suggest, instead, this:

  define base ($ntp, ...) {
    case $ntp {
      'master': { include ntp::master }
      ...
      default: { fail("sorry, ntp $ntp is an unknown value") }
    }
  }


[...]

> question 1: how can i make sure that the server which shall be
> openntpd server has $role = 'SERVER' and all others have role =
> 'CLIENT' ?

Essentially, use 'fail' when it isn't set.  You can pull this up a bit by, for
example, using the define there without a default value, but it essentially
comes down to the same thing.

> question 2: how can i include the ip of the ntp server as $ntpserverip
> without having to manually set it?

You can't.  At least, not trivially: puppet doesn't let you ask questions like
"what is the IP address of the server(s) including the ntp::master class".

Your choices come down to writing it in the manifest somewhere, or using a
fact or external tool that works it out for you.

> question 3: what else did i do wrong?

Nothing I can see; when *I* started this I used node inheritance, which is a
mistake, because it is useless.  Your approach isn't. :)

        Daniel

-- 
✣ Daniel Pittman            ✉ dan...@rimspace.net            ☎ +61 401 155 707
               ♽ made with 100 percent post-consumer electrons

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to