mirror of
https://github.com/krislamo/puppet-rsnapshot
synced 2025-09-13 15:59:28 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
ff8962cf47 | ||
|
0b21f0e751 | ||
|
abae53b1ad | ||
|
743cecfc2d |
@@ -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
37
Gemfile
@@ -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'
|
||||
|
@@ -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:
|
||||
|
@@ -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 {
|
||||
|
@@ -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: {}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "loomsen-rsnapshot",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2"
|
||||
"author": "loomsen",
|
||||
"summary": "Configures rsnapshot.",
|
||||
"license": "Apache-2.0",
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user