Sha256: d0a58bc9ef9c388759329ffae7de7a5873a816337ec06812cca25839f70cd4ef

Contents?: true

Size: 1.37 KB

Versions: 29

Compression:

Stored size: 1.37 KB

Contents

namespace :rubber do

  namespace :newrelic do

    rubber.allow_optional_tasks(self)

    before "rubber:install_packages", "rubber:newrelic:install_newrelic_apt"

    task :install_newrelic_apt, :roles => :newrelic do
      rubber.sudo_script 'install_newrelic', <<-ENDSCRIPT
        if [[ -z $(cat /etc/apt/sources.list.d/newrelic.list 2> /dev/null) ]]; then
          wget -O /etc/apt/sources.list.d/newrelic.list http://download.newrelic.com/debian/newrelic.list
          apt-key adv --keyserver hkp://subkeys.pgp.net --recv-keys 548C16BF
        fi
      ENDSCRIPT
    end

    after "rubber:bootstrap", "rubber:newrelic:bootstrap"

    task :bootstrap, :roles => :newrelic do
      rubber.sudo_script 'bootstrap_newrelic', <<-ENDSCRIPT
        if [[ -z $(cat /etc/newrelic/nrsysmond.cfg | grep #{rubber_env.nrsysmond_license_key} 2> /dev/null) ]]; then
          nrsysmond-config --set license_key=#{rubber_env.nrsysmond_license_key}
        fi
      ENDSCRIPT

      restart
    end

    desc "Start newrelic system monitoring"
    task :start, :roles => :newrelic do
      rsudo "service newrelic-sysmond start"
    end

    desc "Stop newrelic system monitoring"
    task :stop, :roles => :newrelic do
      rsudo "service newrelic-sysmond stop || true"
    end

    desc "Restart newrelic system monitoring"
    task :restart, :roles => :newrelic do
      stop
      start
    end

  end

end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
rubber-2.9.0 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.8.1 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.8.0 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.7.5 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.7.4 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.7.3 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.7.2 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.7.1 templates/newrelic/config/rubber/deploy-newrelic.rb
rubber-2.7.0 templates/newrelic/config/rubber/deploy-newrelic.rb