Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Commit 6e4bd03

Browse files
committed
Merge pull request #74 from echocat/develop
backmerge for release 1.8.1
2 parents ec430e7 + d01c1f4 commit 6e4bd03

24 files changed

+436
-121
lines changed

.gitignore

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
*.gem
2+
*.rbc
3+
/.config
4+
/coverage/
5+
/InstalledFiles
6+
/pkg/
7+
/spec/reports/
8+
/test/tmp/
9+
/test/version_tmp/
10+
/tmp/
11+
12+
# Beaker/Vagrant
13+
.vagrant/
14+
15+
# Puppet Files
16+
pkg
17+
spec/fixtures
18+
.rspec_system
19+
.vagrant/
20+
21+
## Specific to RubyMotion:
22+
.dat*
23+
.repl_history
24+
build/
25+
26+
## Documentation cache and generated files:
27+
/.yardoc/
28+
/_yardoc/
29+
/doc/
30+
/rdoc/
31+
32+
## Environment normalisation:
33+
/.bundle/
34+
/lib/bundler/man/
35+
36+
Gemfile.lock
37+
.ruby-version
38+
.ruby-gemset
39+
40+
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
41+
.rvmrc
42+
43+
# idea
44+
./idea
45+
.idea/
46+
47+
# geppetto/eclipse
48+
.project
49+
50+
# others
51+
*swp
52+
.DS_Store

.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--color
2+
--format documentation

.travis.yml

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
---
22
sudo: false
33
language: ruby
4+
cache: bundler
45
bundler_args: --without system_tests
5-
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--format documentation'"
6+
before_install: rm Gemfile.lock || true
7+
script: bundle exec rake validate lint spec
68
matrix:
79
fast_finish: true
810
include:
9-
- rvm: 1.9.3
10-
env: PUPPET_GEM_VERSION="~> 3.4.0"
11-
- rvm: 1.8.7
12-
env: PUPPET_GEM_VERSION="~> 3.0"
13-
- rvm: 1.9.3
14-
env: PUPPET_GEM_VERSION="~> 3.0"
15-
- rvm: 1.9.3
16-
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
17-
- rvm: 2.1.5
18-
env: PUPPET_GEM_VERSION="~> 3.0"
19-
- rvm: 2.1.5
20-
env: PUPPET_GEM_VERSION="~> 3.6.0"
21-
- rvm: 2.1.5
22-
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
11+
- rvm: 2.1.6
12+
env: PUPPET_GEM_VERSION='~> 4.0' COVERAGE=yes STRICT_VARIABLES=yes
13+
- rvm: 2.1.6
14+
env: PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#stable
15+
- rvm: 2.1.5
16+
env: PUPPET_GEM_VERSION='~> 3.0' FUTURE_PARSER=yes
17+
- rvm: 2.1.5
18+
env: PUPPET_GEM_VERSION='~> 3.0'
19+
- rvm: 1.9.3
20+
env: PUPPET_GEM_VERSION='~> 3.0'
2321
notifications:
2422
email: false

CHANGELOG.md

+20
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
## 2016-04-08 - 1.8.1 (Bugfix release)
2+
3+
#### Bugfixes:
4+
5+
- (318d2cb) RedHat 7: fix systemd scripts for Server and Sentinel
6+
7+
## 2016-04-05 - 1.8.0 (Feature/Bugfix release)
8+
9+
#### Features:
10+
11+
- (e37283e) Add the possibility to exclude logrotate
12+
- (316f492) RedHat 7: add systemd support
13+
- (316f492) Sentinel: add parameter `sentinel_ip` for binding address
14+
- (3fdbca0) Server::install: add parameter `download_base` at install class to specify download url of source tar.gz
15+
- (e47fc28) Gentoo: add support for Gentoo
16+
17+
#### Bugfixes:
18+
19+
- (6dea873) fix source entry for forge api in metadata.json
20+
121
## 2015-12-02 - 1.7.0 (Feature/Bugfix release)
222

323
#### Features:

Gemfile

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1-
source 'https://rubygems.org'
1+
source ENV['GEM_SOURCE'] || "https://rubygems.org"
22

3-
puppetversion = ENV.key?('PUPPET_GEM_VERSION') ? "#{ENV['PUPPET_GEM_VERSION']}" : ['>= 3.3']
4-
facterversion = ENV.key?('FACTER_GEM_VERSION') ? "#{ENV['FACTER_GEM_VERSION']}" : ['>= 1.7']
5-
gem 'puppet', puppetversion
6-
gem 'puppetlabs_spec_helper', '>= 0.1.0'
7-
gem 'puppet-lint', '>= 0.3.2'
8-
gem 'facter', facterversion
9-
gem 'rspec', '< 3.2.0'
3+
def location_for(place, version = nil)
4+
if place =~ /^((?:git|https?)[:@][^#]*)#(.*)/
5+
[version, { :git => $1, :branch => $2, :require => false }].compact
6+
elsif place =~ /^file:\/\/(.*)/
7+
['>= 0', { :path => File.expand_path($1), :require => false }]
8+
else
9+
[place, version, { :require => false }].compact
10+
end
11+
end
12+
13+
gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'] || '~> 4')
14+
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION'] || '~> 2')
15+
gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false
16+
gem 'puppet-lint', '>= 0.3.2', :require => false
17+
gem 'rspec-puppet', '>= 2.3.2', :require => false
18+
gem 'rspec-puppet-facts', :require => false
19+
gem 'metadata-json-lint', :require => false
20+
gem 'rake', '< 11.0.0' # rubi <1.9 versus rake 11.0.0 workaround
21+
22+
if File.exists? "#{__FILE__}.local"
23+
eval(File.read("#{__FILE__}.local"), binding)
24+
end

README.md

+26-3
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ This module installs and makes basic configs for multiple redis instances on
2222
the same node. It installs redis via REPO or from source. (http://redis.io/)
2323
It also can configure the monitoring server Sentinel.
2424

25-
Github Master: [![Build Status](https://secure.travis-ci.org/echocat/puppet-redis.png?branch=master)](https://travis-ci.org/echocat/puppet-redis)
26-
25+
[![Puppet Forge](http://img.shields.io/puppetforge/v/dwerder/redis.svg)](https://forge.puppetlabs.com/dwerder/redis)
26+
[![Build Status](https://secure.travis-ci.org/echocat/puppet-redis.png?branch=master)](https://travis-ci.org/echocat/puppet-redis)
27+
[![Puppet Forge Downloads](http://img.shields.io/puppetforge/dt/dwerder/redis.svg)](https://forge.puppetlabs.com/dwerder/redis)
2728

2829
##Setup
2930

@@ -232,6 +233,11 @@ the redis install package. Therefor, these values must be adjusted too.
232233
Redis system group. Default: undef (string)
233234
Default 'undef' results to 'root' as redis system group
234235

236+
#####`download_base`
237+
238+
Url where to find the source tar.gz.
239+
Default value is 'http://download.redis.io/releases'
240+
235241
####Defined Type: `redis::server`
236242

237243
Used to configure redis instances. You can setup multiple redis servers on the
@@ -366,6 +372,10 @@ Since redis automatically rewrite their config since
366372
version 2.8 setting this to `true` will trigger a redis restart on each puppet
367373
run with redis 2.8 or later.
368374

375+
#####`manage_logrotate`
376+
377+
Configure logrotate rules for redis server. Default: true
378+
369379
##### High Availability Options
370380

371381
#####`slaveof`
@@ -406,9 +416,13 @@ Name of Redis instance. Default: call name of the function.
406416
The name is used to create the init script(s), which follows the pattern
407417
`redis-sentinel_${sentinel_name}`
408418

419+
#####`sentinel_ip`
420+
421+
Listen IP of sentinel. Default: 6379
422+
409423
#####`sentinel_port`
410424

411-
Listen port of Redis. Default: 6379
425+
Listen port of sentinel. Default: 6379
412426

413427
#####`sentinel_log_dir`
414428

@@ -420,6 +434,11 @@ Path for log. Full log path is `sentinel_log_dir`/sentinel_`sentinel_name`.log.
420434
Default is '/var/run' (string).
421435
Path for pid file. Full pid file path is `sentinel_pid_dir`/sentinel_`sentinel_name`.pid.
422436

437+
#####`sentinel_run_dir`
438+
439+
Default: `/var/run/redis` (string)
440+
Since sentinels automatically rewrite their config since version 2.8 the puppet managed config will be copied
441+
to this directory and than sentinel will start with this copy.
423442

424443
#####`monitors`
425444

@@ -459,6 +478,10 @@ sentinel restart. Since sentinels automatically rewrite their config since
459478
version 2.8 setting this to `true` will trigger a sentinel restart on each puppet
460479
run with redis 2.8 or later.
461480

481+
#####`manage_logrotate`
482+
483+
Configure logrotate rules for redis server. Default: true
484+
462485
##Requirements
463486

464487
###Modules needed:

manifests/install.pp

+12-9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
# [*redis_group*]
2121
# The redis system group. Default value is 'undef', which results to 'root' as system group.
2222
#
23+
# [*download_base*]
24+
# Url where to find the source tar.gz. Default value is 'http://download.redis.io/releases'
25+
#
2326
class redis::install (
2427
$redis_version = $::redis::params::redis_version,
2528
$redis_build_dir = $::redis::params::redis_build_dir,
@@ -28,6 +31,7 @@
2831
$download_tool = $::redis::params::download_tool,
2932
$redis_user = $::redis::params::redis_user,
3033
$redis_group = $::redis::params::redis_group,
34+
$download_base = $::redis::params::download_base,
3135
) inherits redis {
3236
if ( $redis_package == true ) {
3337
case $::operatingsystem {
@@ -48,6 +52,9 @@
4852
}
4953
}
5054
}
55+
'Gentoo': {
56+
package { 'dev-db/redis' : ensure => $redis_version, }
57+
}
5158
default: {
5259
fail('The module does not support this OS.')
5360
}
@@ -60,7 +67,7 @@
6067
ensure_packages('build-essential')
6168
Package['build-essential'] -> Anchor['redis::prepare_build']
6269
}
63-
'Fedora', 'RedHat', 'CentOS', 'OEL', 'OracleLinux', 'Amazon', 'Scientific': {
70+
'Fedora', 'RedHat', 'CentOS', 'OEL', 'OracleLinux', 'Amazon', 'Scientific', 'Sles': {
6471
ensure_packages('make')
6572
Package['make'] -> Anchor['redis::prepare_build']
6673
ensure_packages('gcc')
@@ -76,7 +83,7 @@
7683
exec { "Make dir ${redis_build_dir}":
7784
command => "mkdir -p ${redis_build_dir}",
7885
creates => $redis_build_dir,
79-
path => $::path,
86+
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
8087
cwd => '/',
8188
user => 'root',
8289
group => 'root',
@@ -87,18 +94,14 @@
8794
ensure => directory,
8895
}
8996

90-
if $redis_version == $::redis::params::redis_version {
91-
$redis_download_url = 'http://download.redis.io/redis-stable.tar.gz'
92-
} else {
93-
$redis_download_url = "http://download.redis.io/releases/redis-${redis_version}.tar.gz"
94-
}
97+
$redis_download_url = "${download_base}/redis-${redis_version}.tar.gz"
9598

9699
exec { "Download and untar redis ${redis_version}":
97100
require => File[$redis_build_dir],
98101
before => Anchor['redis::prepare_build'],
99102
command => "${download_tool} ${redis_download_url} | tar xz",
100103
creates => "${redis_build_dir}/redis-${::redis::install::redis_version}",
101-
path => $::path,
104+
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
102105
cwd => $redis_build_dir,
103106
user => 'root',
104107
group => 'root',
@@ -113,7 +116,7 @@
113116
command => 'make',
114117
creates => "${redis_build_dir}/redis-${redis_version}/src/redis-server",
115118
cwd => "${redis_build_dir}/redis-${::redis::install::redis_version}/",
116-
path => $::path,
119+
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
117120
user => 'root',
118121
group => 'root',
119122
}

manifests/params.pp

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
$download_tool = 'curl -s -L'
99
$redis_user = undef
1010
$redis_group = undef
11+
$download_base = 'http://download.redis.io/releases'
1112
}

0 commit comments

Comments
 (0)