Skip to content

Conversation

@yaliarous
Copy link

@yaliarous yaliarous commented Jul 13, 2025

Why this PR:

When provisioning with vagrant in bridge mode, IP address assignment may be delayed. In this case, while provisioning, the host file will be incorrect because the public-ipcommand will return an empty value

What does the PR do:

This PR adds a loop to wait until a valid IP address is assigned before proceeding. This ensures that the public-ip command returns the correct IP and the hosts file is properly configured.

@fireflycons
Copy link
Collaborator

Unchecked loops are dangerous 😉

What happens if the IP never comes up? Have you observed how long it may wait here before the IP is valid? I would use a counter and a sleep 1 in the loop and if it has looped for more than e.g. 10 seconds, then it should print an error and exit 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants