manage linux package in puppet

The simplest use of the package type only requires specifying 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 being 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.

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

Sometimes just having a package present isn't enough, we also want to ensure it stays up to date. By specifying the latest Puppet will install a package if it is not already installed, and upgrade the package to newer versions when they become available. This last part is where the latest differs from installed.
class screen {
  package { 'screen':
    ensure => 'latest',
  }
}


Recent Comments

No comments

Leave a Comment