Skip to content

Commit

Permalink
New parameter '$install_dev' to install development headers.
Browse files Browse the repository at this point in the history
- Works for Debian and RedHat
- Added new parameter to READEME.md
  • Loading branch information
Thomas Ploch committed Jan 30, 2013
1 parent 49dbf10 commit 571c2c3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
10 changes: 9 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
22 changes: 12 additions & 10 deletions manifests/params.pp
Original file line number Diff line number Diff line change
@@ -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}")
Expand Down

0 comments on commit 571c2c3

Please sign in to comment.