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

Using autorequire for implicit relationships

To make it easier for users of your type, you can use autorequire  to avoid tediously specifying a lot of explicit relationships in longhand between resources. The autorequire method establishes implicit ordering between resources in the catalog. A typical example of this would be filing resources depending on their parent directories.

For example, in our type, if the source parameter is a file path, then we should ensure the corresponding file resource is managed first, as shown in the following code:

Puppet::Type.newtype(:mynewtype) do
...
autorequire(:file) do
self[:source]
end
...
end

Manually specified dependencies in the Puppet DSL have a higher precedence for the compiler than the implicit dependencies that are put in place by virtue of the autorequire method.

主站蜘蛛池模板: 东乡县| 元江| 乌苏市| 威海市| 旌德县| 石楼县| 泸州市| 泰顺县| 祁连县| 光泽县| 金塔县| 乐昌市| 伊宁县| 宿州市| 克拉玛依市| 武平县| 东源县| 牙克石市| 龙门县| 阿克| 玉屏| 满洲里市| 绥滨县| 白河县| 锦州市| 南雄市| 九龙坡区| 木里| 石屏县| 陇南市| 淮南市| 罗山县| 遂川县| 阜新市| 泾阳县| 夏邑县| 商河县| 会同县| 新乡市| 洞口县| 岳西县|