--On June 7, 2007 1:23:06 PM -0400 Mike Zupan <hijinks@gmail.com> wrote:
> I''m having a bit of a tricky time with this.. I have an exec like
this
> that I want to run on all servers on the puppet network but like our
> email servers
>
> class rootpw {
> exec { "/bin/echo test 1 2 3":
> path => "/usr/bin:/usr/sbin:/bin",
> schedule => daily,
> }
> }
>
>
>
> So I have a list of ips that I don''t want that command to run on..
Is
> there an easy way to go about this?
>
I recommend not trying to tackle things by IP but by classes. Making
inferences based on IP is the way many older configuration management
systems like to think about things but it is really an arbitrary
delineation. Instead, I would imagine that all your servers that are email
servers include a class called email_server or the like. So, what I would
do is use an override to run something else or add an onlyif like so:
class rootpw {
exec { "/bin/echo test 1 2 3":
path => "/usr/bin:/usr/sbin:/bin",
schedule => daily,
}
}
class email_server_rootpw inherits rootpw {
Exec["/bin/echo test 1 2 3"] {
onlyif => "/bin/false"
}
}
class email_server {
includes email_server_rootpw
[...]
}
node emailserver1 {
include email_server
}