Forge Home

packagelist

Package List

Ryan Uber

ryanuber

19,203 downloads

13,550 latest version

3.9 quality score

Version information

  • 0.2.8 (latest)
  • 0.2.7
  • 0.2.6
  • 0.2.5
  • 0.2.4
  • 0.2.3
  • 0.2.2
  • 0.2.1
  • 0.2.0
  • 0.1.3
  • 0.1.2
  • 0.1.1
released Mar 5th 2014

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this declaration to your Puppetfile:

mod 'ryanuber-packagelist', '0.2.8'
Learn more about managing modules with a Puppetfile

Add this module to a Bolt project:

bolt module add ryanuber-packagelist
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ryanuber-packagelist --version 0.2.8

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

ryanuber/packagelist — version 0.2.8 Mar 5th 2014

Puppet Package Lists

Dynamcially creates a package resource for each element in a list, and ensures that each version is enforced. Any package not defined in your package list will automatically generate a package resource with an ensure => absent, giving you the power to define exactly what you want on your system in one list and enforce it using Puppet.

For each package in a package list, an ensure will be dynamically created to "latest". This allows you to either place an exact package version in (along with the name), or simply the package name if you want the latest from your mirror.

Installation

Install via PuppetForge:

puppet module install ryanuber/packagelist

Install via git:

git clone git://github.com/ryanuber/puppet-packagelist /etc/puppet/modules/packagelist

Options

source

Defines the path to a package list file. This option can be passed as the resource name as well. This argument conflicts with the packages argument.

packages

A package list to pass directly in. This argument conflicts with the source argument.

purge

Whether or not to purge packages that are not present in the package list.

RedHat Support

RedHat OS family support is relatively sound and straightforward, and is the distribution this module was originally written for.

Debian Support

Debian-based OS families are supported as of 0.2.2. The package list format is a little different than RedHat's, but the tools and commands used are quite similar in nature. The key difference is the delimiter between package name and version.

Creating package lists

An easy way to create a package list for an entire system is using RPM directly. Examples follow.

With versions:

# RedHat
rpm -qa > my-packages-redhat.lst
# Debian
dpkg-query --show > my-packages-debian.lst

Without versions (to get latest):

# RedHat
rpm -qa --qf="%{name}\n" > my-packages-redhat.lst
# Debian
dpkg-query --show -f '${Package}\n' > my-packages-debian.lst

Examples

Keep kernel and grub at latest, don't purge other packages:

# RedHat
packagelist { 'mypackagelist': packages => [ 'kernel', 'grub' ] }
# Debian
packagelist { 'mypackagelist': packages => [ 'linux-image-generic', 'grub-common' ] }

Keep kernel at a specific version, grub at latest, don't purge:

# RedHat
packagelist { 'mypackagelist': packages => [ 'kernel-2.6.32-279.el6.x86_64', 'grub' ] }
# Debian
packagelist { 'mypackagelist': packages => [ 'linux-image-generic 3.5.0.17.19', 'grub-common' ] }

Load in a packagelist from a list file (one package per line):

# RedHat / Debian
packagelist { '/root/my-packages.lst': }

Load in a packagelist file, purging anything not mentioned within it:

# RedHat / Debian
packagelist { '/root/my-packages.lst': purge => true }

Pass in a packagelist loaded from somewhere else:

# RedHat / Debian
packagelist { 'mypackagelist': packages => $packages }