Update README.md

Add description of custom IP resolver
This commit is contained in:
Artur Roszczyk 2013-06-08 14:46:15 +03:00
parent ed76e4b0e3
commit 7fd5ceeb05
1 changed files with 19 additions and 0 deletions

View File

@ -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.