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

  • Mastering Puppet 5
  • Ryan Russell Yates Jason Southgate
  • 127字
  • 2021-07-16 17:46:16

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.

主站蜘蛛池模板: 弥渡县| 三门峡市| 黄浦区| 康保县| 邛崃市| 寿光市| 蒙自县| 秦安县| 岐山县| 宁夏| 蓝田县| 伊金霍洛旗| 泾川县| 广德县| 双流县| 郎溪县| 沭阳县| 三原县| 邢台市| 郓城县| 阜新市| 禹州市| 沅陵县| 延川县| 长岛县| 盘山县| 绥棱县| 襄垣县| 阳西县| 广河县| 长泰县| 九龙城区| 定兴县| 河间市| 太白县| 大足县| 夏河县| 巴南区| 海伦市| 潜山县| 会东县|