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

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
主站蜘蛛池模板: 怀仁县| 新蔡县| 都江堰市| 澎湖县| 博湖县| 竹溪县| 西青区| 曲麻莱县| 安龙县| 昌江| 蓝山县| 土默特左旗| 同心县| 凤台县| 巨鹿县| 唐河县| 民丰县| 保亭| 望都县| 苏尼特左旗| 巴塘县| 花莲市| 浪卡子县| 清河县| 长子县| 和林格尔县| 望奎县| 七台河市| 苏尼特左旗| 奈曼旗| 探索| 新营市| 和硕县| 南木林县| 鲁甸县| 新龙县| 孟津县| 保德县| 石阡县| 二连浩特市| 康乐县|