johnbellone/consul-cookbook — pull request #32 by romesh-mccullough (2014-08-05 19:01:20+00:00)
Title: Set bind interface

When using environments with dynamic networking (such as Vagrant + vagrant-auto_network) it may be hard/impossible to declare IP's for bind_addr and advertise_addr ahead of time. Binding to 0.0.0.0 will bind to the first interface, which may not be the proper interface for cluster communications.

However, it is usually predictable which interface will be the proper one. This update allows you to specify that interface by name, which then grabs the IP out of Ohai attributes and sets the proper addr attribute to get written to the config.