Showing with 1,360 additions and 172 deletions.
  1. +12 −12 .travis.yml
  2. +41 −2 CHANGELOG.md
  3. +11 −8 Gemfile
  4. +3 −0 Rakefile
  5. +0 −39 lib/puppet/parser/functions/getvar_emptystring.rb
  6. +30 −21 manifests/config.pp
  7. +4 −7 manifests/init.pp
  8. +64 −14 manifests/instance.pp
  9. +11 −7 manifests/params.pp
  10. +12 −2 manifests/sentinel.pp
  11. +1 −1 manifests/ulimit.pp
  12. +2 −2 metadata.json
  13. +2 −0 spec/acceptance/nodesets/centos-6-docker.yml
  14. +2 −0 spec/acceptance/nodesets/centos-7-docker.yml
  15. +1 −2 spec/acceptance/nodesets/debian-7-docker.yml
  16. +1 −2 spec/acceptance/nodesets/debian-8-docker.yml
  17. +2 −0 spec/acceptance/nodesets/ubuntu-1604-docker.yml
  18. +37 −0 spec/acceptance/redis_cli_task_spec.rb
  19. +0 −2 spec/acceptance/{ → suites/default}/redis_adminstration_spec.rb
  20. 0 spec/acceptance/{ → suites/default}/redis_debian_run_dir_spec.rb
  21. +6 −6 spec/acceptance/{ → suites/default}/redis_multi_instances_one_host_spec.rb
  22. +1 −1 spec/acceptance/{ → suites/default}/redis_multi_node_spec.rb
  23. 0 spec/acceptance/{ → suites/default}/redis_sentinel_one_node_spec.rb
  24. 0 spec/acceptance/{ → suites/default}/redis_spec.rb
  25. +1 −1 spec/acceptance/{ → suites/default}/redisget_spec.rb
  26. +23 −4 spec/classes/redis_centos_6_spec.rb
  27. +19 −0 spec/classes/redis_debian_wheezy_spec.rb
  28. +1 −1 spec/classes/redis_freebsd_spec.rb
  29. +24 −0 spec/classes/redis_sentinel_spec.rb
  30. +36 −5 spec/classes/redis_spec.rb
  31. +62 −0 spec/classes/redis_ubuntu_1404_spec.rb
  32. +35 −15 spec/defines/instance_spec.rb
  33. +1 −0 spec/fixtures/facts/redis_server_3209_version
  34. +15 −2 spec/spec_helper.rb
  35. +65 −8 spec/spec_helper_acceptance.rb
  36. +7 −0 spec/unit/redis_server_version_spec.rb
  37. +10 −0 tasks/redis_cli.json
  38. +22 −0 tasks/redis_cli.rb
  39. +1 −0 templates/redis-sentinel.conf.erb
  40. +1 −1 templates/redis.conf.2.4.10.erb
  41. +3 −3 templates/redis.conf.2.8.erb
  42. +787 −0 templates/redis.conf.3.2.erb
  43. +3 −3 templates/redis.conf.erb
  44. +1 −1 templates/service_templates/redis.RedHat.erb
24 changes: 12 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ matrix:
include:
- sudo: required
dist: trusty
rvm: 2.0.0
rvm: 2.1.9
env: PUPPET_GEM_VERSION="~> 3.0" FUTURE_PARSER="yes" ORDERING="random"
- sudo: required
dist: trusty
rvm: 2.0.0
rvm: 2.2.2
env: PUPPET_GEM_VERSION="~> 3.0" STRICT_VARIABLES="yes" ORDERING="random"
- sudo: required
dist: trusty
Expand All @@ -22,32 +22,32 @@ matrix:
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.5.2" PUPPET_INSTALL_TYPE=agent BEAKER_set="centos-6-docker"
script: bundle exec rake acceptance
env: PUPPET_INSTALL_VERSION="1.10.8" PUPPET_INSTALL_TYPE=agent BEAKER_set="centos-6-docker"
script: bundle exec rake beaker:suites['default',$BEAKER_set]
bundler_args: --without development
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.5.2" PUPPET_INSTALL_TYPE=agent BEAKER_set="centos-7-docker"
script: bundle exec rake acceptance
env: PUPPET_INSTALL_VERSION="1.10.8" PUPPET_INSTALL_TYPE=agent BEAKER_set="centos-7-docker"
script: bundle exec rake beaker:suites['default',$BEAKER_set]
bundler_args: --without development
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.5.2" PUPPET_INSTALL_TYPE=agent BEAKER_set="debian-8-docker"
script: bundle exec rake acceptance
env: PUPPET_INSTALL_VERSION="1.10.8" PUPPET_INSTALL_TYPE=agent BEAKER_set="debian-8-docker"
script: bundle exec rake beaker:suites['default',$BEAKER_set]
bundler_args: --without development
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.5.2" PUPPET_INSTALL_TYPE=agent BEAKER_set="ubuntu-1604-docker"
script: bundle exec rake acceptance
env: PUPPET_INSTALL_VERSION="1.10.8" PUPPET_INSTALL_TYPE=agent BEAKER_set="ubuntu-1604-docker"
script: bundle exec rake beaker:suites['default',$BEAKER_set]
bundler_args: --without development
- sudo: required
services: docker
rvm: '2.3.3'
env: PUPPET_INSTALL_VERSION="1.5.2" PUPPET_INSTALL_TYPE=agent BEAKER_set="ubuntu-1404-docker"
script: bundle exec rake acceptance
script: bundle exec rake beaker:suites['default',$BEAKER_set]
bundler_args: --without development
- sudo: required
rvm: '2.4.0'
Expand All @@ -62,7 +62,7 @@ deploy:
provider: puppetforge
user: arioch
password:
secure: N5N2gNr0MTHY2bjBnW6FKk3qwWpYEJ+h5jM5E6058hX4f3zFYQVWwO0xXtlgJ61bG89KN4hMNhvZgYjlh+aAFMS2iNoNiBcNDI4dksu2lR4iIVeP5FIp8JnEh7jNDuldaIqHo2GKjRSkl70lcNC6NzYcAAsiyFvkn5XEDLkbKR8=
secure: AT/HDAz7kdVJhK4rmx3LmgRrTNzoUvXUYij5hB7Iak3ooXCwkgPoHjZ5AC95dAHWqqsdHA2fPpTohPVNGcRU2vJMx2gh8ckH9ZV9URqNMFreJ+uFiNndzsYFqZqKumwwxR3K/6Df9msawJMqqlrIfJNjGWW+RP93x0m8R2NbQ9M=
on:
tags: true
# all_branches is required to use tags
Expand Down
43 changes: 41 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,45 @@
# Change log
# Change Log

All notable changes to this project will be documented in this file.
## [3.3.0](https://github.com/arioch/puppet-redis/tree/3.3.0) (2018-06-19)
[Full Changelog](https://github.com/arioch/puppet-redis/compare/v3.2.0...3.3.0)

**Closed issues:**

- output\_buffer\_limit\_pubsub and output\_buffer\_limit\_slave [\#263](https://github.com/arioch/puppet-redis/issues/263)
- Can't release - Require Forge Credential Refresh [\#262](https://github.com/arioch/puppet-redis/issues/262)
- Module v3.2.0 not published to forge [\#255](https://github.com/arioch/puppet-redis/issues/255)
- Inconsistent sentinel\_package\_name handling on Debian [\#253](https://github.com/arioch/puppet-redis/issues/253)
- No pidfile for sentinel [\#238](https://github.com/arioch/puppet-redis/issues/238)
- puppet-redis requires outdated puppetlabs-apt module [\#232](https://github.com/arioch/puppet-redis/issues/232)
- Can't use as slave bound to localhost [\#229](https://github.com/arioch/puppet-redis/issues/229)
- \[Feature Request\] Redis::Instance - Set default unixsocket [\#226](https://github.com/arioch/puppet-redis/issues/226)
- Travis Forge Password Changed [\#216](https://github.com/arioch/puppet-redis/issues/216)

**Merged pull requests:**

- Bump Version [\#266](https://github.com/arioch/puppet-redis/pull/266) ([petems](https://github.com/petems))
- Adds logic for installing redid-sentinel package [\#254](https://github.com/arioch/puppet-redis/pull/254) ([petems](https://github.com/petems))
- Update redis mode on wheezy [\#252](https://github.com/arioch/puppet-redis/pull/252) ([petems](https://github.com/petems))
- Fix spec for sentinel [\#251](https://github.com/arioch/puppet-redis/pull/251) ([petems](https://github.com/petems))
- get rid of getvar\_emptystring function [\#249](https://github.com/arioch/puppet-redis/pull/249) ([vicinus](https://github.com/vicinus))
- Added log\_level to sentinel. [\#248](https://github.com/arioch/puppet-redis/pull/248) ([hp197](https://github.com/hp197))
- Adds redis\_cli task [\#245](https://github.com/arioch/puppet-redis/pull/245) ([petems](https://github.com/petems))
- Bump Puppet version for acceptance to 4.10.8 [\#244](https://github.com/arioch/puppet-redis/pull/244) ([petems](https://github.com/petems))
- protected-mode configuration option \(Redis 3.2+\) [\#243](https://github.com/arioch/puppet-redis/pull/243) ([Dan70402](https://github.com/Dan70402))
- Switch to using simp-beaker suites [\#241](https://github.com/arioch/puppet-redis/pull/241) ([petems](https://github.com/petems))
- Bumped apt version dependency to version \< 5.0.0 [\#237](https://github.com/arioch/puppet-redis/pull/237) ([c4m4](https://github.com/c4m4))
- Updates for EL6 [\#236](https://github.com/arioch/puppet-redis/pull/236) ([petems](https://github.com/petems))
- Pin version of redis gem [\#235](https://github.com/arioch/puppet-redis/pull/235) ([petems](https://github.com/petems))
- Added configuration options for client-output-buffer-limit [\#233](https://github.com/arioch/puppet-redis/pull/233) ([Mike-Petersen](https://github.com/Mike-Petersen))
- Allow `slaveof` when binding to localhost [\#231](https://github.com/arioch/puppet-redis/pull/231) ([joshuaspence](https://github.com/joshuaspence))
- Fix issues with missing locale for Debian box [\#224](https://github.com/arioch/puppet-redis/pull/224) ([petems](https://github.com/petems))
- Instance service improvements [\#222](https://github.com/arioch/puppet-redis/pull/222) ([kwevers](https://github.com/kwevers))
- Make sure the service is en/disabled per user request [\#221](https://github.com/arioch/puppet-redis/pull/221) ([kwevers](https://github.com/kwevers))
- Split Redis instance socket files [\#220](https://github.com/arioch/puppet-redis/pull/220) ([kwevers](https://github.com/kwevers))
- Split Redis workdir [\#219](https://github.com/arioch/puppet-redis/pull/219) ([kwevers](https://github.com/kwevers))
- fix package\_ensure version on ubuntu when it is in the 3:3.2.1 format [\#218](https://github.com/arioch/puppet-redis/pull/218) ([sp-joseluis-ledesma](https://github.com/sp-joseluis-ledesma))
- Split the redis instance logfiles by default [\#217](https://github.com/arioch/puppet-redis/pull/217) ([kwevers](https://github.com/kwevers))
- Use package\_ensure if it specifies a version instead of the minimum\_version [\#215](https://github.com/arioch/puppet-redis/pull/215) ([sp-joseluis-ledesma](https://github.com/sp-joseluis-ledesma))

## [v3.2.0](https://github.com/arioch/puppet-redis/tree/v3.2.0) (2017-07-11)
[Full Changelog](https://github.com/arioch/puppet-redis/compare/v3.1.1...v3.2.0)
Expand Down
19 changes: 11 additions & 8 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,27 @@ group :test do
gem 'rubocop-rspec', '~> 1.6', :require => false if RUBY_VERSION >= '2.3.0'
gem 'json_pure', '<= 2.0.1', :require => false if RUBY_VERSION < '2.0.0'
gem 'safe_yaml', '~> 1.0.4', :require => false
gem 'listen', '<= 3.0.6', :require => false
gem 'puppet-syntax', :require => false, git: 'https://github.com/gds-operations/puppet-syntax.git'
gem 'pry'
gem 'rb-readline'
gem 'redis', :require => false
gem 'pry', :require => false
gem 'rb-readline', :require => false
gem 'redis', '3.3.3', :require => false
gem 'mock_redis', :require => false
gem 'rack', '1.6.8', :require => false
gem 'simp-rake-helpers', '3.6.0', :require => false
end

group :development do
gem 'puppet-blacksmith'
gem 'travis'
gem 'github_changelog_generator'
gem 'github_changelog_generator', '1.13.2'
end

group :system_tests do
gem "beaker", '2.41.0', :require => false
gem "beaker-rspec", '5.6.0', :require => false
gem "beaker"
gem "beaker-rspec"
gem 'beaker-puppet_install_helper', :require => false
gem 'beaker-module_install_helper'
gem 'vagrant-wrapper'
gem 'simp-beaker-helpers', :git => 'https://github.com/petems/rubygem-simp-beaker-helpers'
end

ENV['PUPPET_GEM_VERSION'].nil? ? puppetversion = '~> 4.0' : puppetversion = ENV['PUPPET_GEM_VERSION'].to_s
Expand Down
3 changes: 3 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'puppet-syntax/tasks/puppet-syntax'
require 'puppet-strings/tasks'
require 'simp/rake/pupmod/helpers'

Simp::Rake::Pupmod::Helpers.new(File.dirname(__FILE__))

# These two gems aren't always present, for instance
# on Travis with --without development
Expand Down
39 changes: 0 additions & 39 deletions lib/puppet/parser/functions/getvar_emptystring.rb

This file was deleted.

51 changes: 30 additions & 21 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,44 @@
if $::redis::default_install {
redis::instance {'default':
pid_file => $::redis::pid_file,
log_file => $::redis::log_file,
manage_service_file => $::redis::manage_service_file,
unixsocket => $::redis::unixsocket,
workdir => $::redis::workdir,
}
}

if $::redis::ulimit {
contain ::redis::ulimit
}

$service_provider_lookup = pick(getvar('service_provider'), false)

if $service_provider_lookup != 'systemd' {
case $::operatingsystem {
'Debian': {
if $::lsbdistcodename == 'wheezy' {
$var_run_redis_mode = '2755'
$var_run_redis_group = 'redis'
} else {
$var_run_redis_group = $::redis::config_group
$var_run_redis_mode = '2775'
}
}
default: {
$var_run_redis_mode = '0755'
$var_run_redis_group = $::redis::config_group
}
}

file { '/var/run/redis':
ensure => 'directory',
owner => $::redis::config_owner,
group => $var_run_redis_group,
mode => $var_run_redis_mode,
}
}

# Adjust /etc/default/redis-server on Debian systems
case $::osfamily {
'Debian': {
Expand All @@ -49,27 +79,6 @@
mode => $::redis::config_file_mode,
owner => $::redis::config_owner,
}

$service_provider_lookup = pick(getvar_emptystring('service_provider'), false)

if $service_provider_lookup != 'systemd' {
case $::operatingsystem {
'Debian': {
$var_run_redis_mode = '2775'
}
default: {
$var_run_redis_mode = '0755'
}
}

file { '/var/run/redis':
ensure => 'directory',
owner => $::redis::config_owner,
group => $::redis::config_group,
mode => $var_run_redis_mode,
}
}

}

default: {
Expand Down
11 changes: 4 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
# @param [String] package_name Upstream package name.
# @param [String] pid_file Where to store the pid.
# @param [String] port Configure which port to listen on.
# @param [String] protected_mode Whether protected mode is enabled or not. Only applicable when no bind is set.
# @param [String] ppa_repo Specify upstream (Ubuntu) PPA entry.
# @param [String] rdbcompression Enable/disable compression of string objects using LZF when dumping.
# @param [String] repl_backlog_size The replication backlog size
Expand Down Expand Up @@ -143,6 +144,8 @@
$auto_aof_rewrite_min_size = $::redis::params::auto_aof_rewrite_min_size,
$auto_aof_rewrite_percentage = $::redis::params::auto_aof_rewrite_percentage,
$bind = $::redis::params::bind,
$output_buffer_limit_slave = $::redis::params::output_buffer_limit_slave,
$output_buffer_limit_pubsub = $::redis::params::output_buffer_limit_pubsub,
$conf_template = $::redis::params::conf_template,
$config_dir = $::redis::params::config_dir,
$config_dir_mode = $::redis::params::config_dir_mode,
Expand Down Expand Up @@ -184,6 +187,7 @@
$package_name = $::redis::params::package_name,
$pid_file = $::redis::params::pid_file,
$port = $::redis::params::port,
$protected_mode = $::redis::params::protected_mode,
$ppa_repo = $::redis::params::ppa_repo,
$rdbcompression = $::redis::params::rdbcompression,
$repl_backlog_size = $::redis::params::repl_backlog_size,
Expand Down Expand Up @@ -246,13 +250,6 @@
warning("Puppet 3 is EOL as of 01/01/2017, The 3.X.X releases of the module are the last that will support Puppet 3\nFor more information, see https://github.com/arioch/puppet-redis#puppet-3-support")
}

# Sanity check
if $::redis::slaveof {
if $::redis::bind =~ /^127.0.0./ {
fail "Replication is not possible when binding to ${::redis::bind}."
}
}

exec { 'systemd-reload-redis':
command => 'systemctl daemon-reload',
refreshonly => true,
Expand Down
Loading