- 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.
- 5G商用:打造高速智能應(yīng)用場(chǎng)景
- 中文版Premiere Pro CC 2018基礎(chǔ)培訓(xùn)教程(全彩版)
- 通信專業(yè)綜合能力與實(shí)務(wù):終端與業(yè)務(wù)
- 現(xiàn)代交換技術(shù)實(shí)用教程
- 光接入網(wǎng)實(shí)用技術(shù)
- 5G標(biāo)準(zhǔn)之網(wǎng)絡(luò)架構(gòu):構(gòu)建萬(wàn)物互聯(lián)的智能世界(5G新技術(shù)叢書)
- 目標(biāo)特性與傳感原理
- 雷達(dá)數(shù)據(jù)處理及應(yīng)用
- 數(shù)字視頻創(chuàng)意設(shè)計(jì)與實(shí)現(xiàn)(第二版)
- GPRS網(wǎng)絡(luò)信令實(shí)例詳解
- 應(yīng)用電工電子技術(shù)(上冊(cè))
- Android移動(dòng)應(yīng)用開發(fā)項(xiàng)目教程
- 電子元器件檢測(cè)與應(yīng)用
- Wireshark網(wǎng)絡(luò)分析的藝術(shù)
- 中老年人輕松玩轉(zhuǎn)智能手機(jī)