Skip to content

Commit

Permalink
[COOK-606] use private IPs by default
Browse files Browse the repository at this point in the history
  • Loading branch information
schisamo committed Jul 12, 2011
1 parent ee38fa9 commit cd3e2ab
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion application/recipes/django.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
group app["group"]
mode "644"
variables(
:host => dbm['fqdn'],
:host => (dbm.attribute?('cloud') ? dbm['cloud']['local_ipv4'] : dbm['ipaddress']),
:database => app['databases'][node.chef_environment],
:django_version => django_version
)
Expand Down
4 changes: 2 additions & 2 deletions application/recipes/java_webapp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
dbm = rows[0]
end
end

# Assuming we have one...
if dbm
template "#{app['deploy_to']}/shared/#{app['id']}.xml" do
Expand All @@ -90,7 +90,7 @@
group app["group"]
mode "644"
variables(
:host => dbm['fqdn'],
:host => (dbm.attribute?('cloud') ? dbm['cloud']['local_ipv4'] : dbm['ipaddress']),
:app => app['id'],
:database => app['databases'][node.chef_environment],
:war => "#{app['deploy_to']}/releases/#{app['war'][node.chef_environment]['checksum']}.war"
Expand Down
6 changes: 3 additions & 3 deletions application/recipes/mod_php_apache2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
include_recipe "apache2::mod_headers"
include_recipe "apache2::mod_php5"

server_aliases = [ "#{app['id']}.#{node['domain']}", node.fqdn ]
server_aliases = [ "#{app['id']}.#{node['domain']}", node['fqdn'] ]

if node.has_key?("ec2")
server_aliases << node.ec2.public_hostname
if node.has_key?("cloud")
server_aliases << node['cloud']['public_hostname']
end

web_app app['id'] do
Expand Down
6 changes: 3 additions & 3 deletions application/recipes/passenger_apache2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
include_recipe "apache2::mod_rewrite"
include_recipe "passenger_apache2::mod_rails"

server_aliases = [ "#{app['id']}.#{node[:domain]}", node.fqdn ]
server_aliases = [ "#{app['id']}.#{node['domain']}", node['fqdn'] ]

if node.has_key?("ec2")
server_aliases << node.ec2.public_hostname
if node.has_key?("cloud")
server_aliases << node['cloud']['public_hostname']
end

web_app app['id'] do
Expand Down
2 changes: 1 addition & 1 deletion application/recipes/php.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
mode "644"
variables(
:path => "#{app['deploy_to']}/current",
:host => dbm['fqdn'],
:host => (dbm.attribute?('cloud') ? dbm['cloud']['local_ipv4'] : dbm['ipaddress']),
:database => app['databases'][node.chef_environment],
:app => app
)
Expand Down
2 changes: 1 addition & 1 deletion application/recipes/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
group app["group"]
mode "644"
variables(
:host => dbm['fqdn'],
:host => (dbm.attribute?('cloud') ? dbm['cloud']['local_ipv4'] : dbm['ipaddress']),
:databases => app['databases'],
:rails_env => rails_env
)
Expand Down

0 comments on commit cd3e2ab

Please sign in to comment.