Skip to content

Commit

Permalink
Fixes ownership issue on Ubuntu (voxpupuli#157)
Browse files Browse the repository at this point in the history
* "On Ubuntu 14.04, redis has an init script 
that does chown redis:redis $RUNDIR $PIDFILE 
(where RUNDIR=/var/run/redis and 
PIDFILE=$RUNDIR/redis-server.pid) at startup. 
This causes puppet to "fix" the ownership of 
/var/run/redis (to redis:root unless config_owner 
and config_group have been set differently), 
which triggers a restart of redis-server, 
which changes the ownership of /var/run/redis, 
etc. forever.
* Closes voxpupuli#150
  • Loading branch information
petems committed Apr 12, 2017
1 parent 6ec63b1 commit 67d75b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
$config_file = '/etc/redis/redis.conf'
$config_file_mode = '0644'
$config_file_orig = '/etc/redis/redis.conf.puppet'
$config_group = 'root'

$config_owner = 'redis'
$daemonize = true
$log_dir_mode = '0755'
Expand All @@ -130,10 +130,12 @@

case $::operatingsystem {
'Ubuntu': {
$config_group = 'redis'
# Latest from PPA is 3.0.7
$minimum_version = '3.0.7'
}
default: {
$config_group = 'root'
# Debian standard package is 2.4.14
# But we have dotdeb repo which is 3.2.5
$minimum_version = '3.2.5'
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
is_expected.to contain_file('/var/run/redis').with({
:ensure => 'directory',
:owner => 'redis',
:group => 'root',
:group => 'redis',
:mode => '0755',
})
end
Expand Down

0 comments on commit 67d75b3

Please sign in to comment.