<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/capitate/cap_ext/docs.rb</filename>
    </added>
    <added>
      <filename>lib/recipes/logrotate/mysql.rb</filename>
    </added>
    <added>
      <filename>lib/recipes/monit/database.rb</filename>
    </added>
    <added>
      <filename>lib/templates/mysql/my.cnf.innodb_1024.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -11,25 +11,3 @@ require 'lib/capitate/recipes'
 
 require 'erb'
 
-# Test
-task :test_egrep do  
-  role :test, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
-  
-  found = utils.egrep(&quot;^mail.\\*&quot;, &quot;/etc/syslog.conf&quot;)
-  puts &quot;Found? #{found}&quot;
-  
-  found = utils.egrep(&quot;^fooo&quot;, &quot;/etc/syslog.conf&quot;)
-  puts &quot;Found? #{found}&quot;
-end
-
-task :test_app do  
-  set :application, &quot;sick&quot;
-  set :deploy_to, &quot;/var/www/apps/sick&quot;
-  role :web, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
-  role :app, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
-end
-
-task :test_install do
-  load File.dirname(__FILE__) + &quot;/lib/deployment/centos-5.1-64-web/install.rb&quot;
-  role :test, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
-end</diff>
      <filename>Capfile</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,10 @@
+== 0.2.14
+
+* Removing my lame monkey patches
+* Mysql cnf template
+* Cleaning up mysql grant locations
+* Logrotate for mysql slow query log
+
 == 0.2.13 2008-03-26
 
 * Fixing monit re/start for mongrel cluster and backgroundrb</diff>
      <filename>History.txt</filename>
    </modified>
    <modified>
      <diff>@@ -10,7 +10,7 @@ config/requirements.rb
 docs/nginx.README
 lib/capitate.rb
 lib/capitate/cap_ext/connections.rb
-lib/capitate/cap_ext/roles.rb
+lib/capitate/cap_ext/docs.rb
 lib/capitate/cap_ext/run_via.rb
 lib/capitate/cap_ext/variables.rb
 lib/capitate/plugins/base.rb
@@ -41,6 +41,7 @@ lib/recipes/docs.rb
 lib/recipes/logrotate/backgroundrb.rb
 lib/recipes/logrotate/mongrel_cluster.rb
 lib/recipes/logrotate/monit.rb
+lib/recipes/logrotate/mysql.rb
 lib/recipes/logrotate/nginx.rb
 lib/recipes/logrotate/rails.rb
 lib/recipes/logrotate/sphinx.rb
@@ -48,6 +49,7 @@ lib/recipes/logrotated.rb
 lib/recipes/memcached.rb
 lib/recipes/monit.rb
 lib/recipes/monit/backgroundrb.rb
+lib/recipes/monit/database.rb
 lib/recipes/monit/memcached.rb
 lib/recipes/monit/mongrel_cluster.rb
 lib/recipes/monit/mysql.rb
@@ -75,6 +77,7 @@ lib/templates/monit/monit.cnf
 lib/templates/monit/monit.initd.centos.erb
 lib/templates/monit/monitrc.erb
 lib/templates/mysql/install_db.sql.erb
+lib/templates/mysql/my.cnf.innodb_1024.erb
 lib/templates/mysql/mysql.monitrc.erb
 lib/templates/nginx/nginx.conf.erb
 lib/templates/nginx/nginx.initd.erb</diff>
      <filename>Manifest.txt</filename>
    </modified>
    <modified>
      <diff>@@ -27,13 +27,13 @@ require 'capitate/plugins/yum'
 require &quot;capitate/cap_ext/connections&quot;
 require &quot;capitate/cap_ext/variables&quot;
 require &quot;capitate/cap_ext/run_via&quot;
-require &quot;capitate/cap_ext/roles&quot;
+require &quot;capitate/cap_ext/docs&quot;
         
 class Capistrano::Configuration   
   include Capitate::CapExt::Variables
   include Capitate::CapExt::RunVia
-  include Capitate::CapExt::Roles
   include Capitate::CapExt::Connections
+  include Capitate::CapExt::Docs
 end
 
 #module Capistrano::Configuration::Connections; end</diff>
      <filename>lib/capitate.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,33 +3,6 @@ module Capitate
   module CapExt
     module Connections
   
-      def self.included(base) #:nodoc:
-        base.send :alias_method, :execute_on_servers_without_capitate, :execute_on_servers
-        base.send :alias_method, :execute_on_servers, :execute_on_servers_with_capitate
-      end
-  
-      # Determines the set of servers within the current task's scope and
-      # establishes connections to them, and then yields that list of
-      # servers.
-      #
-      # If you set:
-      #
-      #   set :ignore_missing_roles, true
-      #
-      # Overriden to handle NoMatchingServersError as NON-FATAL.      
-      #  
-      def execute_on_servers_with_capitate(options={}, &amp;block)        
-        if exists?(:ignore_missing_roles) &amp;&amp; fetch(:ignore_missing_roles)        
-          begin
-            execute_on_servers_without_capitate(options, &amp;block)
-          rescue Capistrano::NoMatchingServersError =&gt; e
-            logger.important &quot;`#{current_task.fully_qualified_name}' is only run for servers matching #{current_task.options.inspect}, but no servers matched&quot;
-          end
-        else
-          execute_on_servers_without_capitate(options, &amp;block)
-        end
-      end
-  
       # Set the user to something new (but save the old user; reset_user will set it back).
       # Takes care of invalidating current connections. Will force a re-login.
       # </diff>
      <filename>lib/capitate/cap_ext/connections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -125,13 +125,6 @@ module Capitate
         nil
       end
       
-      
-      def link_to_source(recipe_path)
-        full_path = File.expand_path(recipe_path)
-        project_path = File.expand_path(File.dirname(__FILE__) + &quot;/../../../&quot;)
-        &quot;http://github.com/gabriel/capitate/tree/master#{full_path.sub(project_path, &quot;&quot;)}&quot;
-      end
-    
     end
   end
   </diff>
      <filename>lib/capitate/cap_ext/variables.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@ module Capitate #:nodoc:
   module VERSION #:nodoc:
     MAJOR = 0
     MINOR = 2
-    TINY  = 13
+    TINY  = 14
 
     STRING = [MAJOR, MINOR, TINY].join('.')
   end</diff>
      <filename>lib/capitate/version.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,6 +10,7 @@ namespace :backgroundrb do
     &lt;dd&gt;Backgroundrb logrotate paths.&lt;/dd&gt;
     &lt;dd class=&quot;default&quot;&gt;Defaults to @\#{shared_path}/log/backgroundrb*.log@&lt;/dd&gt;
     &lt;/dl&gt;
+    &quot;Source&quot;:#{link_to_source(__FILE__)}    
     DESC
     task :install do
       fetch_or_default(:backgroundrb_logrotate_path, &quot;#{shared_path}/log/backgroundrb*.log&quot;)</diff>
      <filename>lib/recipes/logrotate/backgroundrb.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,7 +6,12 @@ namespace :mongrel do
       desc &lt;&lt;-DESC
       Install logrotated conf for mongrel cluster.
     
-      *mongrel_cluster_logrotate_path*: Mongrel cluster logrotate path. _Defaults to &lt;tt&gt;{shared_path}/log/mongrel_cluster_*.log&lt;/tt&gt;_
+      &lt;dl&gt;
+      &lt;dt&gt;mongrel_cluster_logrotate_path&lt;/dt&gt;
+      &lt;dd&gt;Mongrel cluster logrotate path&lt;/dd&gt;
+      &lt;dd class=&quot;default&quot;&gt;Defaults to @\#{shared_path}/log/mongrel_cluster_*.log@&lt;/dd&gt;
+      &lt;/dl&gt;
+      &quot;Source&quot;:#{link_to_source(__FILE__)}    
       DESC
       task :install do
         fetch_or_default(:mongrel_cluster_logrotate_path, &quot;#{shared_path}/log/mongrel_cluster_*.log&quot;)</diff>
      <filename>lib/recipes/logrotate/mongrel_cluster.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,12 @@ namespace :monit do
     desc &lt;&lt;-DESC
     Install logrotated conf for monit.
     
-    *monit_log_path*: Path to monit log. _Defaults to &lt;tt&gt;/var/log/monit.log&lt;/tt&gt;_
+    &lt;dl&gt;
+    &lt;dt&gt;monit_log_path&lt;/dt&gt;
+    &lt;dd&gt;Path to monit log&lt;/dd&gt;
+    &lt;dd class=&quot;default&quot;&gt;Defaults to @&quot;/var/log/monit.log&quot;@&lt;/dd&gt;
+    &lt;/dl&gt;
+    &quot;Source&quot;:#{link_to_source(__FILE__)}    
     DESC
     task :install do
       </diff>
      <filename>lib/recipes/logrotate/monit.rb</filename>
    </modified>
    <modified>
      <diff>@@ -55,6 +55,17 @@ namespace :logrotated do
   
   desc &lt;&lt;-DESC
   Force rotate files.
+  
+  &lt;dl&gt;
+  &lt;dt&gt;logrotate_prefix&lt;/dt&gt;
+  &lt;dd&gt;Path to logrotate&lt;/dd&gt;
+  &lt;dd&gt;Defaults to none&lt;/dd&gt;
+  
+  &lt;dt&gt;logrotate_conf_path&lt;/dt&gt;
+  &lt;dd&gt;Path to logrotate conf&lt;/dd&gt;
+  &lt;dd&gt;Defaults to @&quot;/etc/logrotate.conf&quot;@&lt;/dd&gt;
+  &lt;/dl&gt;
+  &quot;Source&quot;:#{link_to_source(__FILE__)}   
   DESC
   task :force do 
         </diff>
      <filename>lib/recipes/logrotated.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,38 @@
 namespace :memcached do
   
-  desc &quot;Create memcached yaml in shared path.&quot;
+  desc &lt;&lt;-DESC
+  Create memcached yaml in shared path.
+    
+  &lt;dl&gt;
+  &lt;dt&gt;memcached_namespace&lt;/dt&gt;
+  
+  &lt;dt&gt;memcached_ttl&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @3600@&lt;/dd&gt;
+  
+  &lt;dt&gt;memcached_readonly&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @false@&lt;/dd&gt;
+  
+  &lt;dt&gt;memcached_urlencode&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @false@&lt;/dd&gt;
+  
+  &lt;dt&gt;memcached_c_threshold&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @10000@&lt;/dd&gt;
+  
+  &lt;dt&gt;memcached_compression&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @true@&lt;/dd&gt;
+  
+  &lt;dt&gt;memcached_debug&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @false@&lt;/dd&gt;
+  
+  &lt;dt&gt;memcached_servers&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @[ &quot;localhost:11211&quot; ]@&lt;/dd&gt;
+  
+  &lt;dt&gt;memcached_yml_template&lt;/dt&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @&quot;memcached/memcached.yml.erb&quot;@&lt;/dd&gt;
+  &lt;/dl&gt;
+  
+  &quot;Source&quot;:#{link_to_source(__FILE__)}   
+  DESC
   task :setup do    
 
     # Settings</diff>
      <filename>lib/recipes/memcached.rb</filename>
    </modified>
    <modified>
      <diff>@@ -23,13 +23,13 @@ namespace :backgroundrb do
       sudo &quot;#{monit_bin_path} restart backgroundrb_#{application}&quot;
     end
     
-    desc &quot;Start mongrel cluster (for application)&quot;
+    desc &quot;Start backgroundrb (for application)&quot;
     task :start do
       fetch_or_default(:monit_bin_path, &quot;monit&quot;)
       sudo &quot;#{monit_bin_path} start backgroundrb_#{application}&quot; 
     end
     
-    desc &quot;Stop mongrel cluster (for application)&quot;
+    desc &quot;Stop backgroundrb (for application)&quot;
     task :stop do
       fetch_or_default(:monit_bin_path, &quot;monit&quot;)
       sudo &quot;#{monit_bin_path} stop backgroundrb_#{application}&quot;</diff>
      <filename>lib/recipes/monit/backgroundrb.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,9 +3,24 @@ namespace :mysql do
   namespace :monit do
   
     desc &lt;&lt;-DESC
-    Install mysql monit hooks. &quot;Source&quot;:#{link_to_source(__FILE__)}  
+    Install mysql monit hooks. 
+    
+    &lt;dl&gt;
+    &lt;dt&gt;mysql_pid_path&lt;/dt&gt;
+    &lt;dd&gt;Path to mysql pid file&lt;/dd&gt;
+
+    &lt;dt&gt;db_port&lt;/dt&gt;
+    &lt;dd&gt;Mysql port&lt;/dd&gt;
+    &lt;dd class=&quot;default&quot;&gt;Defaults to @3306@&lt;/dd&gt;
+    
+    &lt;dt&gt;monit_conf_dir&lt;/dt&gt;
+    &lt;dd&gt;Monitrd directory.&lt;/dd&gt;
+    &lt;dd class=&quot;default&quot;&gt;Defaults to @&quot;/etc/monit&quot;@&lt;/dd&gt;
+    &lt;/dl&gt;    
+    
+    &quot;Source&quot;:#{link_to_source(__FILE__)}  
     DESC
-    task :install do
+    task :install, :roles =&gt; :db do
     
       # Settings 
       fetch_or_default(:mysql_pid_path, &quot;/var/run/mysqld/mysqld.pid&quot;)
@@ -14,8 +29,8 @@ namespace :mysql do
     
       put template.load(&quot;mysql/mysql.monitrc.erb&quot;, binding), &quot;/tmp/mysql.monitrc&quot;    
       run_via &quot;install -o root /tmp/mysql.monitrc #{monit_conf_dir}/mysql.monitrc&quot;
-    end
-    
+    end      
+        
   end
   
 end
\ No newline at end of file</diff>
      <filename>lib/recipes/monit/mysql.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,8 +5,7 @@ namespace :nginx do
     desc &lt;&lt;-DESC 
     Install nginx monit hooks.
   
-    &lt;dl&gt;
-    
+    &lt;dl&gt;    
     &lt;dt&gt;nginx_pid_path&lt;/dt&gt;
     &lt;dd&gt;Path to nginx pid file&lt;/dd&gt;
     &lt;dd&gt;Defaults to /var/run/nginx.pid&lt;/dd&gt;
@@ -28,6 +27,24 @@ namespace :nginx do
       put template.load(&quot;nginx/nginx.monitrc.erb&quot;, binding), &quot;/tmp/nginx.monitrc&quot;    
       run_via &quot;install -o root /tmp/nginx.monitrc #{monit_conf_dir}/nginx.monitrc&quot;
     end
+        
+    desc &quot;Restart nginx (through monit)&quot;
+    task :restart do
+      fetch_or_default(:monit_bin_path, &quot;monit&quot;)
+      sudo &quot;#{monit_bin_path} restart nginx&quot;
+    end
+    
+    desc &quot;Start nginx (through monit)&quot;
+    task :start do
+      fetch_or_default(:monit_bin_path, &quot;monit&quot;)
+      sudo &quot;#{monit_bin_path} start nginx&quot; 
+    end
+    
+    desc &quot;Stop nginx (through monit)&quot;
+    task :stop do
+      fetch_or_default(:monit_bin_path, &quot;monit&quot;)
+      sudo &quot;#{monit_bin_path} stop nginx&quot;
+    end
     
   end
   </diff>
      <filename>lib/recipes/monit/nginx.rb</filename>
    </modified>
    <modified>
      <diff>@@ -36,18 +36,7 @@ namespace :mysql do
     fetch(:db_pass)
     fetch_or_default(:mysql_admin_password, prompt.password('Mysql admin password: '))
     fetch_or_default(:mysql_grant_priv_type, &quot;ALL&quot;)
-    
-    # Set grant locations to all servers in roles: :search, :db, :app
-    unless exists?(:mysql_grant_locations) 
-      mysql_grant_locations = [ &quot;localhost&quot; ]
-      role_names = [ :search, :db, :app ]
-      role_names.each do |role_name| 
-        roles[role_name].each do |role|
-          mysql_grant_locations &lt;&lt; role.host
-        end unless roles[role_name].blank?
-      end
-      set :mysql_grant_locations, mysql_grant_locations.uniq!
-    end 
+    fetch_or_default(:mysql_grant_locations, [ &quot;localhost&quot; ])
     
     sql = template.load(&quot;mysql/install_db.sql.erb&quot;)       
     
@@ -57,4 +46,31 @@ namespace :mysql do
     run &quot;mysql -u root -p#{mysql_admin_password} &lt; /tmp/install_db_#{application}.sql&quot;
   end
   
+  desc &lt;&lt;-DESC
+  Create my.cnf based on template.
+  
+  &lt;dl&gt;
+  &lt;dt&gt;my_cnf_template&lt;/dt&gt;
+  &lt;dd&gt;Path to my.cnf template&lt;/dd&gt;
+  
+  &lt;dt&gt;db_socket&lt;/dt&gt;
+  &lt;dd&gt;Path to mysql .sock&lt;/dd&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @&quot;/var/lib/mysql/mysql.sock&quot;@&lt;/dd&gt;
+  
+  &lt;dt&gt;db_port&lt;/dt&gt;
+  &lt;dd&gt;Mysql port&lt;/dd&gt;
+  &lt;dd class=&quot;default&quot;&gt;Defaults to @3306@&lt;/dd&gt;
+  &lt;/dl&gt;
+  
+  &quot;Source&quot;:#{link_to_source(__FILE__)}
+  DESC
+  task :install_my_cnf, :roles =&gt; :db do      
+    fetch_or_default(:my_cnf_template, &quot;mysql/my.cnf.innodb_1024.erb&quot;)      
+    fetch_or_default(:db_socket, &quot;/var/lib/mysql/mysql.sock&quot;)
+    fetch_or_default(:db_port, 3306)
+    
+    utils.install_template(my_cnf_template, &quot;/etc/my.cnf&quot;)    
+  end
+  
+  
 end</diff>
      <filename>lib/recipes/mysql.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,10 +7,12 @@ namespace :nginx do
   
     &lt;dl&gt;
     &lt;dt&gt;mongrel_application&lt;/dt&gt;
-    &lt;dd&gt;Mongrel application. _Defaults to &lt;tt&gt;:application&lt;/tt&gt;_
+    &lt;dd&gt;Mongrel application.&lt;/dd&gt;
+    &lt;dd class=&quot;default&quot;&gt;Defaults to @:application@&lt;/dd&gt;
     
-    &lt;dt&gt;mongrel_size&lt;/dt&gt;: Number of mongrels.\n
-    &lt;dd&gt;@set :mongrel_size, 3@\n    
+    &lt;dt&gt;mongrel_size&lt;/dt&gt;
+    &lt;dd&gt;Number of mongrels.&lt;/dd&gt;
+    &lt;dd&gt;@set :mongrel_size, 3@&lt;/dd&gt;  
     
     &lt;dt&gt;*mongrel_port&lt;/dt&gt;
     &lt;dd&gt;Starting port for mongrels. If there are 3 mongrels with port 9000, then instances will be at 9000, 9001, and 9002&lt;/dd&gt;</diff>
      <filename>lib/recipes/nginx.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,8 +2,34 @@ require File.dirname(__FILE__) + '/test_helper.rb'
 
 class TestRecipes &lt; Test::Unit::TestCase
   
-  def test_load
-    #load File.dirname(__FILE__) + &quot;/../lib/capitate/recipes.rb&quot;
+  def test_egrep
+    # task :test_egrep do  
+    #   role :test, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
+    # 
+    #   found = utils.egrep(&quot;^mail.\\*&quot;, &quot;/etc/syslog.conf&quot;)
+    #   puts &quot;Found? #{found}&quot;
+    # 
+    #   found = utils.egrep(&quot;^fooo&quot;, &quot;/etc/syslog.conf&quot;)
+    #   puts &quot;Found? #{found}&quot;
+    # end    
+    assert true
+  end
+  
+  def test_app
+    # task :test_app do  
+    #   set :application, &quot;sick&quot;
+    #   set :deploy_to, &quot;/var/www/apps/sick&quot;
+    #   role :web, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
+    #   role :app, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
+    # end
+    assert true
+  end
+
+  def test_install
+    # task :test_install do
+    #   load File.dirname(__FILE__) + &quot;/lib/deployment/centos-5.1-64-web/install.rb&quot;
+    #   role :test, &quot;10.0.6.118&quot;, :user =&gt; &quot;root&quot;
+    # end
     assert true
   end
   </diff>
      <filename>test/test_recipes.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>lib/capitate/cap_ext/roles.rb</filename>
    </removed>
    <removed>
      <filename>test/test_roles.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>03cbc3dde5bf11d8eb4a52a69db508be11a3f12f</id>
    </parent>
  </parents>
  <author>
    <name>Gabe</name>
    <email>gabrielh@gmail.com</email>
  </author>
  <url>http://github.com/gabriel/capitate/commit/d482ddbcaf346eac68e50ccd72370bb5fd3ac7de</url>
  <id>d482ddbcaf346eac68e50ccd72370bb5fd3ac7de</id>
  <committed-date>2008-03-27T15:26:55-07:00</committed-date>
  <authored-date>2008-03-27T15:26:55-07:00</authored-date>
  <message>adding mysql recipes/templates, cleaning up docs</message>
  <tree>3c21fbf28e17732152cf4585a1879d2fa99cfa7b</tree>
  <committer>
    <name>Gabe</name>
    <email>gabrielh@gmail.com</email>
  </committer>
</commit>
