Skip to content

Instantly share code, notes, and snippets.

@arthurschreiber
Created January 21, 2014 12:19
Show Gist options
  • Save arthurschreiber/8538997 to your computer and use it in GitHub Desktop.
Save arthurschreiber/8538997 to your computer and use it in GitHub Desktop.
exec { "download redis-${version}":
command => "wget --output-document redis-${version}.tar.gz https://github.com/antirez/redis/archive/${version}.tar.gz",
cwd => '/usr/local/src',
path => ['/bin', '/usr/bin'],
creates => "/usr/local/src/redis-${version}.tar.gz",
} -> exec { "extract redis-${version}":
command => "tar xfz redis-${version}.tar.gz",
cwd => '/usr/local/src',
path => ['/bin', '/usr/bin'],
creates => "/usr/local/src/redis-${version}",
} -> exec { "install redis-${version}":
command => "env ARCH= make && make install PREFIX=/opt/redis-${version}",
cwd => "/usr/local/src/redis-${version}",
path => ['/bin', '/usr/bin'],
creates => "/opt/redis-${version}",
} -> file { '/etc/init.d/redis':
ensure => 'file',
source => 'puppet:///modules/redis/redis.sh',
mode => '0755',
} -> file { '/opt/redis':
ensure => 'link',
target => "/opt/redis-${version}"
} ~> exec { "cp -f /usr/local/src/redis-${version}/redis.conf /etc/redis.conf":
refreshonly => true,
path => ['/bin', '/usr/bin'],
}
file { '/var/lib/redis':
ensure => 'directory',
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment