Skip to content

Commit

Permalink
Avoid resource dependency when having both Redis Server & Sentinel
Browse files Browse the repository at this point in the history
When running Redis Server & Redis Sentinel on the same node, avoid a
resource dupplication with package resource.
  • Loading branch information
Emilien Macchi committed Jan 15, 2015
1 parent d72af9a commit d024c0b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# This class installs the application.
#
class redis::install {
package { $::redis::package_name:
ensure => $::redis::package_ensure,
}
ensure_resource('package', $::redis::package_name, {
'ensure' => $::redis::package_ensure
})
}

6 changes: 3 additions & 3 deletions manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@
) inherits redis::params {


package { $::redis::params::package_name:
ensure => $::redis::params::package_ensure,
}
ensure_resource('package', $::redis::params::package_name, {
'ensure' => $::redis::params::package_ensure
})

file {
$config_file_orig:
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/redis_sentinel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@
describe 'redis::sentinel', :type => :class do
let (:facts) { debian_facts }

let :pre_condition do
[
'class { redis: }'
]
end

describe 'without parameters' do

it { should create_class('redis::sentinel') }
Expand Down

0 comments on commit d024c0b

Please sign in to comment.