@ladislavGazo
gazo@seges.sk
/opt/tomcat/bin/shutdown.sh
ps aux | grep catal
kill -9 <da_PID>
cd ../logs
mv * /mnt/backup/logs
cd ../bin
./startup.sh
TomcatResources.py
cd ~/chef
git submodule add https://github.com/seges/chef-cookbook-tcc.git site-cookbooks/tcc
git submodule add https://github.com/escapestudios-cookbooks/newrelic.git site-cookbooks/newrelic
knife cookbook create mycookie
default.tcc.user = "lgazo"
default.tcc.home = "/home/lgazo"
default.tcc.location = "/home/lgazo/opt/tcc"
default['tcc']['templates'] = {
"synapso" => {
"type" => "tomcat7",
"libs" => [
{
"repo" => "maven",
"artifact_id" => "org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1.1"
},
{
"repo" => "maven",
"artifact_id" => "com.sun.messaging.mq:imq:4.4"
},
{
"repo" => "maven",
"artifact_id" => "javax.mail:mail:1.4.4"
},
{
"repo" => "maven",
"artifact_id" => "org.postgresql:postgresql:9.3-1100-jdbc41"
}
]
}
}
default['tcc']['instances'] = {
"syndev" => {
"template" => "synapso",
"user" => "lgazo"
}
}
default['tcc']['template_cookbooks'] = "mycookie"
include_recipe "database::postgresql"
postgresql_connection_info = {
:host => 'localhost',
:port => node['postgresql']['config']['port'],
:username => 'postgres',
:password => node['postgresql']['password']['postgres']
}
postgresql_database_user "synapso" do
connection postgresql_connection_info
password node.postgresql.password.synapso
action :create
end
postgresql_database "synapso" do
connection postgresql_connection_info
owner "synapso"
action :create
end
postgresql_database "synapso user can create DB" do
connection postgresql_connection_info
sql "alter role #{node.synapso.user} with createdb"
action :query
end
include_recipe "tcc::default"
include_recipe "tcc::templates"
include_recipe "tcc::instances"
include_recipe "tcc::newrelic"
include recipe tcc::newrelic