Showing with 33 additions and 3 deletions.
  1. +1 −1 Modulefile
  2. +7 −0 README.md
  3. +1 −0 manifests/init.pp
  4. +2 −1 manifests/params.pp
  5. +4 −0 manifests/preinstall.pp
  6. +18 −1 spec/classes/redis_spec.rb
2 changes: 1 addition & 1 deletion Modulefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name 'arioch-redis'
version '0.0.5'
version '0.0.6'
author 'Tom De Vylder'
license 'Apache License, Version 2.0'
summary 'Redis module'
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ repositories you can use this snippet:
manage_repo => true,
}

On Ubuntu, "chris-lea/redis-server" ppa repo will be added. You can change it by using ppa_repo parameter:

class { 'redis':
manage_repo => true,
ppa_repo => 'ppa:rwky/redis',
}

## Unit testing

Plain RSpec:
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
$package_name = $::redis::params::package_name,
$pid_file = $::redis::params::pid_file,
$port = $::redis::params::port,
$ppa_repo = $::redis::params::ppa_repo,
$rdbcompression = $::redis::params::rdbcompression,
$repl_ping_slave_period = $::redis::params::repl_ping_slave_period,
$repl_timeout = $::redis::params::repl_timeout,
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$appendonly = false
$auto_aof_rewrite_min_size = '64min'
$auto_aof_rewrite_percentage = 100
$bind = '127.0.0.1'
$bind = $::ipaddress
$daemonize = true
$databases = 16
$dbfilename = 'dump.rdb'
Expand Down Expand Up @@ -66,6 +66,7 @@
$service_hasstatus = false
$service_name = 'redis-server'
$service_user = 'redis'
$ppa_repo = 'ppa:chris-lea/redis-server'
}

'RedHat': {
Expand Down
4 changes: 4 additions & 0 deletions manifests/preinstall.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
}
}

'Ubuntu': {
apt::ppa { $::redis::ppa_repo: }
}

default: {
}
}
Expand Down
19 changes: 18 additions & 1 deletion spec/classes/redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,18 @@
it { should create_apt__source('dotdeb') }
end

context 'on Ubuntu' do
let (:facts) {
{
:lsbdistcodename => 'raring',
:operatingsystem => 'Ubuntu',
:osfamily => 'Debian'
}
}

it { should create_apt__ppa('ppa:chris-lea/redis-server') }
end

context 'on RHEL 6' do
let (:facts) {
{
Expand Down Expand Up @@ -554,7 +566,12 @@

describe 'with parameter: slaveof' do
context 'binding to localhost' do
let (:params) { { :slaveof => '_VALUE_' } }
let (:params) {
{
:bind => '127.0.0.1',
:slaveof => '_VALUE_'
}
}

it do
expect {
Expand Down