Skip to content

Commit

Permalink
removed hardcoded packages and replaced with module dependencies for …
Browse files Browse the repository at this point in the history
…gcc and wget
  • Loading branch information
garethr committed Dec 2, 2012
1 parent 81760af commit 175b7af
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .fixtures.yml
@@ -1,3 +1,6 @@
fixtures:
repositories:
wget: git://github.com/maestrodev/puppet-wget.git
gcc: git://github.com/puppetlabs/puppetlabs-gcc.git
symlinks:
"redis": "#{source_dir}"
2 changes: 2 additions & 0 deletions Modulefile
Expand Up @@ -3,3 +3,5 @@ version '0.0.8'
author 'Thomas Van Doren'
license 'BSD'
project_page 'https://github.com/thomasvandoren/puppet-redis'
dependency 'maestrodev/wget'
dependency 'puppetlabs/gcc'
8 changes: 4 additions & 4 deletions manifests/init.pp
Expand Up @@ -92,6 +92,10 @@
$redis_slowlog_max_len = 1024,
$redis_password = false,
) {

include wget
include gcc

case $version {
/^2\.4\.\d+$/: {
if ($redis_max_clients == false) {
Expand All @@ -111,10 +115,6 @@
$redis_pkg_name = "redis-${version}.tar.gz"
$redis_pkg = "${redis_src_dir}/${redis_pkg_name}"

package { ['build-essential', 'wget']:
ensure => present,
}

File {
owner => root,
group => root,
Expand Down
8 changes: 4 additions & 4 deletions spec/classes/redis_spec.rb
Expand Up @@ -11,8 +11,8 @@
end # let

it do
should contain_package('build-essential').with_ensure('present')
should contain_package('wget').with_ensure('present')
should include_class('gcc')
should include_class('wget')

should contain_file('/opt/redis-src').with(:ensure => 'directory')
should contain_file('/etc/redis').with(:ensure => 'directory')
Expand Down Expand Up @@ -72,8 +72,8 @@
end # let

it do
should contain_package('build-essential').with_ensure('present')
should contain_package('wget').with_ensure('present')
should include_class('gcc')
should include_class('wget')

should contain_file('/fake/path/to/redis-src').with(:ensure => 'directory')
should contain_file('/etc/redis').with(:ensure => 'directory')
Expand Down

0 comments on commit 175b7af

Please sign in to comment.