- Mastering Puppet 5
- Ryan Russell Yates Jason Southgate
- 210字
- 2021-07-16 17:46:07
Having a single point of entry to the module
init.pp should be the single entry point for the module. In this way, someone reviewing the documentation in particular, as well as the code in init.pp, can have a complete overview of the module's behavior.
If you've used encapsulation effectively and used descriptive class names, you can get a very good sense just by looking at init.pp of how the module actually manages the software.
Ideally, you can use your module with a simple include statement, as follows:
include mymodule
You can also use it with the use of a class declaration, as follows:
class {'mymodule':
myparam => false,
}
The Apache virtual directory style of configuring a number of defined types would be the third way to use your new module:
mymodule::mydefine {‘define1':
myotherparam => false,
}
The anti-pattern to this recommendation would be to have a number of classes other than init.pp and your defined types with parameters expecting to be set.
- 液晶和等離子體電視機(jī)原理與維修
- 通信工程設(shè)計(jì)與案例
- 天線測(cè)量實(shí)用手冊(cè)(第2版)
- 電子產(chǎn)品組裝技能演練
- 半導(dǎo)體光電子學(xué)
- 移動(dòng)互聯(lián)網(wǎng):原理、技術(shù)與應(yīng)用
- 微信小程序開(kāi)發(fā)與運(yùn)營(yíng)
- 電子工程師自學(xué)速成:設(shè)計(jì)篇(第2版)
- Untangle Network Security
- 集成電路靜態(tài)時(shí)序分析與建模
- 室內(nèi)定位理論、方法和應(yīng)用
- 如影隨形:無(wú)處不在的無(wú)線電波
- 短距離無(wú)線通信系統(tǒng)技術(shù)
- 數(shù)據(jù)虛擬化:多源異構(gòu)數(shù)據(jù)集成之道
- 目標(biāo)特性與傳感原理