You can make the package resource definition conditional.

class foo {
 if ! defined( Package[gcc] ) {
  package { gcc: ensure=>installed; }
 } 
}
class bar {
 if ! defined( Package[gcc] ) {
  package { gcc: ensure=>installed; }
 }
}

Or, define a new class for the package(s) and include that

class pkg::gcc {
  package { gcc: ensure=>installed; }
}
class foo {
include pkg::gcc
}
class bar {
include pkg::gcc
}

Second method is more elegant IMHO; but if its a one-off then first might be 
simpler.

Steve

Steve Shipway
University of Auckland ITS
UNIX Systems Design Lead
s.ship...@auckland.ac.nz
Ph: +64 9 373 7599 ext 86487

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to