官术网_书友最值得收藏!

Using the defaultfor method

The confine method is fine, but its usage may still result in multiple valid providers for a particular resource type. In this circumstance, the type should specify its preferred provider using the defaultfor method.

The defaultfor method uses a fact name and value as its arguments, which are then used to determine the default provider for certain types of underlying system.

For example, on Red Hat systems, both yum and rpm would be valid as providers to the package resource type, but the defaultfor method would be used to indicate that for Red Hat systems, yum is in fact the default provider, as shown in the following code:

Puppet::Type.type(:mynewtype).provide(:yum) do
...
confine :osfamily => :redhat
defaultfor: osfamily => :redhat
...
end
主站蜘蛛池模板: 本溪| 会同县| 安顺市| 诸城市| 深水埗区| 陕西省| 中山市| 石泉县| 和政县| 彭山县| 安福县| 宜都市| 玉树县| 小金县| 安丘市| 太康县| 抚宁县| 长岛县| 商城县| 泰和县| 涟源市| 东丽区| 石狮市| 普洱| 四会市| 天峻县| 茌平县| 留坝县| 石柱| 石嘴山市| 高雄市| 和龙市| 商丘市| 黄龙县| 建宁县| 巧家县| 蒙阴县| 德清县| 调兵山市| 蓬安县| 塔城市|