diff --git a/README.md b/README.md index 01bded1b5..37bb6894e 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,4 @@ Manage memcached via Puppet * $user = '' (OS specific setting, see params.pp) * $max_connections = 8192 * $lock_memory = false (WARNING: good if used intelligently, google for -k key) +* $install_dev = false (TRUE if 'libmemcached-dev' package should be installed) diff --git a/manifests/init.pp b/manifests/init.pp index 8d1ca1540..c4b6a863e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -9,13 +9,21 @@ $user = $::memcached::params::user, $max_connections = '8192', $verbosity = undef, - $unix_socket = undef + $unix_socket = undef, + $install_dev = false ) inherits memcached::params { package { $memcached::params::package_name: ensure => $package_ensure, } + if $install_dev { + package { $memcached::params::dev_package_name: + ensure => $package_ensure, + require => Package[$memcached::params::package_name] + } + } + file { $memcached::params::config_file: owner => 'root', group => 'root', diff --git a/manifests/params.pp b/manifests/params.pp index 9c1ca4710..5022293c5 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -1,18 +1,20 @@ class memcached::params { case $::osfamily { 'Debian': { - $package_name = 'memcached' - $service_name = 'memcached' - $config_file = '/etc/memcached.conf' - $config_tmpl = "$module_name/memcached.conf.erb" - $user = 'nobody' + $package_name = 'memcached' + $service_name = 'memcached' + $dev_package_name = 'libmemcached-dev' + $config_file = '/etc/memcached.conf' + $config_tmpl = "$module_name/memcached.conf.erb" + $user = 'nobody' } 'RedHat': { - $package_name = 'memcached' - $service_name = 'memcached' - $config_file = '/etc/sysconfig/memcached' - $config_tmpl = "$module_name/memcached_sysconfig.erb" - $user = 'memcached' + $package_name = 'memcached' + $service_name = 'memcached' + $dev_package_name = 'libmemcached-devel' + $config_file = '/etc/sysconfig/memcached' + $config_tmpl = "$module_name/memcached_sysconfig.erb" + $user = 'memcached' } default: { fail("Unsupported platform: ${::osfamily}")