fsalum / puppet-redis

Redis Server Module for Puppet
Apache License 2.0
21 stars 68 forks source link

Logic for redis config file to support 2.4.x through 2.8.x #31

Closed zeroecco closed 10 years ago

zeroecco commented 10 years ago

Added logic via a puppet fact to parse the redis config intelligently for support of 2.4 through 2.8 on centos

fsalum commented 10 years ago

thanks @zeroecco I'm gonna test it and merge.

zeroecco commented 10 years ago

Not sure why Travis failed, something to due with credentials...

fsalum commented 10 years ago

that's normal with pull requests.. the change needs to come from me for it to validate the credentials, not sure if there is a way to avoid it since I use the forge plugin for travis.

fsalum commented 10 years ago

I'm going to review #32 and also add this to the tests during the merge.

fsalum commented 10 years ago

Merged this change on my branch for testing: https://github.com/fsalum/puppet-redis/tree/zxjinn-master

dhonig commented 10 years ago

@fsalum so looking for a way to specify the version of Redis, looks like the PR request above addresses this?

fsalum commented 10 years ago

@dhonig yes and no.. it uses the 'redis-cli --version' to find and re-set the version so we can lookup and apply the correct redis.conf.. if it finds 2.4.10 it sets redis_version == 2.4.x, for 2.8.8 to 2.8.x and so on for all other releases.

dhonig commented 10 years ago

Lol..happy to help out once I'm not a puppet novice, for now I just want to be able to class{ redis: version => '2.8.x' {

and have something work, is that supported?

fsalum commented 10 years ago

@dhonig not really, the current module installs the standard redis version coming from your OS repository. Per example CentOS using epel will install redis 2.4, Debian Precise redis 2.2, different flavors of ubuntu installs 2.4, 2.6 or 2.8. :)

For you to specify something like you want I would need to grab the redis .tar.gz and compile it, install init scripts, etc. Not going that route for now.

dhonig commented 10 years ago

Makes perfect sense. This is exactly why my current dev setup with puppet takes 20 minutes. Understood.

inhumantsar commented 10 years ago

Building on dhonig's comment (and this could probably be a separate issue but still...): If I'm on CentOS using the Remi repo which offers redis 2.8.8, using this class with its defaults should install redis 2.8.8 right? Being able to select a specific version is fairly important in heterogeneous environments, especially considering that we can't use this class and declare package { 'redis' : ensure => 2.8.8 }. Wouldn't expect this module to compile the application but IMO it seems reasonable to include a version parameter.

fsalum commented 10 years ago

If you don't specify a version yum always install the latest version from the repository, if all repositories have the same priority. So in your case it would install 2.8.8.

However the class allows you to specify a version and it will work if you have it on the repository, by default it is 'present'.

class { redis:
  package_ensure => '2.8.8',
}
inhumantsar commented 10 years ago

Ahh OK. That's the bit I was missing. Thanks!

fsalum commented 10 years ago

Closing this as work is being done via https://github.com/fsalum/puppet-redis/pull/32