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

Commit

Permalink
Merge pull request #74 from echocat/develop
Browse files Browse the repository at this point in the history
backmerge for release 1.8.1
  • Loading branch information
dwerder committed Apr 8, 2016
2 parents ec430e7 + d01c1f4 commit 6e4bd03
Show file tree
Hide file tree
Showing 24 changed files with 436 additions and 121 deletions.
52 changes: 52 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/test/tmp/
/test/version_tmp/
/tmp/

# Beaker/Vagrant
.vagrant/

# Puppet Files
pkg
spec/fixtures
.rspec_system
.vagrant/

## Specific to RubyMotion:
.dat*
.repl_history
build/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalisation:
/.bundle/
/lib/bundler/man/

Gemfile.lock
.ruby-version
.ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# idea
./idea
.idea/

# geppetto/eclipse
.project

# others
*swp
.DS_Store
2 changes: 2 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
--color
--format documentation
28 changes: 13 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
---
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'"
before_install: rm Gemfile.lock || true
script: bundle exec rake validate lint spec
matrix:
fast_finish: true
include:
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.4.0"
- rvm: 1.8.7
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 1.9.3
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.6.0"
- rvm: 2.1.5
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes"
- rvm: 2.1.6
env: PUPPET_GEM_VERSION='~> 4.0' COVERAGE=yes STRICT_VARIABLES=yes
- rvm: 2.1.6
env: PUPPET_GEM_VERSION='https://github.com/puppetlabs/puppet.git#stable
- rvm: 2.1.5
env: PUPPET_GEM_VERSION='~> 3.0' FUTURE_PARSER=yes
- rvm: 2.1.5
env: PUPPET_GEM_VERSION='~> 3.0'
- rvm: 1.9.3
env: PUPPET_GEM_VERSION='~> 3.0'
notifications:
email: false
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
## 2016-04-08 - 1.8.1 (Bugfix release)

#### Bugfixes:

- (318d2cb) RedHat 7: fix systemd scripts for Server and Sentinel

## 2016-04-05 - 1.8.0 (Feature/Bugfix release)

#### Features:

- (e37283e) Add the possibility to exclude logrotate
- (316f492) RedHat 7: add systemd support
- (316f492) Sentinel: add parameter `sentinel_ip` for binding address
- (3fdbca0) Server::install: add parameter `download_base` at install class to specify download url of source tar.gz
- (e47fc28) Gentoo: add support for Gentoo

#### Bugfixes:

- (6dea873) fix source entry for forge api in metadata.json

## 2015-12-02 - 1.7.0 (Feature/Bugfix release)

#### Features:
Expand Down
31 changes: 23 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
source 'https://rubygems.org'
source ENV['GEM_SOURCE'] || "https://rubygems.org"

puppetversion = ENV.key?('PUPPET_GEM_VERSION') ? "#{ENV['PUPPET_GEM_VERSION']}" : ['>= 3.3']
facterversion = ENV.key?('FACTER_GEM_VERSION') ? "#{ENV['FACTER_GEM_VERSION']}" : ['>= 1.7']
gem 'puppet', puppetversion
gem 'puppetlabs_spec_helper', '>= 0.1.0'
gem 'puppet-lint', '>= 0.3.2'
gem 'facter', facterversion
gem 'rspec', '< 3.2.0'
def location_for(place, version = nil)
if place =~ /^((?:git|https?)[:@][^#]*)#(.*)/
[version, { :git => $1, :branch => $2, :require => false }].compact
elsif place =~ /^file:\/\/(.*)/
['>= 0', { :path => File.expand_path($1), :require => false }]
else
[place, version, { :require => false }].compact
end
end

gem 'puppet', *location_for(ENV['PUPPET_GEM_VERSION'] || '~> 4')
gem 'facter', *location_for(ENV['FACTER_GEM_VERSION'] || '~> 2')
gem 'puppetlabs_spec_helper', '>= 0.1.0', :require => false
gem 'puppet-lint', '>= 0.3.2', :require => false
gem 'rspec-puppet', '>= 2.3.2', :require => false
gem 'rspec-puppet-facts', :require => false
gem 'metadata-json-lint', :require => false
gem 'rake', '< 11.0.0' # rubi <1.9 versus rake 11.0.0 workaround

if File.exists? "#{__FILE__}.local"
eval(File.read("#{__FILE__}.local"), binding)
end
29 changes: 26 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ This module installs and makes basic configs for multiple redis instances on
the same node. It installs redis via REPO or from source. (http://redis.io/)
It also can configure the monitoring server Sentinel.

Github Master: [![Build Status](https://secure.travis-ci.org/echocat/puppet-redis.png?branch=master)](https://travis-ci.org/echocat/puppet-redis)

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

##Setup

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

#####`download_base`

Url where to find the source tar.gz.
Default value is 'http://download.redis.io/releases'

####Defined Type: `redis::server`

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

#####`manage_logrotate`

Configure logrotate rules for redis server. Default: true

##### High Availability Options

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

#####`sentinel_ip`

Listen IP of sentinel. Default: 6379

#####`sentinel_port`

Listen port of Redis. Default: 6379
Listen port of sentinel. Default: 6379

#####`sentinel_log_dir`

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

#####`sentinel_run_dir`

Default: `/var/run/redis` (string)
Since sentinels automatically rewrite their config since version 2.8 the puppet managed config will be copied
to this directory and than sentinel will start with this copy.

#####`monitors`

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

#####`manage_logrotate`

Configure logrotate rules for redis server. Default: true

##Requirements

###Modules needed:
Expand Down
21 changes: 12 additions & 9 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# [*redis_group*]
# The redis system group. Default value is 'undef', which results to 'root' as system group.
#
# [*download_base*]
# Url where to find the source tar.gz. Default value is 'http://download.redis.io/releases'
#
class redis::install (
$redis_version = $::redis::params::redis_version,
$redis_build_dir = $::redis::params::redis_build_dir,
Expand All @@ -28,6 +31,7 @@
$download_tool = $::redis::params::download_tool,
$redis_user = $::redis::params::redis_user,
$redis_group = $::redis::params::redis_group,
$download_base = $::redis::params::download_base,
) inherits redis {
if ( $redis_package == true ) {
case $::operatingsystem {
Expand All @@ -48,6 +52,9 @@
}
}
}
'Gentoo': {
package { 'dev-db/redis' : ensure => $redis_version, }
}
default: {
fail('The module does not support this OS.')
}
Expand All @@ -60,7 +67,7 @@
ensure_packages('build-essential')
Package['build-essential'] -> Anchor['redis::prepare_build']
}
'Fedora', 'RedHat', 'CentOS', 'OEL', 'OracleLinux', 'Amazon', 'Scientific': {
'Fedora', 'RedHat', 'CentOS', 'OEL', 'OracleLinux', 'Amazon', 'Scientific', 'Sles': {
ensure_packages('make')
Package['make'] -> Anchor['redis::prepare_build']
ensure_packages('gcc')
Expand All @@ -76,7 +83,7 @@
exec { "Make dir ${redis_build_dir}":
command => "mkdir -p ${redis_build_dir}",
creates => $redis_build_dir,
path => $::path,
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
cwd => '/',
user => 'root',
group => 'root',
Expand All @@ -87,18 +94,14 @@
ensure => directory,
}

if $redis_version == $::redis::params::redis_version {
$redis_download_url = 'http://download.redis.io/redis-stable.tar.gz'
} else {
$redis_download_url = "http://download.redis.io/releases/redis-${redis_version}.tar.gz"
}
$redis_download_url = "${download_base}/redis-${redis_version}.tar.gz"

exec { "Download and untar redis ${redis_version}":
require => File[$redis_build_dir],
before => Anchor['redis::prepare_build'],
command => "${download_tool} ${redis_download_url} | tar xz",
creates => "${redis_build_dir}/redis-${::redis::install::redis_version}",
path => $::path,
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
cwd => $redis_build_dir,
user => 'root',
group => 'root',
Expand All @@ -113,7 +116,7 @@
command => 'make',
creates => "${redis_build_dir}/redis-${redis_version}/src/redis-server",
cwd => "${redis_build_dir}/redis-${::redis::install::redis_version}/",
path => $::path,
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
user => 'root',
group => 'root',
}
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
$download_tool = 'curl -s -L'
$redis_user = undef
$redis_group = undef
$download_base = 'http://download.redis.io/releases'
}
Loading

0 comments on commit 6e4bd03

Please sign in to comment.