1
0
mirror of https://github.com/krislamo/puppet-rsnapshot synced 2024-11-14 01:00:34 +00:00

fix random number generator so that minute, hour... actually have different random numbers, not the same

This commit is contained in:
Norbert Varzariu 2015-12-21 19:11:26 +01:00
parent 569f38f606
commit c55ec365cc
4 changed files with 48 additions and 187 deletions

56
Gemfile
View File

@ -1,34 +1,32 @@
source "https://rubygems.org" source ENV['GEM_SOURCE'] || 'https://rubygems.org'
group :test do group :development, :unit_tests do
gem "rake" gem 'rspec-core', '~> 3.1.7', :require => false
gem "puppet", ENV['PUPPET_GEM_VERSION'] || '~> 3.8.0' gem 'rspec-puppet', '~> 2.1', :require => false
gem "rspec", '< 3.2.0' gem 'puppetlabs_spec_helper', :require => false
gem "rspec-puppet", :git => 'https://github.com/rodjek/rspec-puppet.git' gem 'simplecov', :require => false
gem "puppetlabs_spec_helper" gem 'puppet_facts', :require => false
gem "metadata-json-lint" gem 'json', :require => false
gem "rspec-puppet-facts" gem 'metadata-json-lint', :require => false
gem 'rubocop', '0.33.0' gem 'puppet-lint', '< 1.1.0', :require => false
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" gem 'beaker-rspec', :require => false
gem "beaker-rspec" gem 'serverspec', :require => false
gem "beaker-puppet_install_helper" gem 'beaker-puppet_install_helper', :require => false
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
# vim:ft=ruby

View File

@ -1,14 +1,7 @@
GIT
remote: https://github.com/rodjek/rspec-puppet.git
revision: 8c1913b2697ee4a60db65607967fbb73226c8bd6
specs:
rspec-puppet (2.3.0)
rspec
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
CFPropertyList (2.2.8) CFPropertyList (2.3.2)
activesupport (4.2.5) activesupport (4.2.5)
i18n (~> 0.7) i18n (~> 0.7)
json (~> 1.7, >= 1.7.7) json (~> 1.7, >= 1.7.7)
@ -16,9 +9,6 @@ GEM
thread_safe (~> 0.3, >= 0.3.4) thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.4.0) addressable (2.4.0)
ast (2.2.0)
astrolabe (1.3.1)
parser (~> 2.2)
autoparse (0.3.3) autoparse (0.3.3)
addressable (>= 2.3.1) addressable (>= 2.3.1)
extlib (>= 0.9.15) extlib (>= 0.9.15)
@ -28,7 +18,6 @@ GEM
aws-sdk-v1 (1.66.0) aws-sdk-v1 (1.66.0)
json (~> 1.4) json (~> 1.4)
nokogiri (>= 1.4.4) nokogiri (>= 1.4.4)
backports (3.6.7)
beaker (2.31.0) beaker (2.31.0)
aws-sdk (~> 1.57) aws-sdk (~> 1.57)
beaker-answers (~> 0.0) beaker-answers (~> 0.0)
@ -63,30 +52,16 @@ GEM
serverspec (~> 2) serverspec (~> 2)
specinfra (~> 2) specinfra (~> 2)
builder (3.2.2) builder (3.2.2)
coderay (1.1.0)
colorize (0.7.7)
diff-lcs (1.2.5) diff-lcs (1.2.5)
docile (1.1.5) docile (1.1.5)
docker-api (1.24.1) docker-api (1.24.1)
excon (>= 0.38.0) excon (>= 0.38.0)
json json
domain_name (0.5.25)
unf (>= 0.0.5, < 1.0.0)
ethon (0.8.0)
ffi (>= 1.3.0)
excon (0.45.4) excon (0.45.4)
extlib (0.9.16) extlib (0.9.16)
facter (2.4.4) facter (1.7.6)
CFPropertyList (~> 2.2.6)
facterdb (0.3.0)
facter
jgrep
json
faraday (0.9.2) faraday (0.9.2)
multipart-post (>= 1.2, < 3) multipart-post (>= 1.2, < 3)
faraday_middleware (0.10.0)
faraday (>= 0.7.4, < 0.10)
ffi (1.9.10)
fission (0.5.0) fission (0.5.0)
CFPropertyList (~> 2.2) CFPropertyList (~> 2.2)
fog (1.34.0) fog (1.34.0)
@ -186,13 +161,6 @@ GEM
fog-core fog-core
nokogiri (~> 1.5, >= 1.5.11) nokogiri (~> 1.5, >= 1.5.11)
formatador (0.2.5) formatador (0.2.5)
gh (0.14.0)
addressable
backports
faraday (~> 0.8)
multi_json (~> 1.0)
net-http-persistent (>= 2.7)
net-http-pipeline
google-api-client (0.8.6) google-api-client (0.8.6)
activesupport (>= 3.2) activesupport (>= 3.2)
addressable (~> 2.3) addressable (~> 2.3)
@ -211,50 +179,27 @@ GEM
memoist (~> 0.12) memoist (~> 0.12)
multi_json (~> 1.11) multi_json (~> 1.11)
signet (~> 0.7) signet (~> 0.7)
guard (2.13.0)
formatador (>= 0.2.4)
listen (>= 2.7, <= 4.0)
lumberjack (~> 1.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-rake (1.0.0)
guard
rake
hiera (1.3.4) hiera (1.3.4)
json_pure json_pure
highline (1.7.8)
hirb (0.7.3)
hocon (0.9.3) hocon (0.9.3)
http-cookie (1.0.2)
domain_name (~> 0.5)
i18n (0.7.0) i18n (0.7.0)
inflecto (0.0.2) inflecto (0.0.2)
inifile (2.0.2) inifile (2.0.2)
ipaddress (0.8.0) ipaddress (0.8.0)
jgrep (1.4.0)
json
json (1.8.3) json (1.8.3)
json_pure (1.8.3) json_pure (1.8.3)
jwt (1.5.2) jwt (1.5.2)
launchy (2.4.3) launchy (2.4.3)
addressable (~> 2.3) addressable (~> 2.3)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
little-plugger (1.1.4) little-plugger (1.1.4)
logging (2.0.0) logging (2.0.0)
little-plugger (~> 1.1) little-plugger (~> 1.1)
multi_json (~> 1.10) multi_json (~> 1.10)
lumberjack (1.0.9)
memoist (0.14.0) memoist (0.14.0)
metaclass (0.0.4) metaclass (0.0.4)
metadata-json-lint (0.0.11) metadata-json-lint (0.0.11)
json json
spdx-licenses (~> 1.0) spdx-licenses (~> 1.0)
method_source (0.8.2)
mime-types (2.99) mime-types (2.99)
mini_portile2 (2.0.0) mini_portile2 (2.0.0)
minitest (5.8.3) minitest (5.8.3)
@ -262,72 +207,33 @@ GEM
metaclass (~> 0.0.1) metaclass (~> 0.0.1)
multi_json (1.11.2) multi_json (1.11.2)
multipart-post (2.0.0) multipart-post (2.0.0)
nenv (0.2.0)
net-http-persistent (2.9.4)
net-http-pipeline (1.0.1)
net-scp (1.2.1) net-scp (1.2.1)
net-ssh (>= 2.6.5) net-ssh (>= 2.6.5)
net-ssh (2.9.2) net-ssh (2.9.2)
net-telnet (0.1.1) net-telnet (0.1.1)
netrc (0.11.0)
nokogiri (1.6.7.1) nokogiri (1.6.7.1)
mini_portile2 (~> 2.0.0.rc2) mini_portile2 (~> 2.0.0.rc2)
notiffany (0.0.8)
nenv (~> 0.1)
shellany (~> 0.0)
open_uri_redirections (0.2.1) open_uri_redirections (0.2.1)
parser (2.2.3.0)
ast (>= 1.1, < 3.0)
powerpack (0.1.1)
pry (0.9.12.6)
coderay (~> 1.0)
method_source (~> 0.8)
slop (~> 3.4)
puppet (3.8.4) puppet (3.8.4)
facter (> 1.6, < 3) facter (> 1.6, < 3)
hiera (~> 1.0) hiera (~> 1.0)
json_pure json_pure
puppet-blacksmith (3.3.1) puppet-lint (1.0.1)
puppet (>= 2.7.16)
rest-client
puppet-lint (1.1.0)
puppet-lint-absolute_classname-check (0.1.3)
puppet-lint (~> 1.0)
puppet-lint-classes_and_types_beginning_with_digits-check (0.1.0)
puppet-lint (~> 1.0)
puppet-lint-leading_zero-check (0.1.0)
puppet-lint (~> 1.0)
puppet-lint-trailing_comma-check (0.3.1)
puppet-lint (~> 1.0)
puppet-lint-unquoted_string-check (0.2.5)
puppet-lint (~> 1.0)
puppet-lint-version_comparison-check (0.1.2)
puppet-lint (~> 1.0)
puppet-syntax (2.0.0) puppet-syntax (2.0.0)
rake rake
puppet_facts (0.2.1)
puppetlabs_spec_helper (1.0.1) puppetlabs_spec_helper (1.0.1)
mocha mocha
puppet-lint puppet-lint
puppet-syntax puppet-syntax
rake rake
rspec-puppet rspec-puppet
pusher-client (0.6.2)
json
websocket (~> 1.0)
rainbow (2.0.0)
rake (10.4.2) rake (10.4.2)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rbvmomi (1.8.2) rbvmomi (1.8.2)
builder builder
nokogiri (>= 1.4.1) nokogiri (>= 1.4.1)
trollop trollop
require_all (1.3.3) require_all (1.3.3)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
netrc (~> 0.7)
retriable (1.4.1) retriable (1.4.1)
rspec (3.1.0) rspec (3.1.0)
rspec-core (~> 3.1.0) rspec-core (~> 3.1.0)
@ -343,27 +249,16 @@ GEM
rspec-expectations (>= 3.0.0) rspec-expectations (>= 3.0.0)
rspec-mocks (3.1.3) rspec-mocks (3.1.3)
rspec-support (~> 3.1.0) rspec-support (~> 3.1.0)
rspec-puppet-facts (1.3.0) rspec-puppet (2.3.0)
facter rspec
facterdb (>= 0.3.0)
json
puppet
rspec-support (3.1.2) rspec-support (3.1.2)
rsync (1.0.9) rsync (1.0.9)
rubocop (0.33.0)
astrolabe (~> 1.3)
parser (>= 2.2.2.5, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (1.7.5)
serverspec (2.25.0) serverspec (2.25.0)
multi_json multi_json
rspec (~> 3.0) rspec (~> 3.0)
rspec-its rspec-its
specinfra (~> 2.46) specinfra (~> 2.46)
sfl (2.2) sfl (2.2)
shellany (0.0.1)
signet (0.7.2) signet (0.7.2)
addressable (~> 2.3) addressable (~> 2.3)
faraday (~> 0.9) faraday (~> 0.9)
@ -373,12 +268,7 @@ GEM
docile (~> 1.1.0) docile (~> 1.1.0)
json (~> 1.8) json (~> 1.8)
simplecov-html (~> 0.10.0) simplecov-html (~> 0.10.0)
simplecov-console (0.2.0)
colorize
hirb
simplecov
simplecov-html (0.10.0) simplecov-html (0.10.0)
slop (3.6.0)
spdx-licenses (1.0.0) spdx-licenses (1.0.0)
json json
specinfra (2.47.0) specinfra (2.47.0)
@ -387,55 +277,28 @@ GEM
net-telnet net-telnet
sfl sfl
stringify-hash (0.0.2) stringify-hash (0.0.2)
thor (0.19.1)
thread_safe (0.3.5) thread_safe (0.3.5)
travis (1.8.0)
addressable (~> 2.3)
backports
faraday (~> 0.9)
faraday_middleware (~> 0.9, >= 0.9.1)
gh (~> 0.13)
highline (~> 1.6)
launchy (~> 2.1)
pry (~> 0.9, < 0.10)
pusher-client (~> 0.4)
typhoeus (~> 0.6, >= 0.6.8)
travis-lint (2.0.0)
json
trollop (2.1.2) trollop (2.1.2)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.2) tzinfo (1.2.2)
thread_safe (~> 0.1) thread_safe (~> 0.1)
unf (0.1.4) unf (0.1.4)
unf_ext unf_ext
unf_ext (0.0.7.1) unf_ext (0.0.7.1)
websocket (1.2.2)
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
beaker
beaker-puppet_install_helper beaker-puppet_install_helper
beaker-rspec beaker-rspec
guard-rake facter
json
metadata-json-lint metadata-json-lint
puppet (~> 3.8.0) puppet
puppet-blacksmith puppet-lint (< 1.1.0)
puppet-lint-absolute_classname-check puppet_facts
puppet-lint-classes_and_types_beginning_with_digits-check
puppet-lint-leading_zero-check
puppet-lint-trailing_comma-check
puppet-lint-unquoted_string-check
puppet-lint-version_comparison-check
puppetlabs_spec_helper puppetlabs_spec_helper
rake rspec-core (~> 3.1.7)
rspec (< 3.2.0) rspec-puppet (~> 2.1)
rspec-puppet! serverspec
rspec-puppet-facts simplecov
rubocop (= 0.33.0)
simplecov (>= 0.11.0)
simplecov-console
travis
travis-lint

View File

@ -133,11 +133,11 @@ class rsnapshot::config (
$c_month = $rsnapshot::params::cron[$level]['month'] $c_month = $rsnapshot::params::cron[$level]['month']
$c_weekday = $rsnapshot::params::cron[$level]['weekday'] $c_weekday = $rsnapshot::params::cron[$level]['weekday']
} }
$minute = rand_from_array($c_min, "${host}.${level}") $minute = rand_from_array($c_min, "${host}.${level}.minute")
$hour = rand_from_array($c_hour, "${host}.${level}") $hour = rand_from_array($c_hour, "${host}.${level}.hour")
$monthday = rand_from_array($c_monthday, "${host}.${level}") $monthday = rand_from_array($c_monthday, "${host}.${level}.monthday")
$month = rand_from_array($c_month, "${host}.${level}") $month = rand_from_array($c_month, "${host}.${level}.month")
$weekday = rand_from_array($c_weekday, "${host}.${level}") $weekday = rand_from_array($c_weekday, "${host}.${level}.weekday")
concat::fragment { "${host}.${level}": concat::fragment { "${host}.${level}":
target => $cronfile, target => $cronfile,
content => template('rsnapshot/cron.erb'), content => template('rsnapshot/cron.erb'),

View File

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