On 12/30/2010 03:25 AM, Dmytro Bablinyuk wrote:
> Hi Everyone,
> 
> I have a very big chunk of code that consists from file, package,
> exec, auges actions. I need to execute certain actions on certain
> hosts. Each group of actions is valid for a single client host only
> thus they are not re-usable.
> I was thinking about grouping those actions into some sort of
> functions that I can call from main "case".
> 
> What the best way of grouping actions and how?
> 
> Thank you
> Dmytro
> 

Hi,

usually you group declarations semantically into classes, e.g.:

class ntp {
  package { "ntp": ensure => installed }
  service { "ntp": ensure => running, require => Package["ntp"] }
}

etc.

You tie those classes to the appropriate hosts by including them from
their respective node declaration:

node alice {
  include ntp
}

node bob {
  include ftp_server
}

HTH,
Felix

-- 
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