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

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.

主站蜘蛛池模板: 潍坊市| 镇平县| 图们市| 斗六市| 调兵山市| 永济市| 三河市| 秦安县| 南城县| 曲沃县| 柳林县| 手机| 衡南县| 佛山市| 荆州市| 泰州市| 尼勒克县| 南涧| 大姚县| 宜宾市| 肥东县| 喀喇沁旗| 彭山县| 东阳市| 永城市| 茂名市| 白朗县| 铅山县| 綦江县| 盐池县| 偏关县| 盐城市| 阜阳市| 浠水县| 广元市| 陇川县| 临潭县| 临汾市| 抚远县| 安宁市| 常德市|