1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2025-09-13 07:49:29 +00:00

4 Commits
0.3.1 ... 0.3.2

Author SHA1 Message Date
Norbert Varzariu
ff8962cf47 bump version to 0.3.2 2016-01-18 19:56:05 +01:00
Norbert Varzariu
0b21f0e751 remove class inheritance in install.pp 2016-01-18 19:54:53 +01:00
Norbert Varzariu
abae53b1ad fix travis.yml 2016-01-18 12:10:53 +01:00
Norbert Varzariu
743cecfc2d Merge branch 'release/0.3.1' into develop 2016-01-18 11:23:41 +01:00
7 changed files with 17 additions and 79 deletions

View File

@@ -3,17 +3,10 @@ sudo: false
language: ruby
cache: bundler
bundler_args: --without system_tests
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
script: "bundle exec rake validate && bundle exec rake spec SPEC_OPTS='--format documentation'"
matrix:
fast_finish: true
include:
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.0.0
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.6
env: PUPPET_GEM_VERSION="~> 4.0"
notifications:
email: false

37
Gemfile
View File

@@ -1,32 +1,7 @@
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
source 'https://rubygems.org'
group :development, :unit_tests do
gem 'rspec-core', '~> 3.1.7', :require => false
gem 'rspec-puppet', '~> 2.1', :require => false
gem 'puppetlabs_spec_helper', :require => false
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false
gem 'metadata-json-lint', :require => false
gem 'puppet-lint', '< 1.1.0', :require => false
end
group :system_tests do
gem 'beaker-rspec', :require => false
gem 'serverspec', :require => false
gem 'beaker-puppet_install_helper', :require => false
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
# vim:ft=ruby
puppetversion = ENV.key?('PUPPET_VERSION') ? "#{ENV['PUPPET_VERSION']}" : ['>= 4.0']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.8.2'
gem 'puppet-lint', '>= 1.0.0'
gem 'facter', '>= 1.7.0'

View File

@@ -7,9 +7,9 @@ class rsnapshot::config (
) {
# these are global settings, no point in setting them per host
$config_version = $rsnapshot::params::config_version
$lockpath = pick($rsnapshot::lockpath, $rsnapshot::params::config_lockpath)
$conf_d = pick($rsnapshot::conf_d, $rsnapshot::params::conf_d)
$snapshot_root = pick($hosts['snapshot_root'], $rsnapshot::params::config_snapshot_root)
$lockpath = pick($rsnapshot::lockpath, $rsnapshot::params::config_lockpath, '/var/run/rsnapshot')
$conf_d = pick($rsnapshot::conf_d, $rsnapshot::params::conf_d, '/etc/rsnapshot')
$snapshot_root = pick($hosts['snapshot_root'], $rsnapshot::params::config_snapshot_root, '/backup')
$default_cron = assert_empty_hash($::rsnapshot::cron)
# make sure lock path and conf path exist
file { $conf_d:

View File

@@ -14,7 +14,7 @@ class rsnapshot (
$package_ensure = $rsnapshot::params::package_ensure,
$cron = $rsnapshot::params::cron,
) inherits rsnapshot::params {
if $::puppetversion =~ /^(1|2|3)/ {
if $puppetversion =~ /^(1|2|3)/ {
fail('This module requires Puppet 4')
}
if $hosts {

View File

@@ -1,7 +1,7 @@
# == Class: rsnapshot::install
#
# Installs the rsnapshot package.
class rsnapshot::install inherits rsnapshot {
class rsnapshot::install {
case $::operatingsystem {
/^CentOS$/: { include epel }
default: {}

View File

@@ -1,6 +1,6 @@
{
"name": "loomsen-rsnapshot",
"version": "0.3.1",
"version": "0.3.2"
"author": "loomsen",
"summary": "Configures rsnapshot.",
"license": "Apache-2.0",

View File

@@ -1,37 +1,7 @@
require 'spec_helper'
describe 'rsnapshot' do
{'Ubuntu' => 'Debian', 'Debian' => 'Debian'}.each do |system, family|
context "when on system #{system} no lvm" do
let :facts do
{
:osfamily => family,
:operatingsystem => system,
}
end
it { should contain_class('rsnapshot') }
it { should contain_class('rsnapshot::install') }
it { should contain_class('rsnapshot::config') }
end
context "when on system #{system} with lvm" do
let :facts do
{
:osfamily => family,
:operatingsystem => system,
}
end
let(:params) { {:use_lvm => true} }
it { should contain_class('rsnapshot') }
it { should contain_class('rsnapshot::install') }
it { should contain_class('rsnapshot::config') }
it {
should contain_file('/etc/rsnapshot.conf').with_content(/^linux_lvm_((\w|_)+)\t(.*)$/)
}
end
end
it { should contain_class('rsnapshot::params') }
it { is_expected.to compile }
it { is_expected.to contain_class('rsnapshot::config') }
it { is_expected.to contain_class('rsnapshot::install') }
end