Sha256: f748664c025e6899644f660b318252d0f40201634cfccff7759eee83b691214d

Contents?: true

Size: 1.45 KB

Versions: 87

Compression:

Stored size: 1.45 KB

Contents

# Copyright 2006-2008 by Mike Bailey. All rights reserved.
Capistrano::Configuration.instance(:must_exist).load do 
  namespace :deprec do 
    namespace :logrotate do

      set :use_logrotate, true # FIXME: should be generic namespace logrotation, with :none option

      # Install      

      desc "Install logrotate"
      task :install do
        install_deps
        SYSTEM_CONFIG_FILES[:logrotate].each do |file|
          deprec2.render_template(:logrotate, file.merge(:remote => true))
        end
      end

      # install dependencies for nginx
      task :install_deps do
        apt.install( {:base => %w(logrotate)}, :stable )
      end

      # Configure

      SYSTEM_CONFIG_FILES[:logrotate] = [

        {:template => 'logrotate.conf.erb',
          :path => '/etc/logrotate.conf',
          :mode => 0755,
          :owner => 'root:root'}
      ]

      desc "Generate logrotate config from template."
      task :config_gen do
        SYSTEM_CONFIG_FILES[:logrotate].each do |file|
          deprec2.render_template(:logrotate, file)
        end
      end

      desc "Push logrotate config files to server"
      task :config do
        deprec2.push_configs(:logrotate, SYSTEM_CONFIG_FILES[:logrotate])
      end

      # Control
      #
      # logrotate is run via cron with a script in /etc/cron.daily/logrotate 
      
      desc "Force logrotate to run"
      task :force do
        sudo "logrotate -f /etc/logrotate.conf"
      end

    end 
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
le1t0-deprec-2.1.6.047 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.046 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.045 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.044 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.043 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.042 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.041 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.040 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.039 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.038 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.037 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.036 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.035 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.034 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.033 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.032 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.031 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.030 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.029 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.028 lib/deprec/recipes/logrotate.rb