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.007 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.006 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.005 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.004 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.003 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.002 lib/deprec/recipes/logrotate.rb
le1t0-deprec-2.1.6.001 lib/deprec/recipes/logrotate.rb