Quantcast
Channel: Planet Ubuntu
Viewing all articles
Browse latest Browse all 17727

Andrew Pollock: [tech] A cleaner puppet manifest

$
0
0

Jon Downland is tinkering with Puppet, and wrote a class with a package resource to install a bunch of packages, but didn't quite like the way it was written.

The way that I'd achieve the same thing, and be slightly cleaner would be something like this:

class jon-desktop {

	$packages_to_install_by_default = [
		'icedove',
		'git-core',
		'vim-gnome',
		'vinagre',
		'build-essential',
		'devscripts',
		'subversion',
		'git-buildpackage',
		'mutt',
		'offlineimap',
		'ascii',
		'gitk',
		'chromium-browser',
	]

	package { $packages_to_install_by_default:
		ensure => installed,
	}
}

This way your actual package resource definition never needs to change. The variable you choose to use to define the list of packages to install can be abstracted away as much as desired.


Viewing all articles
Browse latest Browse all 17727

Trending Articles