- Mastering Puppet 5
- Ryan Russell Yates Jason Southgate
- 258字
- 2021-07-16 17:46:07
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
推薦閱讀
- 數(shù)據(jù)通信:路由與交換技術(shù)
- 中壓電纜全壽命周期典型缺陷圖集
- 5G承載網(wǎng)絡(luò)運維(初級)
- 基于FBMC/OQAM的海上無線通信技術(shù)
- 室內(nèi)定位理論、方法和應(yīng)用
- 現(xiàn)代交換技術(shù)實用教程
- 混沌同步控制方法及在保密通信中的應(yīng)用
- 液晶彩電易損電路上門維修速查手冊
- 短距離無線通信系統(tǒng)技術(shù)
- 圖表細說電路回路法識圖
- 大數(shù)據(jù),我要把你變成錢(《商業(yè)評論》MIT斯隆管理評論精選)
- 現(xiàn)代通信工程制圖與概預算
- 數(shù)字邏輯電路與系統(tǒng)設(shè)計
- 通信專業(yè)實務(wù):傳輸與接入(無線)
- 高可靠性電子產(chǎn)品工藝設(shè)計及案例分析