Sha256: 94f93abcf3b73648a756ddc45c362c984a1aa556a225e3c356beeaaa11b6ee36

Contents?: true

Size: 1.35 KB

Versions: 52

Compression:

Stored size: 1.35 KB

Contents

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

      # 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

52 entries across 52 versions & 4 rubygems

Version Path
andyh-deprec-1.99.26 lib/deprec/recipes/logrotate.rb
andyh-deprec-1.99.27 lib/deprec/recipes/logrotate.rb
isaac-deprec-1.99.30 lib/deprec/recipes/logrotate.rb
isaac-deprec-1.99.32 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc10 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc9 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc8 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc7 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc6 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc5 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc4 lib/deprec/recipes/logrotate.rb
deprec-3.1.0.rc3 lib/deprec/cap/recipes/logrotate.rb
deprec-3.1.0.rc2 lib/deprec/cap/recipes/logrotate.rb
deprec-3.1.0.rc1 lib/deprec/cap/recipes/logrotate.rb
deprec-2.2.3 lib/deprec/recipes/logrotate.rb
deprec-2.2.2 lib/deprec/recipes/logrotate.rb
deprec-2.2.1 lib/deprec/recipes/logrotate.rb
deprec-2.2.0 lib/deprec/recipes/logrotate.rb
deprec-2.1.19 lib/deprec/recipes/logrotate.rb
deprec-2.1.18 lib/deprec/recipes/logrotate.rb