Has anyone found a straightforward way to force Ohai to use a specific interface’s IP address as the “main” ip address for the Chef node? All our server’s are multi-homed (have 2-3 interfaces). Chef is currently picking the IP of an interface that should not be considered the main interface for the node. From what I found so far, Ohai references the order of the routes to determine which interface IP to select…?
FWIW, the logic used to determine the automatic attribute ipaddress is
located here:
We've created custom ohai plugins for systems needing an ipaddress
override, and use the ohai cookbook
(GitHub - chef-boneyard/ohai: Development repository for Chef Cookbook ohai) to deploy them. Not sure if
I'd classify it as straightforward (was fairly daunting for me while I
was learning Chef), but it's the only way that I currently know of to
deal with automatic attributes.
On 05/06/2015 05:27 PM, Vauter, George wrote:
Has anyone found a straightforward way to force Ohai to use a specific interface’s IP address as the “main” ip address for the Chef node? All our server’s are multi-homed (have 2-3 interfaces). Chef is currently picking the IP of an interface that should not be considered the main interface for the node. From what I found so far, Ohai references the order of the routes to determine which interface IP to select…?
I have achieved this before by changing the default route in the IP table
to be the main IP address. Obviously not very helpful unless this is
actually how you want your machines configured.
We've created custom ohai plugins for systems needing an ipaddress
override, and use the ohai cookbook
(GitHub - chef-boneyard/ohai: Development repository for Chef Cookbook ohai) to deploy them. Not sure if
I'd classify it as straightforward (was fairly daunting for me while I
was learning Chef), but it's the only way that I currently know of to
deal with automatic attributes.
On 05/06/2015 05:27 PM, Vauter, George wrote:
Has anyone found a straightforward way to force Ohai to use a specific
interface’s IP address as the “main” ip address for the Chef node? All our
server’s are multi-homed (have 2-3 interfaces). Chef is currently picking
the IP of an interface that should not be considered the main interface for
the node. From what I found so far, Ohai references the order of the
routes to determine which interface IP to select…?
I have achieved this before by changing the default route in the IP table to be the main IP address. Obviously not very helpful unless this is actually how you want your machines configured.
We've created custom ohai plugins for systems needing an ipaddress
override, and use the ohai cookbook
(GitHub - chef-boneyard/ohai: Development repository for Chef Cookbook ohai) to deploy them. Not sure if
I'd classify it as straightforward (was fairly daunting for me while I
was learning Chef), but it's the only way that I currently know of to
deal with automatic attributes.
On 05/06/2015 05:27 PM, Vauter, George wrote:
Has anyone found a straightforward way to force Ohai to use a specific interface’s IP address as the “main” ip address for the Chef node? All our server’s are multi-homed (have 2-3 interfaces). Chef is currently picking the IP of an interface that should not be considered the main interface for the node. From what I found so far, Ohai references the order of the routes to determine which interface IP to select…?