Hi there,
Thanks for your patience everyone... hopefuly this is going to end up
with something useful to others and expand on my (and hopefuly our
collective) understanding of puppet.
:)
I have defined a hosts class in which I define a bunch of hosts on this
network. Heres a simplified example, just the definition of localhost:
class hosts {
host { "localhost.localdomain":
alias => "localhost",
ip => "127.0.0.1",
name => "localhost.localdomain"
}
}
I want to be able to utilise this in nagios configs so I reasoned that
this would be something like what I need:
class nagios2 inherits hosts {
nagios_host {
"localhost.localdomain":
address => $ip,
alias => $alias
}
}
Now obviously we have some namespace clashes here; alias for one.
What I am hoping to achieve at this stage is that I can get a nagios
config with ''address'' being 127.0.0.1
This isn''t working out and having the ''inherits
hosts'' there produces
syntax errors.
I am guessing that as well as specifying the ''inherit'' or
''include'' or
''import'' or *whatever* it ends up being, I''ll have to
specify the
namespace of, eg, $ip
Eventually I hope to extend this so that I can specify a whole list of
hosts as in this pseudocode:
class nagios2 inherits hosts {
nagios_host {
host1, host2, host3, host4 :
address => $ip,
alias => $alias
}
}
and end up with (in this case) 4 nagios host definitions with the
correct IP addresses and aliases as specified in the hosts class for
each of host{1,2,3,4}.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---