Sha256: 53327d650f76b61d34b43f2a0d30a568dcb3ccb145a1be673551f2e00dd3920d

Contents?: true

Size: 791 Bytes

Versions: 35

Compression:

Stored size: 791 Bytes

Contents

Capistrano::Configuration.instance(:must_exist).load do

  namespace :ssl do    
    desc "create csr and key for ssl certificates"
    task :create, :roles => :app, :except => {:no_release => true} do
      sudo "mkdir -p /data/ssl/"
      set(:length) { Capistrano::CLI.ui.ask("key length (1024 or 2048): ") }
      set(:country) { Capistrano::CLI.ui.ask("Country Code (2 letters): ") }
      set(:state) { Capistrano::CLI.ui.ask("State/Province: ") }
      set(:city) { Capistrano::CLI.ui.ask("City: ") }
      set(:domain) { Capistrano::CLI.ui.ask("Common Name (domain): ") }
      run "cd /data/ssl/ && openssl req -new -nodes -days 365 -newkey rsa:#{length} -subj '/C=#{country}/ST=#{state}/L=#{city}/CN=#{domain}' -keyout #{domain}.com.key -out #{domain}.com.csr"
    end   
  end
end

Version data entries

35 entries across 35 versions & 3 rubygems

Version Path
eycap-0.5.16 lib/eycap/recipes/ssl.rb
eycap-0.5.15 lib/eycap/recipes/ssl.rb
eycap-0.5.14 lib/eycap/recipes/ssl.rb
eycap-0.5.13 lib/eycap/recipes/ssl.rb
eycap-0.5.12 lib/eycap/recipes/ssl.rb
eycap-0.5.11 lib/eycap/recipes/ssl.rb
eycap-0.5.10 lib/eycap/recipes/ssl.rb
eycap-0.5.9 lib/eycap/recipes/ssl.rb
eycap-0.5.8 lib/eycap/recipes/ssl.rb
eycap-0.5.7 lib/eycap/recipes/ssl.rb
newrelic-eycap-0.5.6.0 lib/eycap/recipes/ssl.rb
eycap-0.5.6 lib/eycap/recipes/ssl.rb
gabetax-eycap-0.5.6 lib/eycap/recipes/ssl.rb
eycap-0.5.5 lib/eycap/recipes/ssl.rb
eycap-0.5.3 lib/eycap/recipes/ssl.rb