Managing packages
Another key resource type in Puppet is the package. A major part of configuring servers by hand involves installing packages, so we will also be using packages a lot in Puppet manifests. Although every operating system has its own package format, and different formats vary quite a lot in their capabilities, Puppet represents all these possibilities with a single package
type. If you specify in your Puppet manifest that a given package should be installed, Puppet will use the appropriate package manager commands to install it on whatever platform it's running on.
As you've seen, all resource declarations in Puppet follow this form:
RESOURCE_TYPE { TITLE: ATTRIBUTE => VALUE, ... }
package
resources are no different. The RESOURCE_TYPE
is package
, and the only attribute you usually need to specify is ensure
, and the only value it usually needs to take is installed
:
package { 'cowsay': ensure => installed, }
Try this example:
sudo puppet apply /examples...