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

Following the class-naming conventions

There's a certain class-naming convention that has developed over time within the Puppet community, and it's really worth taking these into account when structuring your classes:

  • init.pp: init.pp contains the class named the same as the module, and is the main entry point for the module.
  • params.pp: The params.pp pattern (more on this later in the chapter) is an elegant little hack, taking advantage of Puppet's class inheritance behavior. Any of the other classes in the module inherit from the params class, so have their parameters set appropriately.
  • install.pp: The resources related to installing the software should be placed in an install class. The install class must be named <modulename>::install and must be located in the install.pp file.
  • config.pp: The resources related to configuring the installed software should be placed in a config class. The config class must be named <modulename>::config and must be located in the config.pp file.
  • service.pp: The resources related to managing the service for the software should be placed in a service class. The service class must be named <modulename>::service and must be located in the service.pp file.

For software that is configured in a client/server style, see the following:

  • <modulename>::client::install and <modulename>::server::install would be the class names for the install.pp file placed in the client and server directories accordingly
  • <modulename>::client::config and <modulename>::server::install would be the class names for the config.pp file placed in the client and server directories accordingly
  • <modulename>::client::service and <modulename>::server::service would be the class names for the service.pp files placed in the client and server directories accordingly
主站蜘蛛池模板: 蛟河市| 南宁市| 谢通门县| 泸州市| 吉首市| 共和县| 孙吴县| 台湾省| 新泰市| 西乌| 揭阳市| 丹阳市| 普宁市| 永清县| 福泉市| 临朐县| 乐清市| 蕉岭县| 桐乡市| 富平县| 忻城县| 灵武市| 林芝县| 土默特左旗| 同仁县| 嘉鱼县| 茌平县| 澄江县| 安国市| 邯郸县| 张北县| 启东市| 南召县| 马鞍山市| 乐平市| 怀来县| 卓资县| 牡丹江市| 白水县| 雅安市| 东乡县|