From 6d2c7a03ffcd1c40aff3687b9a4dccd4b5ae0deb Mon Sep 17 00:00:00 2001 From: Christophe Roux Date: Thu, 21 Aug 2014 21:32:05 +0200 Subject: [PATCH 1/2] Add SASL support --- README.md | 1 + manifests/init.pp | 3 ++- spec/classes/memcached_spec.rb | 9 +++++++-- templates/memcached.conf.erb | 5 +++++ 4 files changed, 15 insertions(+), 3 deletions(-) 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/manifests/init.pp b/manifests/init.pp index 9c29710ab..b98ede765 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -18,7 +18,8 @@ $unix_socket = undef, $install_dev = false, $processorcount = $::processorcount, - $service_restart = true + $service_restart = true, + $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 9b48ce9e4..ff6d64e86 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 %> From e368e334219d728e2fec0a5f8575734605bf2e03 Mon Sep 17 00:00:00 2001 From: Christophe Roux Date: Thu, 21 Aug 2014 22:46:02 +0200 Subject: [PATCH 2/2] Add relative option to puppet-lint - This is to avoid issue cause by the fact that - foloder name is differemnt from module name - see https://github.com/rodjek/puppet-lint/pull/252 --- Rakefile | 1 + 1 file changed, 1 insertion(+) 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."