About | FAQ | Help
Ask Your Question

Revision history [back]

You can write a Puppet class like so and install it on your master. Once the various agent nodes check in to the master, if they are classified with your class, they will install the package. Are you trying to do something more complex than that?

Example package resource:

# This class lives in <modulesdir>/example/manifests/init.pp
class example {
  package { 'httpd':
    ensure => present,
  }
}

Alternately, you could install the puppetlabs-stdlib module, then call the ensure_packages function in your class like so:

# This class lives in <modulesdir>/example/manifests/init.pp
class example {
  $packagelist = [ 'httpd', 'bash', 'mysql', 'mysql-server' ]

  ensure_pacakges($packagelist)
}

Hope that helps, and please post back here with any further questions.