Skip to content

Commit

Permalink
check for activemq binary before remote_file and execute, fixes COOK-239
Browse files Browse the repository at this point in the history
  • Loading branch information
jtimberman committed Jan 11, 2010
1 parent 6452e95 commit 1f616bf
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 27 deletions.
41 changes: 22 additions & 19 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
{
"maintainer": "Opscode, Inc.",
"description": "Installs activemq and sets it up as a runit service",
"recommendations": {
"dependencies": {
"java": [

],
"runit": [

]
},
"maintainer_email": "[email protected]",
"conflicting": {

},
"description": "Installs activemq and sets it up as a runit service",
"recipes": {
"activemq": ""
},
"suggestions": {
"providing": {
"activemq": [

]
},
"platforms": {
"ubuntu": [
Expand All @@ -19,30 +28,24 @@

]
},
"version": "0.1.0",
"version": "0.2.0",
"name": "activemq",
"conflicting": {
"replacing": {

},
"attributes": {
"groupings": {

},
"providing": {
"activemq": [
"long_description": "= DESCRIPTION:\n\nInstalls activemq and sets up a runit service.\n\n= REQUIREMENTS:\n\nTested on Ubuntu 9.04.\n\nOpscode cookbooks:\n\n* java\n* runit\n\n= ATTRIBUTES:\n\n* activemq[:mirror] - download URL up to the apache/activemq/apache-activemq directory.\n* activemq[:version] - version to install.\n\n= USAGE:\n\nInclude the default recipe on systems where you want to run activemq. At this time the cookbook doesn't use any custom configuration for activemq.\n\n= LICENSE AND AUTHOR:\n\nAuthor:: Joshua Timberman (<[email protected]>)\n\nCopyright:: 2009, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"attributes": {

]
},
"license": "Apache 2.0",
"long_description": "= DESCRIPTION:\n\nInstalls activemq and sets up a runit service.\n\n= REQUIREMENTS:\n\nTested on Ubuntu 9.04.\n\nOpscode cookbooks:\n\n* java\n* runit\n\n= ATTRIBUTES:\n\n* activemq[:mirror] - download URL up to the apache\/activemq\/apache-activemq directory.\n* activemq[:version] - version to install.\n\n= USAGE:\n\nInclude the default recipe on systems where you want to run activemq. At this time the cookbook doesn't use any custom configuration for activemq.\n\n= LICENSE AND AUTHOR:\n\nAuthor:: Joshua Timberman (<[email protected]>)\n\nCopyright:: 2009, Opscode, Inc\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http:\/\/www.apache.org\/licenses\/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
"replacing": {
"recommendations": {

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

],
"runit": [
"license": "Apache 2.0",
"maintainer": "Opscode, Inc.",
"suggestions": {

]
}
}
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
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"
version "0.2"

%w{ubuntu debian}.each do |os|
supports os
Expand Down
15 changes: 8 additions & 7 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@
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
unless File.exists?("/opt/apache-activemq-#{version}/bin/activemq")
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") }
execute "tar zxf /tmp/apache-activemq-#{version}-bin.tar.gz" do
cwd "/opt"
end
end

file "/opt/apache-activemq-#{version}/bin/activemq" do
Expand Down

0 comments on commit 1f616bf

Please sign in to comment.