Sha256: 823bcb8e2b8fbf098e843924a15818baa868902a40b3aacdd8ce5ba40b51fe2d

Contents?: true

Size: 1.51 KB

Versions: 46

Compression:

Stored size: 1.51 KB

Contents

namespace :rubber do
  
  namespace :collectd do
  
    rubber.allow_optional_tasks(self)

    after "rubber:bootstrap", "rubber:collectd:bootstrap"
    after "deploy:restart", "rubber:collectd:restart_rubber_plugin"


    task :bootstrap, :roles => :collectd do
      exists = capture("echo $(grep Rubber /etc/collectd/collectd.conf 2> /dev/null)")
      if exists.strip.size == 0
        rubber.update_code_for_bootstrap

        rubber.run_config(:file => "role/collectd/", :force => true, :deploy_path => release_path)

        restart
      end
    end

    desc "Start collectd system monitoring"
    task :start, :roles => :collectd do
      rsudo "service collectd status || service collectd start"
    end
    
    desc "Stop collectd system monitoring"
    task :stop, :roles => :collectd do
      rsudo "service collectd stop || true"
    end
    
    desc "Restart collectd system monitoring"
    task :restart, :roles => :collectd do
      stop
      start
    end

    desc "Restart collectd rubber plugin"
    task :restart_rubber_plugin, :roles => :collectd do
      # Need to kill rubber collectd runner script to force collectd to restart
      # it after deploy so that the runner script gets the new paths
      rsudo "pkill -fn #{rubber_env.rubber_collectd_runner.sub(/./, '[\0]')} ; exit 0"
    end

    desc "Display status of collectd system monitoring"
    task :status, :roles => :collectd do
      rsudo "service collectd status || true"
      rsudo "ps -eopid,user,fname | grep [c]ollectd || true"
    end

  end

end

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
rubber-3.2.2 templates/collectd/config/rubber/deploy-collectd.rb
rubber-3.2.1 templates/collectd/config/rubber/deploy-collectd.rb
rubber-3.2.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-3.1.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-3.0.1 templates/collectd/config/rubber/deploy-collectd.rb
rubber-3.0.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.16.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.15.2 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.15.1 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.15.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.14.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.13.1 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.13.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.12.2 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.12.1 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.12.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.11.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.10.2 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.10.1 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.10.0 templates/collectd/config/rubber/deploy-collectd.rb