A puppet-lint plugin to check file rights when providing a source.
$ gem install puppet-lint-file_source_rights-check
gem 'puppet-lint-file_source_rights-check', :require => false
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
.
file { '/tmp/foo':
ensure => file,
source => 'puppet:///modules/bar/foo',
}
file { '/tmp/foo':
ensure => file,
owner => 'root',
group => '0',
mode => '0644',
source => 'puppet:///modules/bar/foo',
}
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')