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

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.

主站蜘蛛池模板: 调兵山市| 富顺县| 江油市| 襄汾县| 望奎县| 东方市| 五峰| 介休市| 遂川县| 济源市| 晋州市| 平定县| 含山县| 武平县| 湘阴县| 安溪县| 鹤岗市| 郑州市| 竹溪县| 龙南县| 灌阳县| 浦县| 永新县| 土默特右旗| 长海县| 油尖旺区| 锡林郭勒盟| 类乌齐县| 武平县| 蒲江县| 巴彦淖尔市| 余庆县| 手机| 甘南县| 湘西| 尉氏县| 昂仁县| 怀柔区| 宁都县| 乐业县| 江北区|