厨师搜索api互联网界面(Chef search api internet interface)

系统教程 行业动态 更新时间:2024-06-14 17:01:34
厨师搜索api互联网界面(Chef search api internet interface)

我目前正在使用以下代码:

elastic_ip = search(:node, 'roles:elastic', filter_result: { 'ip' => ['ipaddress'] })

问题是我有多个网络接口,它给了我一个错误的网络接口。

我怎样才能要求不同的网络接口?

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?

最满意答案

Ohai收集node['network']['interfaces']下所有接口的信息,你可以从中获取地址,但你需要一些方法来知道哪一个是正确的.node ['ipaddress']'来自与默认路由关联的接口。

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.

更多推荐

本文发布于:2023-04-20 18:40:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/dzcp/765e2f937c2a5f209edda3f48e8f299f.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:互联网   厨师   界面   api   interface

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!