Support `append`, `prepend`, `remove`
Summary of the new feature / enhancement
For List type resources which are an array. There are use cases where the order matters in terms of how the underlying application applies them. sshd_config is one example for crypto algorithms. In that case, we need to allow the user to add to the list and set the order via append and prepend and also make sure the list excludes cretain values via remove.
Proposed technical implementation details (optional)
No response
My initial thinking is a canonical property called _listOperation which is an enum accepting prepend, append, remove. If not specified, the default is append. This means that only resources that have this canonical property indicate it supports the semantics. If the resource doesn't support this, then the expectation is that it is essentially _clobber=true
Would this work if a resource has more than one list style property? Does it apply to all or the first or do we specify which properties? What if one property need to be appended but another property is remove in the same resource instance
@ThomasNieto current guidance is that each list type property that needs ore than clobber would be an individual resource type. The alternative would be that list properties would themselves need a wrapper object and we currently don't want to go down that path.
Here's what I propose:
- for
remove, it's simply_exist = false - for
prependandappend, we have a new_listOperationwith enum valuesprependandappend. If not specified, it defaults toappend
More advance scenarios should just specify exactly what they want and the order they want and use _clobber = true
Since _exist, _listOperation, and _clobber are distinct, you could use any combination or all of them. It's up to the resource author to advertise which they support via their schema.
WG discussed this, we're going to defer this until a user/partner requires it. In the interim, configurations MUST specify the complete array.