On Wednesday, January 13, 2016 at 2:08:52 AM UTC-6, Quaternaire wrote:
>
> This way it's not possible to have *inherit B => true*, and *inherit C =>
> false*. It's none or all, where we should be able to choose inheritance
> per project.
>
> On Tuesday, January 12, 2016 at 6:37:55 PM UTC+1, Peter Kristolaitis wrote:
>>
>> Why not just use arrays for the parent attribute?
>>
>> project { 'Z':
>> ensure => present,
>> parent => [ 'B', 'C' ],
>> inherit => false,
>> }
>>
>>
It's not entirely clear to me why you want to manage the contents of a
Mantis database as system *configuration*, but Puppet is flexible enough to
do it.
Your problem springs largely from the fact that your parent / child
relationships have more state than just their presence or absence. You
need a way to convey that state. You already know that you can do it via
separate resources. If you want to do it all within the Project resource,
then you'll need to use one or more attributes with complex data type.
There are all manner of specific ways you could go here, including the one
you proposed, but I would advise you to have children declare who their
parents are, instead of having parents declare who their children are. For
example, you might support a form like this:
project { 'C':
ensure => present,
parent => { 'A' => { 'inherit' => true }, 'B' => { 'inherit' => false } }
}
As for validating the contents of the hash-valued attributes, that's just
par for the course. With more complex data comes more complex requirements
for validation. Use the validation hook in your custom type to engage
whatever validation is appropriate.
John
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/aa92f34e-aa4b-4981-8385-67a84d99bf84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.