A puppet-lint plugin to check file rights when providing a source.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib/puppet-lint/plugins
spec
.gitignore
.sync.yml
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
puppet-lint-file_source_rights-check.gemspec

README.md

puppet-lint-file_source_rights-check

Build Status Gem Version Gem Downloads Coverage Status Gemnasium

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')