A puppet-lint plugin to check for the alias parameter in resources.
$ gem install puppet-lint-alias-check
gem 'puppet-lint-alias-check', :require => false
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.
package { $foo::params::pkg:
ensure => package,
alias => 'foo',
}
package { 'foo':
ensure => package,
name => $foo::params::pkg,
}
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')