- Mastering Puppet 5
- Ryan Russell Yates Jason Southgate
- 258字
- 2021-07-16 17:46:08
Using the new Puppet Development Kit commands
Some features to improve quality in your Puppet development, such as puppet-lint, puppet-rspec, and commands such as puppet module create have been around for some time, but previously, you had to discover these tools out there in the wild, install them, and figure out how to use them effectively yourself.
Puppet decided back in August 2017 to bring these things all together on the client side and make them a breeze to use with the new Puppet Development Kit version 1.0. I can certainly recall puppet-rspec always took some time to set up and get working correctly. Now it's all really easy.
Let's take a whistle-stop tour of the module development process using the new PDK 1.0.
- Creating the module framework and metadata: The pdk new module command runs in the same way as the old puppet module create command, as follows:
$ pdk new module zope –-skip-interview
- Creating the init.pp: There is now a set of creation commands for manifests inside modules, as follows:
- pdk new class (https://puppet.com/docs/pdk/1.0/pdk_reference.html#pdk-new-class-command)
- pdk new defined_type (https://puppet.com/docs/pdk/1.0/pdk_reference.html#pdk-new-definedtype-command)
- pdk new task (https://puppet.com/docs/pdk/1.0/pdk_reference.html#pdk-new-task-command)—see Chapter 6, Workflow, for more details on the new Puppet task functionality.
So, just use the name of the module to create init.pp:
$ pdk new class zope
These commands now negate any need for snippets in your text editor to create the comments, declarations, and other boilerplate code.
- Creating further classes: Create any further classes using the same command. See the following example:
$ pdk new class params
- 室內(nèi)分布系統(tǒng)規(guī)劃與設(shè)計(jì):GSM/TD-SCDMA/TD-LTE/WLAN
- 電子技術(shù)工程訓(xùn)練
- 零起點(diǎn)學(xué)音響與影碟機(jī)維修技術(shù)
- 印制電路組件裝焊工藝與技術(shù)
- 光纖通信(第4版)
- 液晶顯示器檢測(cè)與修理技能速訓(xùn)
- 光網(wǎng)絡(luò)信息傳輸技術(shù)
- 電子產(chǎn)品測(cè)試技術(shù)
- TD-SCDMA無(wú)線網(wǎng)絡(luò)創(chuàng)新技術(shù)與應(yīng)用
- 元器件檢測(cè)技能零基礎(chǔ)成長(zhǎng)
- 5G網(wǎng)絡(luò)深度覆蓋技術(shù)實(shí)戰(zhàn)進(jìn)階
- 移動(dòng)產(chǎn)品設(shè)計(jì)實(shí)戰(zhàn)寶典
- 光纖通信
- 無(wú)線秘籍:射頻電路設(shè)計(jì)入門(mén)
- 通信電源(第3版)