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

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.

主站蜘蛛池模板: 汉源县| 嵊泗县| 茶陵县| 花莲市| 普兰店市| 新密市| 菏泽市| 二连浩特市| 东平县| 崇州市| 赣州市| 虹口区| 南投县| 德庆县| 东阳市| 灵宝市| 伊金霍洛旗| 读书| 成武县| 霍城县| 太康县| 海晏县| 吴江市| 靖西县| 泾阳县| 定南县| 屏南县| 洪雅县| 日土县| 成安县| 长寿区| 霸州市| 仙桃市| 邹平县| 临清市| 芜湖县| 武宁县| 土默特左旗| 绍兴市| 蕲春县| 莱州市|