Skip to content

Commit

Permalink
Updating chef recipe
Browse files Browse the repository at this point in the history
Pulled in some updates from the project that spawned the cookbook.
  • Loading branch information
jc00ke committed Mar 22, 2012
1 parent c744b48 commit d9793e0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
4 changes: 4 additions & 0 deletions examples/chef/cookbooks/sidekiq/README.rdoc
Expand Up @@ -5,3 +5,7 @@ Sidekiq is a Redis-backed Ruby library for creating background jobs, placing tho
= USAGE:

add require_recipe "sidekiq" to main/recipes/default.rb

= NOTES:

I setup a basic size for the Sidekiq workers based on the instance_type, if you need more or less workers please modify the recipe itself.
3 changes: 2 additions & 1 deletion examples/chef/cookbooks/sidekiq/recipes/default.rb
Expand Up @@ -2,7 +2,8 @@
# Cookbook Name:: sidekiq
# Recipe:: default
#
if ['solo', 'util'].include?(node[:instance_role])
role = node[:instance_role]
if role == 'solo' || (role == 'util' && node[:name] =~ /sidekiq/)

# for now
worker_count = 1
Expand Down
4 changes: 2 additions & 2 deletions examples/chef/cookbooks/sidekiq/templates/default/sidekiq.erb
Expand Up @@ -140,13 +140,13 @@ APP_SHARED="${APP_DIR}/shared"
APP_CONFIG="${APP_SHARED}/config"

if [ -e "${APP_CONFIG}/${CONF_FILE}" ]; then
logger -t "sidekiq_${APP}" -s "Good, found a config file. Proceeding..."
logger -t "sidekiq_${APP}" -s "Good, found a conf file. Proceeding..."
else
logger -t "sidekiq_${APP}" -s "/data/${APP}/shared/config/${CONF_FILE} not found for app: ${APP}"
exit 1
fi

WORKER_REF=`echo $CONF_FILE | sed s/.yml.conf//`
WORKER_REF=`echo $CONF_FILE | sed s/.conf//`
LOG_FILE="$APP_ROOT/log/$WORKER_REF.log"
LOCK_FILE="/tmp/$WORKER_REF.monit-lock"
PID_FILE="/var/run/engineyard/sidekiq/$APP/$WORKER_REF.pid"
Expand Down
Expand Up @@ -2,12 +2,6 @@
<% if @verbose %>
:verbose: <%= @verbose %>
<% end %>
<% if @namespace %>
:namespace: <%= @namespace %>
<% end %>
<% if @server %>
:server: <%= @server %>
<% end %>
<% if @environment %>
:environment: <%= @environment %>
<% end %>
Expand Down

0 comments on commit d9793e0

Please sign in to comment.