【问题标题】:Chef Opscode Using Value of Attribute in libraries fileChef Opscode 使用库文件中的属性值
【发布时间】:2019-02-02 03:01:52
【问题描述】:

我必须在我的食谱的属性文件中获取 dnsdomainname 值。有什么可能的方法吗?我什至可以在我的库文件中从 OHAI 获取值吗?

【问题讨论】:

  • 在属性文件或库文件中?因为你提到了两者。

标签: templates attributes chef-infra libraries cookbook


【解决方案1】:

在属性文件node['domainname'] 中。在库文件中,很大程度上取决于代码的工作位置和方式,但通常是Chef.node['domainname']

您也可以随时运行 ohai | less 以查看 Ohai 提供的数据。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-04-14
    • 2012-04-04
    • 1970-01-01
    • 2014-05-15
    • 2019-06-07
    • 2014-06-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多