From 7fd5ceeb053d3bac08bbbe4846023a2f78e0edb7 Mon Sep 17 00:00:00 2001 From: Artur Roszczyk Date: Sat, 8 Jun 2013 14:46:15 +0300 Subject: [PATCH] Update README.md Add description of custom IP resolver --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/README.md b/README.md index 0f11188..e9f1184 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,25 @@ Use: config.vm.provision :hostmanager ``` +Custom IP resolver +------------------ + +You can customize way, how host manager resolves IP address +for each machine. This might be handy in case of aws provider, +where host name is stored in ssh_info hash of each machine. +This causes generation of invalid /etc/hosts file. + +Custom IP resolver gives you oportunity to calculate IP address +for each machine by yourself. For example: + +```ruby +config.hostmanager.ip_resolver = proc do |vm| + if hostname = (vm.ssh_info && vm.ssh_info[:host]) + `host #{hostname}`.split("\n").last[/(\d+\.\d+\.\d+\.\d+)/, 1] + end +end +``` + Contribute ---------- Contributions are welcome.