Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
systemd scripts use wrong variables #73
Browse files Browse the repository at this point in the history
  • Loading branch information
dwerder committed Apr 8, 2016
1 parent e487127 commit 318d2cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion manifests/sentinel.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
/(Debian|Ubuntu)/ => 'redis/etc/init.d/debian_redis-sentinel.erb',
/(Fedora|RedHat|CentOS|OEL|OracleLinux|Amazon|Scientific)/ => 'redis/etc/init.d/redhat_redis-sentinel.erb',
/(Gentoo)/ => 'redis/etc/init.d/gentoo_redis-sentinel.erb',
default => UNDEF,
default => undef,
}

# redis conf file
Expand Down
7 changes: 4 additions & 3 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
# Since redis automatically rewrite their config since version 2.8 what conflicts with puppet
# the config files created by puppet will be copied to this directory and redis will be started from
# this copy.
#
#
# [*manage_logrotate*]
# Configure logrotate rules for redis server. Default: true
define redis::server (
Expand Down Expand Up @@ -136,12 +136,13 @@
/(Fedora|RedHat|CentOS|OEL|OracleLinux|Amazon|Scientific)/ => 'redis/etc/init.d/redhat_redis-server.erb',
/(SLES)/ => 'redis/etc/init.d/sles_redis-server.erb',
/(Gentoo)/ => 'redis/etc/init.d/gentoo_redis-server.erb',
default => UNDEF,
default => undef,
}
$redis_2_6_or_greater = versioncmp($::redis::install::redis_version,'2.6') >= 0

# redis conf file
$conf_file = "/etc/redis_${redis_name}.conf"
$conf_file_name = "redis_${redis_name}.conf"
$conf_file = "/etc/${conf_file_name}"
file { $conf_file:
ensure => file,
content => template('redis/etc/redis.conf.erb'),
Expand Down
9 changes: 5 additions & 4 deletions templates/systemd/redis.service.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
[Unit]
Description=Redis persistent key-value database server
Description=Redis redis_<%= @redis_name %> database server
After=network.target

[Service]
ExecStartPre=/bin/mkdir -p <%= @redis_run_dir %>
ExecStartPre=/bin/cp -u <%= @conf_file %> <%= @redis_run_dir %>/<%= @conf_file_name %>
ExecStart=/usr/bin/redis-server <%= @redis_run_dir %>/<%= @conf_file_name %> --daemonize no
ExecStop=/usr/bin/redis-shutdown redis_<%= @redis_name %>
User=redis
Group=redis
ExecStop=/usr/bin/redis-cli -p <%= @redis_port %> shutdown
User=<%= @redis_user or 'root' %>
Group=<%= @redis_group or 'root' %>

[Install]
WantedBy=multi-user.target

0 comments on commit 318d2cb

Please sign in to comment.