Sha256: 867791bf380ee5f58ca8b3ae55ca01caae336476ed3ce29e25cc9b397c36195d

Contents?: true

Size: 1.28 KB

Versions: 17

Compression:

Stored size: 1.28 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 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

  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
rubber-2.0.4 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.3 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.2 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.1 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre12 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre11 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre10 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre9 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre8 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre7 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre6 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre5 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre4 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre3 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre2 templates/collectd/config/rubber/deploy-collectd.rb
rubber-2.0.0.pre1 templates/collectd/config/rubber/deploy-collectd.rb