Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/mmarseglia/puppet-memcached…
Browse files Browse the repository at this point in the history
… into mmarseglia-master

Conflicts:
	manifests/init.pp
	templates/memcached_sysconfig.erb
  • Loading branch information
saz committed May 25, 2015
2 parents 5f3efdc + af4672c commit 43485a8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
14 changes: 14 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@
#
# Manage memcached
#
# == Parameters
# [* syslog *]
# Boolean.
# If true will pipe output to /bin/logger, sends to syslog.
#
class memcached (
$package_ensure = 'present',
$service_manage = true,
$logfile = $::memcached::params::logfile,
$syslog = false,
$pidfile = '/var/run/memcached.pid',
$manage_firewall = false,
$max_memory = false,
Expand Down Expand Up @@ -38,6 +44,14 @@
validate_bool($service_restart)
validate_bool($service_manage)

validate_bool($syslog)

# Logging to syslog and file are mutually exclusive
# Fail if both options are defined
if $syslog and str2bool("$logfile") {
fail 'Define either syslog or logfile as logging destinations but not both.'
}

if $package_ensure == 'absent' {
$service_ensure = 'stopped'
$service_enable = false
Expand Down
10 changes: 10 additions & 0 deletions templates/memcached_sysconfig.erb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,18 @@ end
if @item_size
result << '-I ' + @item_size.to_s
end
<<<<<<< HEAD
result << '-t ' + @processorcount.to_s
if @logfile
=======
result << '-t ' + @processorcount

# log to syslog via logger
if @syslog && @logfile.empty?
result << '2>&1 |/bin/logger &'
# log to log file
elsif [email protected]? && !@syslog
>>>>>>> af4672c9681860415f5bad212fdbdd90217d5844
result << '>> ' + @logfile + ' 2>&1'
end
-%>
Expand Down

0 comments on commit 43485a8

Please sign in to comment.