Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/vagrant-digitalocean/actions/create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,13 @@ def call(env)
@machine.id = result['droplet']['id'].to_s

# refresh droplet state with provider and output ip address
droplet = Provider.droplet(@machine, :refresh => true)
public_network = droplet['networks']['v4'].find { |network| network['type'] == 'public' }
droplet = nil
public_network = nil
retryable(:tries => 10, :sleep => 5) do
droplet = Provider.droplet(@machine, :refresh => true)
public_network = droplet['networks']['v4'].find { |network| network['type'] == 'public' }
raise 'Public network IP not yet available' unless public_network && public_network['ip_address']
end
private_network = droplet['networks']['v4'].find { |network| network['type'] == 'private' }
env[:ui].info I18n.t('vagrant_digital_ocean.info.droplet_ip', :ip => public_network['ip_address'])
if private_network
Expand Down