A collection of task oriented solutions in Puppet

 

Install a package

Challenge

You want to install a package

Solution

class screen {

  package { 'screen':
    ensure => 'installed',
  }

}

Explanation

The simplest use of the package type only requires you to specify the package name and the desired status of the package. The 'ensure' attribute will accept either 'present' or 'installed'.

This will use whichever installation provider Puppet considers to be the default for this platform and install the latest version of the package that it finds in the hosts configured software repos when the manifest first runs. Once the package is installed Puppet will not track new versions of the package.

See also