Skip to content

Commit

Permalink
cook-199 add activemq cookbook
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Oct 22, 2009
0 parents commit 525b4f7
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
= DESCRIPTION:

Installs activemq and sets up a runit service.

= REQUIREMENTS:

Tested on Ubuntu 9.04.

Opscode cookbooks:

* java
* runit

= ATTRIBUTES:

* activemq[:mirror] - download URL up to the apache/activemq/apache-activemq directory.
* activemq[:version] - version to install.

= USAGE:

Include the default recipe on systems where you want to run activemq. At this time the cookbook doesn't use any custom configuration for activemq.

= LICENSE AND AUTHOR:

Author:: Joshua Timberman (<[email protected]>)

Copyright:: 2009, Opscode, 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.
21 changes: 21 additions & 0 deletions attributes/activemq.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Cookbook Name:: activemq
# Attributes:: activemq
#
# Copyright 2009, Opscode, 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.
#

set_unless[:activemq][:mirror] = "http://mirrors.ibiblio.org/pub/mirrors"
set_unless[:activemq][:version] = "5.3.0"
40 changes: 40 additions & 0 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"recipes": {
"activemq": ""
},
"conflicting": {

},
"description": "Installs\/Configures activemq",
"providing": {
"activemq": [

]
},
"long_description": "= DESCRIPTION:\n\n= REQUIREMENTS:\n\n= ATTRIBUTES: \n\n= USAGE:\n\n",
"platforms": {

},
"version": "0.1.0",
"replacing": {

},
"name": "activemq",
"attributes": {

},
"maintainer": "Opscode, Inc.",
"recommendations": {

},
"license": "Apache 2.0",
"maintainer_email": "[email protected]",
"suggestions": {

},
"dependencies": {
"java": [

]
}
}
10 changes: 10 additions & 0 deletions metadata.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
maintainer "Opscode, Inc."
maintainer_email "[email protected]"
license "Apache 2.0"
description "Installs activemq and sets it up as a runit service"
long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
version "0.1"

%x{java runit}.each do |cb|
depends cb
end
41 changes: 41 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#
# Cookbook Name:: activemq
# Recipe:: default
#
# Copyright 2009, Opscode, 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.
#

include_recipe "java"

version = node[:activemq][:version]
mirror = node[:activemq][:mirror]

remote_file "/tmp/apache-activemq-#{version}-bin.tar.gz" do
source "#{mirror}/apache/activemq/apache-activemq/#{version}/apache-activemq-#{version}-bin.tar.gz"
mode "0644"
end

execute "tar zxf /tmp/apache-activemq-#{version}-bin.tar.gz" do
cwd "/opt"
not_if { File.exists?("/opt/apache-activemq-#{version}/bin/activemq") }
end

file "/opt/apache-activemq-#{version}/bin/activemq" do
owner "root"
group "root"
mode "0755"
end

runit_service "activemq"
2 changes: 2 additions & 0 deletions templates/default/sv-activemq-log-run.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
exec svlogd -tt ./main
3 changes: 3 additions & 0 deletions templates/default/sv-activemq-run.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
exec 2>&1
exec /opt/apache-activemq-<%= @node[:activemq][:version] %>/bin/activemq

0 comments on commit 525b4f7

Please sign in to comment.