Sha256: 23d7fd5ce79dde242cdfd271cdbcd0e33bcef8037df1d33678ff0c7c4d082b6e

Contents?: true

Size: 1.7 KB

Versions: 87

Compression:

Stored size: 1.7 KB

Contents

# Copyright 2009-2010 by le1t0@github. All rights reserved.
Capistrano::Configuration.instance(:must_exist).load do 
  namespace :deprec do
    namespace :mysql_proxy do
  
      set :mysql_proxy_backend_servers, [ '192.168.0.1' ]
      set :mysql_proxy_read_only_backend_servers, [ '192.168.0.2', '192.168.0.3' ]
  
      desc "Install mysql_proxy on server"
      task :install, :roles => :proxy do
        install_deps
        config
        reactivate
      end
  
      task :install_deps, :roles => :proxy do
        apt.install( {:base => %w(mysql-proxy)}, :stable )
      end
  
      SYSTEM_CONFIG_FILES[:mysql_proxy] = [
        {:template => 'mysql-proxy-default.erb',
         :path => '/etc/default/mysql-proxy',
         :mode => 0644,
         :owner => 'root:root'}
      ]
  
      desc "Generate config files for mysql_proxy"
      task :config_gen do
        SYSTEM_CONFIG_FILES[:mysql_proxy].each do |file|
          deprec2.render_template(:mysql_proxy, file)
        end
      end
  
      desc "Push mysql_proxy config files to server"
      task :config, :roles => :proxy do
        deprec2.push_configs(:mysql_proxy, SYSTEM_CONFIG_FILES[:mysql_proxy])
      end

      task :start, :roles => :proxy do
        sudo "/etc/init.d/mysql-proxy start"
      end

      task :stop, :roles => :proxy do
        sudo "/etc/init.d/mysql-proxy stop"
      end
  
      task :restart do
        stop
        start
      end

      task :activate, :roles => :proxy do
        sudo "update-rc.d mysql-proxy defaults"
      end
  
      task :deactivate, :roles => :proxy do
        sudo "update-rc.d -f mysql-proxy remove"
      end
  
      task :reactivate do
        deactivate
        activate
      end
  
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
le1t0-deprec-2.1.6.007 lib/deprec/recipes/mysql_proxy.rb.unmaintained
le1t0-deprec-2.1.6.006 lib/deprec/recipes/mysql_proxy.rb.unmaintained
le1t0-deprec-2.1.6.005 lib/deprec/recipes/mysql_proxy.rb.unmaintained
le1t0-deprec-2.1.6.004 lib/deprec/recipes/mysql_proxy.rb
le1t0-deprec-2.1.6.003 lib/deprec/recipes/mysql_proxy.rb
le1t0-deprec-2.1.6.002 lib/deprec/recipes/mysql_proxy.rb
le1t0-deprec-2.1.6.001 lib/deprec/recipes/mysql_proxy.rb