diff --git a/README.md b/README.md index 3e70b51be..b552f7677 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,4 @@ If you find this module useful, send some bitcoins to 1Na3YFUmdxKxJLiuRXQYJU2kiN * $install_dev = false (TRUE if 'libmemcached-dev' package should be installed) * $processorcount = $::processorcount * $service_restart = true (restart service after configuration changes, false to prevent restarts) +* $use_sasl = false (start memcached with SASL support) diff --git a/Rakefile b/Rakefile index 0a28d845e..06f1ab4fb 100644 --- a/Rakefile +++ b/Rakefile @@ -2,6 +2,7 @@ require 'rubygems' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-lint/tasks/puppet-lint' PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.relative = true PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp"] desc "Run puppet in noop mode and check for syntax errors." diff --git a/manifests/init.pp b/manifests/init.pp index 0b6077ae7..19f825f31 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -19,7 +19,8 @@ $install_dev = false, $processorcount = $::processorcount, $service_restart = true, - $auto_removal = false + $auto_removal = false, + $use_sasl = false ) inherits memcached::params { # validate type and convert string to boolean if necessary diff --git a/spec/classes/memcached_spec.rb b/spec/classes/memcached_spec.rb index 0bf5968b7..b40599f5d 100644 --- a/spec/classes/memcached_spec.rb +++ b/spec/classes/memcached_spec.rb @@ -59,7 +59,8 @@ :user => 'nobody', :max_connections => '8192', :install_dev => false, - :processorcount => 1 + :processorcount => 1, + :use_sasl => false } end @@ -76,7 +77,8 @@ :user => 'somebdy', :max_connections => '8193', :verbosity => 'vvv', - :processorcount => 3 + :processorcount => 3, + :use_sasl => true }, { :package_ensure => 'present', @@ -184,6 +186,9 @@ if(param_hash[:verbosity]) expected_lines.push("-vvv") end + if(param_hash[:use_sasl]) + expected_lines.push("-S") + end (content.split("\n") & expected_lines).should =~ expected_lines end end diff --git a/templates/memcached.conf.erb b/templates/memcached.conf.erb index b0d65c5d7..ede73d064 100644 --- a/templates/memcached.conf.erb +++ b/templates/memcached.conf.erb @@ -23,6 +23,11 @@ logfile <%= @logfile -%> -k <% end -%> +<% if @use_sasl -%> +# Start with SASL support +-S +<% end -%> + <% if @unix_socket -%> # UNIX socket path to listen on -s <%= @unix_socket %>