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.068 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.067 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.066 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.065 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.064 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.063 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.062 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.061 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.059 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.058 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.057 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.056 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.055 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.054 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.053 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.052 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.051 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.050 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.049 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.048 lib/deprec/recipes/logrotate.rb