Permalink
Browse files

Fix: Various issues in ark recipe

- Directory resource needed
- Service name precalculated
- Update resource notification syntax
- Ordering of service
  • Loading branch information...
1 parent 9a1270a commit 993ac654b54df20bec541a4a6fa7eb4ede63ca51 Stephen Nelson-Smith committed Jan 6, 2013
Showing with 16 additions and 12 deletions.
  1. +16 −12 recipes/ark.rb
View
@@ -21,6 +21,7 @@
include_recipe "ark"
version = node['tomcat']['version'].to_s
+tomcat_version = "tomcat#{node['tomcat']['version'].to_s}"
distro = "debian"
# the sysv init script requires an additional package
@@ -30,7 +31,11 @@
user node['tomcat']['user']
-ark "tomcat#{version}" do
+directory "/usr/local/tomcat" do
+ owner node['tomcat']['user']
+end
+
+ark tomcat_version do
url node['tomcat'][version]['url']
checksum node['tomcat'][version]['checksum']
version node['tomcat']['version']
@@ -39,27 +44,26 @@
owner node['tomcat']['user']
end
-template "tomcat#{version}" do
- path "/etc/init.d/tomcat#{version}"
+init_script = template tomcat_version do
+ path "/etc/init.d/#{tomcat_version}"
source "tomcat.init.#{distro}.erb"
owner "root"
group "root"
mode "0774"
- variables( :name => "tomcat#{version}")
- notifies :restart, resources(:service => "tomcat")
+ variables( :name => tomcat_version)
+end
+
+service tomcat_version do
+ supports :restart => true, :reload => true, :status => true
+ action [:enable, :start]
end
-template "/etc/default/tomcat#{version}" do
+template "/etc/default/#{tomcat_version}" do
source "default_tomcat.erb"
owner "root"
group "root"
variables(:tomcat => node['tomcat'].to_hash)
mode "0644"
- notifies :restart, resources(:service => "tomcat")
+ notifies :restart, "service[#{tomcat_version}]", :immediately
end
-service "tomcat" do
- service_name "tomcat#{version}"
- supports :restart => true, :reload => true, :status => true
- action [:enable, :start]
-end

0 comments on commit 993ac65

Please sign in to comment.