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

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.

主站蜘蛛池模板: 高清| 吉水县| 宜黄县| 昌乐县| 三江| 伊宁县| 固始县| 惠水县| 汝州市| 阳江市| 玛纳斯县| 苏州市| 青岛市| 河南省| 太康县| 齐河县| 南投县| 兴和县| 淮北市| 金门县| 和平区| 敦化市| 梁平县| 临澧县| 德庆县| 商水县| 饶河县| 宽甸| 清苑县| 台前县| 金寨县| 长治市| 闽侯县| 扎赉特旗| 临城县| 华安县| 兰州市| 奉新县| 西和县| 建湖县| 西乡县|