puppet-lint-alias-check

Build Status Gem Version Gem Downloads Coverage Status Gemnasium

A puppet-lint plugin to check for the alias parameter in resources.

Installing

From the command line

$ gem install puppet-lint-alias-check

In a Gemfile

gem 'puppet-lint-alias-check', :require => false

Checks

Alias parameter used

The alias parameter should not be used most of the time. In Puppet 4, resources cannot be accessed using the alias parameter, making it quite useless.

A proper use of the namevar with static titles is better practice.

What you have done

package { $foo::params::pkg:
  ensure => package,
  alias  => 'foo',
}

What you should have done

package { 'foo':
  ensure => package,
  name   => $foo::params::pkg,
}

Disabling the check

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

$ puppet-lint --no-alias-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_alias')