Book Image

Troubleshooting Puppet

By : Thomas Uphill
Book Image

Troubleshooting Puppet

By: Thomas Uphill

Overview of this book

Table of Contents (14 chapters)

puppet-lint


Lint is the name given to a program that searches through code for non-ideal or nonportable syntax. The puppet-lint tool is a Lint tool for Puppet code. It will go through your Puppet code and point out the code that has the potential to be a problem. By default, puppet-lint uses the style-guide guidelines and will report problems such as lines that have more than 80 characters.

The puppet-lint tool is a Ruby gem and can be installed using the gem tool or as a package, depending on your distribution (for instance, Fedora calls this package rubygem-puppet-lint). To install it using Puppet, run the following puppet resource command:

$ sudo puppet resource package puppet-lint ensure=installed provider=gem
Notice: /Package[puppet-lint]/ensure: created
package { 'puppet-lint':
ensure => ['1.1.0'],
}
$ puppet-lint -v
puppet-lint 1.1.0

To test puppet-lint, add the following code to a manifest called lint.pp:

class linty {
file {"/tmp/lint":
mode            => 0644,
ensure     ...