1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-12-16 09:40:35 +00:00

add check for puppet 4

This commit is contained in:
Norbert Varzariu 2015-12-21 16:34:29 +01:00
parent b06a4732b5
commit 4879f6822f
2 changed files with 32 additions and 28 deletions

57
Gemfile
View File

@ -1,33 +1,34 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org' source "https://rubygems.org"
group :development, :unit_tests do group :test do
gem 'rspec-core', '~> 3.1.7', :require => false gem "rake"
gem 'rspec-puppet', '~> 2.1', :require => false gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 3.8.0'
gem 'puppetlabs_spec_helper', :require => false gem "rspec", '< 3.2.0'
gem 'simplecov', :require => false gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git'
gem 'puppet_facts', :require => false gem "puppetlabs_spec_helper"
gem 'json', :require => false gem "metadata-json-lint"
gem 'metadata-json-lint', :require => false gem "rspec-puppet-facts"
gem 'puppet-lint', '< 1.1.0', :require => false gem 'rubocop', '0.33.0'
gem 'simplecov', '>= 0.11.0'
gem 'simplecov-console'
gem "puppet-lint-absolute_classname-check"
gem "puppet-lint-leading_zero-check"
gem "puppet-lint-trailing_comma-check"
gem "puppet-lint-version_comparison-check"
gem "puppet-lint-classes_and_types_beginning_with_digits-check"
gem "puppet-lint-unquoted_string-check"
end
group :development do
gem "travis"
gem "travis-lint"
gem "puppet-blacksmith"
gem "guard-rake"
end end
group :system_tests do group :system_tests do
gem 'beaker-rspec', :require => false gem "beaker"
gem 'serverspec', :require => false gem "beaker-rspec"
gem 'beaker-puppet_install_helper', :require => false gem "beaker-puppet_install_helper"
end end
if facterversion = ENV['FACTER_GEM_VERSION']
gem 'facter', facterversion, :require => false
else
gem 'facter', :require => false
end
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion, :require => false
else
gem 'puppet', :require => false
end
gem 'puppet', "3.8"
# vim:ft=ruby

View File

@ -13,6 +13,9 @@ class rsnapshot (
$package_name = $rsnapshot::params::package_name, $package_name = $rsnapshot::params::package_name,
$package_ensure = $rsnapshot::params::package_ensure, $package_ensure = $rsnapshot::params::package_ensure,
) inherits rsnapshot::params { ) inherits rsnapshot::params {
if $::puppetversion =~ /^(1|2|3)/ {
fail("This module requires Puppet 4")
}
if $hosts { if $hosts {
class { 'rsnapshot::install': }-> class { 'rsnapshot::install': }->
class { 'rsnapshot::config': } class { 'rsnapshot::config': }