voxpupuli/puppet-corosync

Disallowing 1-primitive groups in cs_group is pointless

Opened this issue · 11 comments

The validation check in https://github.com/puppet-community/puppet-corosync/blob/master/lib/puppet/type/cs_group.rb#L30 is overzealous. It is a perfectly valid use case to have groups with just 1 primitive. For example, you might want to define a set of 3, 2 or even just 1 resource that you then reference from a constraint. The easiest way to that is to use a group, and to always have the constraint point to the group. If there is only one primitive in the group, so be it.

The alternative is to have manifests full of ifs and unlesses to either point to a group or to a standalone primitive, and that's just silly.

For the stab I took at this that GitHub has duly cross-referenced, I of course forgot about Puppet's oh-so-smart single-element array munging as outlined in https://tickets.puppetlabs.com/browse/PUP-1299.

@fghaas are you interested in providing your patch as pull request?

@igalic, do you have a workaround for PUP-1299 that works pre-4.0?

no :(

Is this still an issue?

I believe so, yes.

closed by #368

Agreed. 👍

I'll leave this open for a time because I think I can produce a follow-up PR that saves a small amount of leg-work.

Hmm, this should have auto-closed when #368 was merged. After all there is a comment to that effect in bd4268e.

It looks like fixes is a valid keyword, while fixes issue is not. Sorry about that!

@fghaas regarding @ffrank's comment we will let this open

@ffrank, do you still want to produce a follow-up PR?