Repository is archived
No commit activity in last 3 years
No release in over 3 years
A puppet-lint extension that ensures class parameter names are unique.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 1.1, < 3.0
 Project Readme

puppet-lint duplicate_class_parameters check

A puppet-lint extension that ensures class parameter names are unique.

Build Status

Until Puppet 3.8.5 it was possible to have the same parameter name specified multiple times in a class definition without error. This could cause confusion as only the last value for that name was taken and it was decided in No error on duplicate parameters on classes and resources that this behaviour should change and now return an error. This puppet-lint plugin will help you catch those issues before you upgrade and suffer failures in your puppet runs.

An exaggerated example of the previously valid, but awkward, behaviour can be found below -

class file_resource(
  $duplicated = { 'a' => 1 },
  $duplicated = 'foo',
  $not_unique = 'bar',
  $not_unique = '2nd bar',
  $unique     = 'baz'
) {

  file { '/tmp/my-file':
    mode => '0600',
  }

}

With this extension installed puppet-lint will return

found duplicate parameter 'duplicated' in class 'file_resource'

Installation

To use this plugin add the following line to your Gemfile

gem 'puppet-lint-duplicate_class_parameters-check'

and then run bundle install

Other puppet-lint plugins

You can find a list of my puppet-lint plugins in the unixdaemon puppet-lint-plugins repo.

Author

Dean Wilson