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

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.

主站蜘蛛池模板: 宕昌县| 宾川县| 资中县| 昔阳县| 沈阳市| 滁州市| 仪陇县| 漳州市| 丰镇市| 伊金霍洛旗| 偃师市| 原阳县| 忻州市| 东乡族自治县| 读书| 监利县| 长子县| 石屏县| 朝阳县| 曲松县| 启东市| 临泽县| 资溪县| 昌都县| 隆尧县| 高要市| 丰台区| 张家港市| 南江县| 应用必备| 洪泽县| 庐江县| 江西省| 什邡市| 黄浦区| 安图县| 北宁市| 苏尼特左旗| 罗山县| 云梦县| 潜江市|