Skip to content

Instantly share code, notes, and snippets.

@kp666
Created March 4, 2016 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kp666/47408ad1b55086b79d82 to your computer and use it in GitHub Desktop.
Save kp666/47408ad1b55086b79d82 to your computer and use it in GitHub Desktop.
Cookbook Name:: memcached
require 'pp'
#
# Cookbook Name:: memcached
# Recipe:: default
#
node[:applications].each do |app_name,data|
user = node[:users].first
case node[:instance_role]
when "solo", "app", "app_master"
template "/data/#{app_name}/shared/config/memcached_custom.yml" do
source "memcached.yml.erb"
owner user[:username]
group user[:username]
mode 0744
variables({
:app_name => app_name,
:server_names => node[:members]
})
end
template "/etc/conf.d/memcached" do
owner 'root'
group 'root'
mode 0644
source "memcached.erb"
variables :memusage => 64,
:port => 11211
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment