Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

use the private ip if cloud instance

  • Loading branch information...
commit abae20801a2b0566416bdb0260db864e65042dd5 1 parent 1984eaf
@schisamo schisamo authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 cookbooks/mediawiki/recipes/db_bootstrap.rb
View
4 cookbooks/mediawiki/recipes/db_bootstrap.rb
@@ -37,8 +37,10 @@
group "root"
end
+db_host = (dbm.attribute?('cloud') ? dbm['cloud']['local_ipv4'] : dbm['ipaddress'])
+
execute "db_bootstrap" do
- command "/usr/bin/mysql -u #{db['username']} -p#{db['password']} -h #{dbm['fqdn']} #{db['database']} < #{Chef::Config[:file_cache_path]}/schema.sql"
+ command "/usr/bin/mysql -u #{db['username']} -p#{db['password']} -h #{db_host} #{db['database']} < #{Chef::Config[:file_cache_path]}/schema.sql"
action :run
notifies :create, "ruby_block[remove_mediawiki_bootstrap]", :immediately
end
Please sign in to comment.
Something went wrong with that request. Please try again.