gpt4 book ai didi

chef-infra - Vagrant : how to get hostonly ip address from within chef recipe?

转载 作者:行者123 更新时间:2023-12-04 13:33:11 26 4
gpt4 key购买 nike

我正在尝试检索Vagrantfile中指定的hostonly IP地址:

config.vm.network :hostonly, "33.33.33.33"

在配方文件中:

mycookbook/files/default/xdebug.ini
[xdebug]
zend_extension = "/usr/lib/php/modules/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "***HERE***"
xdebug.trace_output_dir = "/tmp"
xdebug.max_nesting_level = 200

最佳答案

node[:network][:interfaces][:eth1][:addresses].detect{|k,v| v[:family] == "inet" }.first

实际上,您可以通过登录VM(使用 vagrant ssh )并运行shef来查找所有节点属性。并在那里检查节点对象。

关于chef-infra - Vagrant : how to get hostonly ip address from within chef recipe?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14518236/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com