官术网_书友最值得收藏!

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
主站蜘蛛池模板: 平湖市| 台州市| 佛学| 镇安县| 饶平县| 荆州市| 新竹市| 二手房| 碌曲县| 德清县| 敖汉旗| 大悟县| 定安县| 郯城县| 靖安县| 霍山县| 高淳县| 通道| 乐至县| 谢通门县| 利津县| 灌云县| 临高县| 吉水县| 清水河县| 余江县| 浮山县| 渭南市| 资兴市| 栾川县| 澄江县| 凉山| 巴林左旗| 北安市| 临沂市| 长白| 巍山| 杭锦后旗| 尼勒克县| 修水县| 潞城市|