- Mastering Puppet 5
- Ryan Russell Yates Jason Southgate
- 122字
- 2021-07-16 17:46:15
Adding the optional ensure property
Although optional, most native Puppet resource types do have an ensure property, although there are exceptions—for example, . exec and notify. You simply give the resource type the ensure property by immediately calling ensurable:
Puppet::Type.newtype(:mynewtype) do
ensurable
...
end
The corresponding providers for this type would then implement the ensure property through the use of create, exists?, and destroy methods.
In Puppet DSL, the ensure property should be the first attribute in the resource (according to the Puppet style guidelines), and it supports the present and absent keywords (present being the default, so it may be omitted for the sake of brevity), as shown in the following code:
mynewtype { 'foo':
ensure => absent,
}
推薦閱讀
- 室內(nèi)分布系統(tǒng)規(guī)劃與設(shè)計(jì):GSM/TD-SCDMA/TD-LTE/WLAN
- 高通量衛(wèi)星技術(shù)與應(yīng)用
- 3D教育藍(lán)皮書
- 通信網(wǎng)技術(shù)基礎(chǔ)
- 交換機(jī)/路由器及其配置
- 高速數(shù)字電路設(shè)計(jì)入門
- 實(shí)戰(zhàn)無(wú)線通信應(yīng)知應(yīng)會(huì):新手入門,老手溫故(第二版)
- 電子工藝實(shí)習(xí)
- iOS 7開發(fā)快速入門
- 一本書讀懂5G
- 通信工程監(jiān)理實(shí)務(wù)
- 巧學(xué)巧用電子元器件實(shí)用技術(shù)
- 數(shù)字音頻原理與檢測(cè)技術(shù)
- 現(xiàn)代移動(dòng)通信(第5版)
- 基于Kotlin的Android應(yīng)用程序開發(fā)