Chef 食谱在另一本食谱中看不到被覆盖的属性

Chef cookbook not seeing overridden attributes in another cookbook

我有一个run_list这样的[ recipe["git_deploy"], recipe["my_role_cookbook"] ]
我在 my_role_cookbook 的 default.rb 配方中设置了 git_deploy 需要的属性。但是,git_deploy 没有获得这些属性。 如果我把 git_deploy 需要的属性放在 my_role_cookbook/attributes/default.rb 中,那么它就可以工作。如果我将延迟评估放在 git_deploy 中 - 它也可以工作。
我不明白为什么如果我在 my_rolecook_book/recipes/default.rb

中使用 node.override 它不起作用

大图:我有三个环境,在 my_role 的角色文件中,我有这样的 env_run_lists:

"production" => ["recipe[git_deploy]","recipe[my_role]"],
"staging" =>["recipe[git_deploy]","recipe[my_role]"],
"develop" => ["recipe[my_role]"]

编辑
在两本食谱中使用 debug_value 后:

attributes/* 中的所有文件在任何配方 运行 之前被合并和评估。由于您已将 git_deploy 放在 运行 列表的第一位,因此食谱 运行 在您的之前。您必须使用属性文件才能在 git 部署的配方之前注入您的属性,然后是您的配方 运行s。或者将 git_deploy 作为您食谱中的包含内容。

这是一个 link how attribute files work