Skip to content

Commit

Permalink
Adds logic for managing redis-sentinel package (voxpupuli#187)
Browse files Browse the repository at this point in the history
* redis-sentinel is present in upstream repos
* It's also present for 16.04/xenial onwards
* So lets only manage that package if we're on
Ubuntu newer or if we're managing the repo
  • Loading branch information
petems authored May 3, 2017
1 parent 3d28af9 commit 391c240
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,14 @@

require ::redis

# Debian flavour machines have a dedicated redis-sentinel package
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775414 for context
if $::osfamily == 'Debian' {
package { $package_name:
ensure => $package_ensure,
# Debian flavour machines have a dedicated redis-sentinel package
# This is default in Xenial onwards, unstable debian or PPA/other upstream
# See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775414 for context
if (versioncmp($::operatingsystemmajrelease, '16.04') >= 0 or $::redis::manage_repo) {
package { $package_name:
ensure => $package_ensure,
}
}
}

Expand Down
5 changes: 3 additions & 2 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def centos_facts

def debian_facts
{
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:osfamily => 'Debian',
:operatingsystemmajrelease => '8',
}
end

Expand Down

0 comments on commit 391c240

Please sign in to comment.