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

Summary

Classes and defined types are the essential tools to create reusable Puppet code. While classes hold resources that must not be repeated in a manifest, the define is capable of managing a distinct set of adapted resources upon every invocation. It does that by leveraging the parameter values it receives. While classes do support parameters as well, there are some caveats to bear in mind.

To use defined types in your manifest, you declare instances just like resources of native types. Classes are mainly used through the include statement, although there are alternatives such as the class { } syntax or the contain function.

There are also some ordering issues with classes that the contain function can help mitigate.

In theory, classes and defines suffice to build almost all the manifests that you will ever need. In practice, you will want to organize your code into larger structures. The next chapter will show you how to do exactly that, and introduce you to a whole range of useful functionality beyond it.

主站蜘蛛池模板: 额尔古纳市| 兴海县| 丁青县| 达州市| 淮南市| 乐山市| 夏邑县| 抚远县| 高清| 保山市| 美姑县| 巨野县| 唐海县| 蒲江县| 宁波市| 民勤县| 济南市| 邻水| 达拉特旗| 陇南市| 万年县| 博乐市| 奉新县| 台湾省| 禹州市| 商南县| 辽宁省| 武夷山市| 古浪县| 和田市| 卢湾区| 庐江县| 西藏| 兴和县| 黄浦区| 东港市| 太和县| 延寿县| 睢宁县| 崇文区| 彰化县|