oscar-stack / vagrant-hosts

Manage static DNS on vagrant guests
Other
317 stars 26 forks source link

Guard against phantom machines #53

Closed Sharpie closed 8 years ago

Sharpie commented 8 years ago

Sometimes, for unknown reasons, Vagrant thinks a machine exists when it does not. Under these conditions cycling through the active_machines list will produce an error:

==> plain-vm: Setting hostname...
==> plain-vm: Configuring and enabling network interfaces...
==> plain-vm: Mounting shared folders...
    plain-vm: /vagrant => /Users/sharpie/Source/puppet-debugging-kit
==> plain-vm: Running provisioner: hosts...
The machine with the name 'pe-201520-agent' was not found configured for
this Vagrant environment.

The VagrantHosts::Addresses module provides an all_machines method that guards against this. The new sync_hosts functionality should use it.

Sharpie commented 8 years ago

NOTE: This commonly happens when the definition for a machine is deleted from the Vagrantfile without running vagrant destroy on the machine first.