Created
March 4, 2016 01:23
-
-
Save kp666/47408ad1b55086b79d82 to your computer and use it in GitHub Desktop.
Cookbook Name:: memcached
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
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