A puppet-lint plugin to check for alias parameters in resources.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/puppet-lint/plugins
spec
.sync.yml
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
puppet-lint-alias-check.gemspec

README.md

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')