Attribute Ordering


If a resource declaration includes an ensure parameter, it should be the first parameter specified (style guide).

What you have done

file { '/tmp/foo':
  owner  => 'root',
  group  => 'root',
  ensure => present,
}

What you should have done:

file { '/tmp/foo':
  ensure => present,
  owner  => 'root',
  group  => 'root',
}

Disabling the check

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

$ puppet-lint --no-ensure_first_param-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_ensure_first_param')