Puppet types with array property
I have never seen a concise example of how to make custom types with an array property work, do anyone have a good example of this?
At first you should specify
:array_matching => :all when defining your property. Otherwise only the first array element is considered as the
should value of your property. Another thing you may want to consider is to overwrite the
insync? method of your property. The default behaviour is that the current value and the desired value have to be the same. But if in your case the order of in which the elements appear does not matter, you can define your own. e.g.
newproperty(:allowed_hosts, :array_matching => :all) do def insync?(is) # The current value may be nil and we don't ...
Asked: 2013-09-06 20:16:38 -0500
Seen: 489 times
Last updated: Sep 08 '13