puppet-lint-file_source_rights-check
A puppet-lint plugin to check file rights when providing a source.
Installing
From the command line
$ gem install puppet-lint-file_source_rights-check
In a Gemfile
gem 'puppet-lint-file_source_rights-check', :require => false
Checks
Source without rights
When using the source
parameter for a file
resource, the Puppetmaster
will use the rights of the distant file on the fileserver as defaults.
This might lead to unexpected results, so the file's owner, group and mode
should be specified when using source
.
What you have done
file { '/tmp/foo':
ensure => file,
source => 'puppet:///modules/bar/foo',
}
What you should have done
file { '/tmp/foo':
ensure => file,
owner => 'root',
group => '0',
mode => '0644',
source => 'puppet:///modules/bar/foo',
}
Disabling the check
To disable this check, you can add --no-file_source_rights-check
to your puppet-lint command line.
$ puppet-lint --no-file_source_rights-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_file_source_rights')