oscar-stack / vagrant-hosts

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

Provide a flexible import/export system for syncing host entries between VMs #58

Closed Sharpie closed 8 years ago

Sharpie commented 8 years ago

Currently, the only way to share host entries between VMs is to use the autoconfigure functionality. But, this is limited as it only pulls in private_network definitions with static ip addresses. A more flexible system would be to declare a set of entries to export from a VM along with a set of entries to import. Combined with features such as #56 and #57, this would allow for things like:

config.vm.provision :hosts do |p|
  p.exports = {
    # Export global IP addresses for hosts in other compute environments to use
    'global' => ['@vagrant_ssh', ['@vagrant_hostnames']],
    # Export private IP addresses for other hosts within AWS to use
    'aws' => ['@facter_ipaddress', ['@vagrant_hostnames']],
  }
  # Collect private IP addresses from other AWS hosts.
  p.imports = ['aws']
end