Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

Commit

Permalink
Merge pull request #180 from intercity/chef-for-ssl-file-presence
Browse files Browse the repository at this point in the history
Check if enable_ssl is set, otherwise check for certificate
  • Loading branch information
jvanbaarsen committed Mar 3, 2015
2 parents be5c374 + 7c315a4 commit 177bf31
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion vendor/cookbooks/rails/recipes/passenger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@

end

has_ssl_info = false
if app_info['ssl_info']
template "#{applications_root}/#{app}/shared/config/certificate.crt" do
owner "deploy"
Expand All @@ -125,16 +126,19 @@
source "app_cert.key.erb"
variables :app_key=> app_info['ssl_info']['key']
end
has_ssl_info = true
end

enable_ssl = has_ssl_info ||
File.exists?("#{applications_root}/#{app}/shared/config/certificate.crt")
template "/etc/nginx/sites-available/#{app}.conf" do
source "app_passenger_nginx.conf.erb"
variables(
name: app,
rails_env: rails_env,
domain_names: app_info["domain_names"],
redirect_domain_names: app_info["redirect_domain_names"],
enable_ssl: File.exists?("#{applications_root}/#{app}/shared/config/certificate.crt"),
enable_ssl: enable_ssl,
custom_configuration: nginx_custom_configuration(app_info))
notifies :reload, resources(:service => "nginx")
end
Expand Down

0 comments on commit 177bf31

Please sign in to comment.