1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2025-09-13 15:59:28 +00:00

working prototype (config generation)

This commit is contained in:
Norbert Varzariu
2015-12-19 11:16:05 +01:00
commit 234c5935a6
21 changed files with 781 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
HOSTS:
ubuntu-1204-x64:
default_apply_opts:
strict_variables:
platform: ubuntu-12.04-amd64
hypervisor : docker
image: ubuntu:12.04
# This stops the image from being deleted on completion, speeding up the process.
docker_preserve_image: true
CONFIG:
type: foss
log_level: debug

View File

@@ -0,0 +1,10 @@
HOSTS:
ubuntu-1204-x64:
default_apply_opts:
strict_variables:
platform: ubuntu-12.04-amd64
hypervisor : vagrant
box : puppetlabs/ubuntu-12.04-64-nocm
CONFIG:
type: foss
log_level: debug

View File

@@ -0,0 +1,12 @@
HOSTS:
ubuntu-1404-x64:
default_apply_opts:
strict_variables:
platform: ubuntu-14.04-amd64
hypervisor : docker
image: ubuntu:14.04
# This stops the image from being deleted on completion, speeding up the process.
docker_preserve_image: true
CONFIG:
type: foss
log_level: debug

View File

@@ -0,0 +1,10 @@
HOSTS:
ubuntu-1404-x64:
default_apply_opts:
strict_variables:
platform: ubuntu-14.04-amd64
hypervisor : vagrant
box : puppetlabs/ubuntu-14.04-64-nocm
CONFIG:
type: foss
log_level: debug

37
spec/classes/init_spec.rb Normal file
View File

@@ -0,0 +1,37 @@
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
end

6
spec/spec.opts Normal file
View File

@@ -0,0 +1,6 @@
--format
s
--colour
--loadby
mtime
--backtrace

29
spec/spec_helper.rb Normal file
View File

@@ -0,0 +1,29 @@
require 'puppetlabs_spec_helper/module_spec_helper'
RSpec.configure do |c|
c.include PuppetlabsSpec::Files
c.before :each do
# Ensure that we don't accidentally cache facts and environment
# between test cases.
Facter::Util::Loader.any_instance.stubs(:load_all)
Facter.clear
Facter.clear_messages
# Store any environment variables away to be restored later
@old_env = {}
ENV.each_key {|k| @old_env[k] = ENV[k]}
if Gem::Version.new(`puppet --version`) >= Gem::Version.new('3.5')
Puppet.settings[:strict_variables]=true
end
if ENV['PARSER']
Puppet.settings[:parser]=ENV['PARSER']
end
end
c.after :each do
PuppetlabsSpec::Files.cleanup
end
end