<commit_before># Cookbook Name:: tomcat
# Recipe:: default
#
# Copyright 2012
#
# All rights reserved - Do Not Redistribute

cookbook_file "/tmp/apache-tomcat-7.0.33.tar.gz" do
  source "apache-tomcat-7.0.33.tar.gz"
  owner "openlmis"
  group "openlmis"
  mode "0775"
  notifies :run, "execute[Installing Tomcat tarball]", :immediately
end

execute "Installing Tomcat tarball" do
  command "tar -xvf /tmp/apache-tomcat-7.0.33.tar.gz --directory=#{node["webapp"]["home"]}; chown -R openlmis:openlmis #{node["webapp"]["home"]}/apache-tomcat-7.0.33"
  action :nothing
end

cookbook_file "/etc/init.d/tomcat" do
  source "tomcat"
  owner "root"
  group "root"
  mode "0755"
  notifies :run, "execute[Add tomcat to chkconfig]", :immediately
end

execute "Add tomcat to chkconfig" do
  command "chkconfig --add tomcat; chkconfig tomcat on"
  action :nothing
  notifies :start, "service[tomcat]", :immediately
end

service "tomcat" do
  supports :start => true, :stop => true, :restart => true
  action :start
end<commit_msg>Adding remote file instead of keeping tar bin in files<commit_after># Cookbook Name:: tomcat
# Recipe:: default
#
# Copyright 2012
#
# All rights reserved - Do Not Redistribute

remote_file "/tmp/apache-tomcat-7.0.33.tar.gz" do
  source "http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.33/bin/apache-tomcat-7.0.33.tar.gz"
  owner "openlmis"
  group "openlmis"
  mode "0775"
  notifies :run, "execute[Installing Tomcat tarball]", :immediately
end

execute "Installing Tomcat tarball" do
  command "tar -xvf /tmp/apache-tomcat-7.0.33.tar.gz --directory=#{node["webapp"]["home"]}; chown -R openlmis:openlmis #{node["webapp"]["home"]}/apache-tomcat-7.0.33"
  action :nothing
end

cookbook_file "/etc/init.d/tomcat" do
  source "tomcat"
  owner "root"
  group "root"
  mode "0755"
  notifies :run, "execute[Add tomcat to chkconfig]", :immediately
end

execute "Add tomcat to chkconfig" do
  command "chkconfig --add tomcat; chkconfig tomcat on"
  action :nothing
  notifies :start, "service[tomcat]", :immediately
end

service "tomcat" do
  supports :start => true, :stop => true, :restart => true
  action :start
end
{'fraction_non_alphanumeric': 0.14245548266166824, 'fraction_numerical': 0.02858481724461106, 'mean_word_length': 4.405063291139241, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3386431', 'n_tokens_mistral': 808, 'n_tokens_neox': 783, 'n_words': 210}