Skip to content

Instantly share code, notes, and snippets.

@cwjohnston
Created April 28, 2010 16:31
Show Gist options
  • Save cwjohnston/382347 to your computer and use it in GitHub Desktop.
Save cwjohnston/382347 to your computer and use it in GitHub Desktop.
#
# Cookbook Name:: drtr
# Recipe:: default
#
# Copyright 2009, Blue Coat Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
package "drtr" do
case node[:platform]
when "debian","ubuntu"
package_name "drtr"
version "4.3.3-4-es3"
options "--force-yes"
end
action :install
end
service "drtr" do
case node[:platform]
when "debian","ubuntu"
service_name "drtrd"
end
supports value_for_platform(
"debian" => { "4.0" => [ :restart, :reload ], "default" => [ :restart, :reload ] },
"ubuntu" => { "default" => [ :restart, :reload ] },
"default" => { "default" => [:restart, :reload ] }
)
action :enable
end
template "/etc/drtr.conf" do
source "drtr.conf.erb"
action :create
mode 0644
notifies :restart, resources(:service => "drtr")
end
execute "create_log_symlink" do
command "ln -s /var/log/drtr /var/local/drtr/logs"
creates "/var/local/drtr/logs"
action :run
end
if @node.recipe?("monit")
template "/etc/monit.d/drtr" do
source "monitrc.erb"
action :create
notifies :restart, resources(:service => "monit")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment