Reputation: 2112
I'm currently using the following code:
elastic_ip = search(:node, 'roles:elastic',
filter_result: {
'ip' => ['ipaddress']
})
The problem is that I have more than one network interface, and it gives me a wrong one.
How can I ask for the different network interface?
Upvotes: 0
Views: 40
Reputation: 54249
Ohai collects info on all interfaces under node[‘network’][‘interfaces’]
which you can get an address from, though you’ll need some way to know which one is correct.`node[’ipaddress’]’ comes from the interface associated with the default route.
Upvotes: 1