简体   繁体   English

厨师/刀引导json属性的优先顺序是什么

[英]what is the precedence for chef/knife bootstrap json attributes

The documentation for Chef attribute precedence is here: https://docs.getchef.com/chef_overview_attributes.html Chef属性优先级的文档在这里: https : //docs.getchef.com/chef_overview_attributes.html

However, the docs don't really explain what level is applied to attributes that are passed in via the -j flag for the knife bootstrap command. 但是,文档并没有真正说明对刀引导命令通过-j标志传递的属性应用什么级别。

The reason why I'm asking is because I'm passing in attributes and some of those attributes aren't being applied correctly to my run. 我问的原因是因为我传递了属性,但其中一些属性未正确应用于我的跑步。

通过-j传递的东西被设置为节点数据,这是normal / set级别。

As @coderanger pointed out, they should be at the set level if you are formatting your json correctly. 正如@coderanger指出的,如果您正确格式化json,它们应该处于set级别。 If your Json isn't formatted correctly, it won't set the values at all, but may not give you an error. 如果您的Json格式不正确,则根本不会设置这些值,但可能不会给您带来错误。

For troubleshooting, you can use node.debug_value to see the whole attribute tree. 为了进行故障排除,您可以使用node.debug_value查看整个属性树。

Or if you want a shortcut, use the spicerack cookbook's print_attribute_debug recipe to grab it and print it. 或者,如果您需要快捷方式,请使用spicerack食谱的 print_attribute_debug配方来抓取并打印。 The cookbook as a whole is still really immature, but the README gives the usage details and it's plenty good for debugging purposes. 整个菜谱还真的很不成熟,但是自述文件提供了用法的详细信息,并且对于调试目的来说非常有用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM