Skip to content
A puppet-lint plugin to check the ensure attribute on package resources.
Ruby
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/puppet-lint/plugins
spec
.travis.yml
Gemfile
Gemfile.lock
LICENSE
README.md
Rakefile
puppet-lint-package_ensure-check.gemspec

README.md

puppet-lint-package_ensure-check

Build Status Gem Version Gem Downloads

A puppet-lint plugin to check the ensure attribute on package resources.

Installing

From the command line

$ gem install puppet-lint-package_ensure-check

In a Gemfile

gem 'puppet-lint-package_ensure-check'

Checks

Ensure latest on package resource

The latest value for the ensure attribute is dangerous and should not be used. You should use installed or a version specifier instead.

What you have done

package { 'puppet':
  ensure => latest,
}

What you should have done

package { 'puppet':
  ensure => '3.8.3-1',
}

Disabling the check

To disable this check, you can add --no-package_ensure-check to your puppet-lint command line.

$ puppet-lint --no-package_ensure-check path/to/file.pp

Alternatively, if you’re calling puppet-lint via the Rake task, you should insert the following line to your Rakefile.

PuppetLint.configuration.send('disable_package_ensure')

Fix support

This plugin has the ability to fix the ensure value by setting it to installed instead of latest.

Only use this if you know what you're doing!

You can’t perform that action at this time.