本文介绍了Chef节点-检查配方是否将在其上运行,同时查看内部​​角色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确定某个特定配方是否将从另一个配方内部的节点上运行。我可以使用node.recipe?(recipe_name)方法,但是我的某些接收项由角色和配方管理吗?似乎没有考虑角色运行列表。

I want to find out if a specific recipe will be run on a node from inside a different recipe. I can node.recipe?(recipe_name) method, however some of my recipies are managed by roles and recipe? does not seem to look into the roles run list.

是否有一种简便的方法来确定我的recipie [redis]是否将在当前节点上运行?

Is there an easy way to find out if my recipie[redis] is going to be run on the current node?

推荐答案

您正在寻找食谱方法。注意尾随的 s !因此:

You're looking for the recipes method. Note the trailing s! So:

node.recipes.include?(recipe_name)

还请注意,有两种类似的角色检查方法。它们是角色角色。对于角色和配方,单数形式是直接分配给 的那些,复数是完全分解的集合。

Also note that there is a similar pair of methods for role inspection. Those are role and roles. For both roles and recipes, the singular form is for those directly assigned and the plural for the fully resolved set.

这篇关于Chef节点-检查配方是否将在其上运行,同时查看内部​​角色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:53