- Mastering Puppet 5
- Ryan Russell Yates Jason Southgate
- 119字
- 2021-07-16 17:46:16
Using the desc method to add inline documentation
Users of your new type can use the puppet describe and puppet doc commands to fetch the inline documentation you've configured. For a full description of all the types currently configured in your environment, including custom resources, run the following command:
$ puppet describe –list
Let's finish our type example now by adding some inline documentation using the desc method:
Puppet::Type.newtype(:mynewtype) do
ensurable
newparam(:override) do
desc 'whether or not to override'
defaultto :true
newvalues(:true, :false)
end
newproperty(:version) do
desc 'the version to use for mynewtype'
validate do |value|
fail("Invalid version") unless value =~
/^(\d+\.)?(\d+\.)?(\*|\d+)$/
end
end
newparam(:identifier) do
desc 'the identifier for mynewtype'
munge do |value|
Integer(value)
end
end
end
推薦閱讀
- 會聲會影 2018實用教程
- Altium Designer 21常見問題解答500例
- 車聯(lián)網(wǎng)
- Android底層開發(fā)技術實戰(zhàn)詳解
- TFT-LCD原理與設計
- 5G 空口特性與關鍵技術
- 無線通信中的空時與協(xié)作信號處理
- 移動基站設備與維護(第2版)
- 視頻精講:PADS 2007原理圖與布板設計典型實例
- 碳化硅功率器件:特性、測試和應用技術
- 液晶彩電開關電源速修圖解(第2版)
- 特高壓實踐:GIL綜合管廊的建設與維護
- 軟件創(chuàng)富密碼:iPhone應用程序開發(fā)攻略之iPhone特色傳感器應用
- RxJava反應式編程
- 移動互聯(lián)網(wǎng)異構接入與融合控制