forked from redhat-openstack/openstack-puppet-modules
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
5869cad Merge pull request redhat-openstack#51 from jburnham/feature/pidfile-support 57fdf41 Merge pull request redhat-openstack#50 from joshuaspence/master 7066392 Add support for custom and disabling of pidfiles. 5973ec8 Add support for large memory pages b1c0011 new release v2.6.0 7b8ce2a Merge branch 'gloppasglop-feature_sasl' b1bcddd Merge branch 'feature_sasl' of https://github.com/gloppasglop/puppet-memcached into gloppasglop-feature_sasl 8c340fd Merge pull request redhat-openstack#49 from misterdorm/puppet37x 66fd812 Merge pull request redhat-openstack#46 from sxd/master e0c717f Replaced references to type() function with is_string() for Puppet 3.7.x, which now reserves the "type" keyword for future use. e368e33 Add relative option to puppet-lint - This is to avoid issue cause by the fact that - foloder name is differemnt from module name - see rodjek/puppet-lint#252 6d2c7a0 Add SASL support 33c698b Added option "auto_removal" this option aim to enable or disable the -M option. 4a2d576 Merge pull request redhat-openstack#44 from hogepodge/relax_pe_requirement d6fe71b Merge pull request redhat-openstack#43 from ccin2p3/fix-ensure-absent 345bfc6 Releax the Puppet Enterprise requirement c76b78f Fix bug when `package_ensure` was set to `absent`. 4b29e75 Merge pull request redhat-openstack#41 from Mayflower/sles 64bb421 sles support 468742f fix metadata.json d1ca737 replace Modulefile with metadata.json 5a6c247 new release v2.5.0 55aef26 add parameter to disable service restart 3041b16 Merge pull request redhat-openstack#39 from fizmat/redhat_logging 5437c3a Merge pull request redhat-openstack#40 from misterdorm/template_to_s 2200af3 explicitly calling to_s on parameters that could potentially be a numeric type, to avoid ruby errors 6a55417 $logfile support for redhat 2f5cf83 Merge pull request redhat-openstack#38 from hdanes/master 64450b5 Enforce Linux line endings for *.erb templates. 6583748 update module version to 2.4.0 2b4c7bb Merge branch 'amazon' 6320354 Update module version to 2.3.0 3b4410c add support for Amazon Linux d266757 Merge pull request redhat-openstack#34 from ghoneycutt/add_firewall 9dc9231 Travis will check for syntax validation and style before specs bb9b752 Addressing simple style fixes 30b31d6 Resolving conflicts with upstream 35f17c2 Add support for Puppet v3.4 9f959da Add rake tasks for validation and linting e3bef50 Add ability to manage firewall e27b5b6 Manage firewall entries d009260 update README 8f42708 run puppet 2.6 only with 1.8.7 d089879 update gemfile ad67617 move travis build image in README bf2b751 add multiple rvm versions ce6f55b add more rvm versions 29b4065 more output on rake spec run fee24ce update module version 35413d2 improve spec tests 95b6a32 add processorcount variable a60da9a update module version 788c513 Merge pull request redhat-openstack#26 from red-trela/fix-remaining-deprecation-warnings 40df54d Fix remaining deprecation warnings 2c6f659 update module version 260cd78 ensure service is stopped, if package_ensure is set to absent 5be929b new module version e6917c8 fix travis file eae28e6 add ghpublisher to travis file 36a7d4b use braces around variables 5a399cc service has status command on some platforms 7adcc74 update module version 4af9523 ignore ghpublisher directory 9a7af54 remove puppet version 3.2.0 cec690b switch gem source fc51f0e add newer puppet versions to travis file 31db36e Merge branch 'master' of github.com:saz/puppet-memcached 3e05fa7 use double quotes instead of single quotes 7562abf Merge pull request redhat-openstack#23 from blkperl/fix_dep_warnings d552328 Fix Puppet 3.2.x deprecation warnings 7585134 Merge pull request redhat-openstack#20 from zylon-internet/master 0b300f8 Implement Override the default size of each slab page 51af7b0 Version 2.1.0 ea8b4d0 Merge pull request redhat-openstack#19 from tPl0ch/feature/dev-libs 571c2c3 New parameter '$install_dev' to install development headers. Signed-off-by: Gael Chamoulaud <[email protected]>
- Loading branch information
Showing
17 changed files
with
407 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
fixtures: | ||
repositories: | ||
'firewall': | ||
repo: 'git://github.com/puppetlabs/puppetlabs-firewall.git' | ||
ref: '0.1.0' | ||
'stdlib': | ||
repo: 'git://github.com/puppetlabs/puppetlabs-stdlib.git' | ||
ref: '3.2.0' | ||
symlinks: | ||
"memcached": "#{source_dir}" | ||
memcached: "#{source_dir}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Enforce Linux line-endings for template files on every operating system. | ||
*.erb text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
pkg/ | ||
*.swp | ||
/metadata.json | ||
.forge-releng/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,38 @@ | ||
language: ruby | ||
rvm: | ||
- 1.8.7 | ||
before_script: | ||
after_script: | ||
script: "rake spec" | ||
--- | ||
branches: | ||
only: | ||
- master | ||
language: ruby | ||
bundler_args: --without development | ||
script: 'bundle exec rake validate && bundle exec rake lint && SPEC_OPTS="--format documentation" bundle exec rake spec' | ||
after_success: | ||
- git clone -q git://github.com/puppetlabs/ghpublisher.git .forge-releng | ||
- .forge-releng/publish | ||
rvm: | ||
- 1.8.7 | ||
- 1.9.3 | ||
env: | ||
- PUPPET_VERSION=2.7.13 | ||
- PUPPET_VERSION=2.7.6 | ||
- PUPPET_VERSION=2.6.9 | ||
- PUPPET_VERSION=3.0.0 | ||
matrix: | ||
- PUPPET_GEM_VERSION="~> 2.7.0" | ||
- PUPPET_GEM_VERSION="~> 3.0.0" | ||
- PUPPET_GEM_VERSION="~> 3.1.0" | ||
- PUPPET_GEM_VERSION="~> 3.2.0" | ||
- PUPPET_GEM_VERSION="~> 3.3.0" | ||
- PUPPET_GEM_VERSION="~> 3.4.0" | ||
global: | ||
- PUBLISHER_LOGIN=saz | ||
- secure: |- | ||
KHycFEf0ALVjITczYG0pcfk912muQkbJiGzKa5yyC8C9ppDW+dTYgDQu8AO1KXFHzds | ||
NUASY2XNjrJNv27w7A2eMp88qU1ID1s8CWALph4fuxGcM/HoPw9q8sldJ9/sHGlY9Ye | ||
DEeIvgt9qkwKtG/kb7dN7la42nv5fffWE95OU= | ||
matrix: | ||
include: | ||
- rvm: 2.0.0 | ||
env: PUPPET_GEM_VERSION="~> 3.2.0" | ||
- rvm: 2.0.0 | ||
env: PUPPET_GEM_VERSION="~> 3.3.0" | ||
- rvm: 1.8.7 | ||
env: PUPPET_GEM_VERSION="~> 2.6.0" | ||
notifications: | ||
email: false | ||
gemfile: .gemfile | ||
gemfile: Gemfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
source :rubygems | ||
source "https://rubygems.org" | ||
|
||
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] | ||
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 3.3'] | ||
gem 'puppet', puppetversion | ||
gem 'puppetlabs_spec_helper', '>= 0.1.0' | ||
gem 'puppet-lint', '>= 0.3.2' | ||
gem 'facter', '>= 1.7.0', "< 1.8.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Copyright 2011 Steffen Zieger | ||
Copyright 2014 Garrett Honeycutt <[email protected]> | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,19 @@ | ||
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." | ||
task :validate do | ||
Dir['manifests/**/*.pp'].each do |manifest| | ||
sh "puppet parser validate --noop #{manifest}" | ||
end | ||
Dir['spec/**/*.rb','lib/**/*.rb'].each do |ruby_file| | ||
sh "ruby -c #{ruby_file}" unless ruby_file =~ /spec\/fixtures/ | ||
end | ||
Dir['templates/**/*.erb'].each do |template| | ||
sh "erb -P -x -T '-' #{template} | ruby -c" | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,91 @@ | ||
class memcached( | ||
# == Class: memcached | ||
# | ||
# Manage memcached | ||
# | ||
class memcached ( | ||
$package_ensure = 'present', | ||
$logfile = '/var/log/memcached.log', | ||
$pidfile = '/var/run/memcached.pid', | ||
$manage_firewall = false, | ||
$max_memory = false, | ||
$item_size = false, | ||
$lock_memory = false, | ||
$listen_ip = '0.0.0.0', | ||
$tcp_port = 11211, | ||
$udp_port = 11211, | ||
$user = $::memcached::params::user, | ||
$max_connections = '8192', | ||
$verbosity = undef, | ||
$unix_socket = undef | ||
$unix_socket = undef, | ||
$install_dev = false, | ||
$processorcount = $::processorcount, | ||
$service_restart = true, | ||
$auto_removal = false, | ||
$use_sasl = false, | ||
$large_mem_pages = false, | ||
) inherits memcached::params { | ||
|
||
# validate type and convert string to boolean if necessary | ||
if is_string($manage_firewall) { | ||
$manage_firewall_bool = str2bool($manage_firewall) | ||
} else { | ||
$manage_firewall_bool = $manage_firewall | ||
} | ||
validate_bool($manage_firewall_bool) | ||
validate_bool($service_restart) | ||
|
||
if $package_ensure == 'absent' { | ||
$service_ensure = 'stopped' | ||
$service_enable = false | ||
} else { | ||
$service_ensure = 'running' | ||
$service_enable = true | ||
} | ||
|
||
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] | ||
} | ||
} | ||
|
||
if $manage_firewall_bool == true { | ||
firewall { "100_tcp_${tcp_port}_for_memcached": | ||
port => $tcp_port, | ||
proto => 'tcp', | ||
action => 'accept', | ||
} | ||
|
||
firewall { "100_udp_${udp_port}_for_memcached": | ||
port => $udp_port, | ||
proto => 'udp', | ||
action => 'accept', | ||
} | ||
} | ||
|
||
if $service_restart { | ||
$service_notify_real = Service[$memcached::params::service_name] | ||
} else { | ||
$service_notify_real = undef | ||
} | ||
|
||
file { $memcached::params::config_file: | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0644', | ||
content => template($memcached::params::config_tmpl), | ||
require => Package[$memcached::params::package_name], | ||
notify => $service_notify_real, | ||
} | ||
|
||
service { $memcached::params::service_name: | ||
ensure => running, | ||
enable => true, | ||
ensure => $service_ensure, | ||
enable => $service_enable, | ||
hasrestart => true, | ||
hasstatus => false, | ||
subscribe => File[$memcached::params::config_file], | ||
hasstatus => $memcached::params::service_hasstatus, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,40 @@ | ||
# == Class: memcached::params | ||
# | ||
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' | ||
$service_hasstatus = false | ||
$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' | ||
/RedHat|Suse/: { | ||
$package_name = 'memcached' | ||
$service_name = 'memcached' | ||
$service_hasstatus = true | ||
$dev_package_name = 'libmemcached-devel' | ||
$config_file = '/etc/sysconfig/memcached' | ||
$config_tmpl = "${module_name}/memcached_sysconfig.erb" | ||
$user = 'memcached' | ||
} | ||
default: { | ||
fail("Unsupported platform: ${::osfamily}") | ||
case $::operatingsystem { | ||
'Amazon': { | ||
$package_name = 'memcached' | ||
$service_name = 'memcached' | ||
$service_hasstatus = true | ||
$dev_package_name = 'libmemcached-devel' | ||
$config_file = '/etc/sysconfig/memcached' | ||
$config_tmpl = "${module_name}/memcached_sysconfig.erb" | ||
$user = 'memcached' | ||
} | ||
default: { | ||
fail("Unsupported platform: ${::osfamily}/${::operatingsystem}") | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"operatingsystem_support": [ | ||
{ | ||
"operatingsystem": "RedHat" | ||
}, | ||
{ | ||
"operatingsystem": "CentOS" | ||
}, | ||
{ | ||
"operatingsystem": "OracleLinux" | ||
}, | ||
{ | ||
"operatingsystem": "Scientific" | ||
}, | ||
{ | ||
"operatingsystem": "Debian" | ||
}, | ||
{ | ||
"operatingsystem": "Ubuntu" | ||
} | ||
], | ||
"requirements": [ | ||
{ | ||
"name": "pe", | ||
"version_requirement": ">= 3.2.0 < 3.4.0" | ||
}, | ||
{ | ||
"name": "puppet", | ||
"version_requirement": "3.x" | ||
} | ||
], | ||
"name": "saz-memcached", | ||
"version": "2.6.0", | ||
"author": "saz", | ||
"summary": "UNKNOWN", | ||
"license": "Apache License, Version 2.0", | ||
"source": "git://github.com/saz/puppet-memcached.git", | ||
"project_page": "https://github.com/saz/puppet-memcached", | ||
"issues_url": "https://github.com/saz/puppet-memcached/issues", | ||
"description": "Manage memcached via Puppet", | ||
"dependencies": [ | ||
{"name":"puppetlabs/stdlib","version_requirement":">= 3.2.0"}, | ||
{"name":"puppetlabs/firewall","version_requirement":">= 0.1.0"} | ||
] | ||
} |
Oops, something went wrong.