Sha256: 24c123850eacfc73ecbe3b8400aa78b391c11cd276eee7b7ae06b87273bb6dba

Contents?: true

Size: 1.44 KB

Versions: 5

Compression:

Stored size: 1.44 KB

Contents

require 'deprec-core'
Capistrano::Configuration.instance(:must_exist).load do 
  namespace :deprec do 
    namespace :ssl do

      # Install Openssl
      task :install, :roles => :web do
        install_deps
      end

      # Install dependencies for ssl
      task :install_deps, :roles => :web do
        apt.install( {:base => %w(openssl)}, :stable )
      end

      PROJECT_CONFIG_FILES[:ssl] = [

        {:template => 'ssl-cert-snakeoil.pem',
          :path => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
          :mode => 0644,
          :owner => 'root:root'},

        {:template => 'ssl-cert-snakeoil.key',
          :path => "/etc/ssl/private/ssl-cert-snakeoil.key",
          :mode => 0640,
          :owner => 'root:ssl-cert'},
          
        { :template => 'make-ssl-cert',
            :path => "/usr/sbin/make-ssl-cert",
            :mode => 0755,
            :owner => 'root:root'}
          
      ]
      
      # Generate ssl certs
      task :config_gen do
        PROJECT_CONFIG_FILES[:ssl].each do |file|
          deprec2.render_template(:ssl, file)
        end
      end

      # Copy out ssl certs
      task :config, :roles => :web do
        deprec2.push_configs(:ssl, PROJECT_CONFIG_FILES[:ssl])
      end
      
      # WOn't run without controlling terminal! :-(
      # task :generate_snakeoil_cert, :roles => :web do
      #   sudo "/usr/sbin/make-ssl-cert generate-default-snakeoil"
      # end
      
    end
    
  end
end
      

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
deprec-3.1.0.rc16 lib/deprec/recipes/ssl.rb
deprec-3.1.0.rc15 lib/deprec/recipes/ssl.rb
deprec-3.1.0.rc13 lib/deprec/recipes/ssl.rb
deprec-3.1.0.rc12 lib/deprec/recipes/ssl.rb
deprec-3.1.0.rc11 lib/deprec/recipes/ssl.rb