The feature proposal below is placed here for discussion, feedback, and reactions to the proposal and suggested solution.
So that later when Puppet is is making changes to a system, I can easily look up who, what, and why.
As a Puppet content developer,
I want to attach ownership information to resources,
So my team can be identified and alerted if Puppet has a problem applying my resources.
As a change deployment approver,
When reviewing changes made in a lower-tier environment to decide if it's ok to promote,
I want to consume a high-level summation for the meaning of changes applied to a system,
So I can quickly get a sense of what's being done,
Without needing to read low-level Puppet implementation code.
As a customer receiving a Puppet-managed server as a service,
I want to review a human-readable list of all “stuff” managed by Puppet on my system,
So I can have some understanding of what Puppet is doing.
Currently, we don't have a way to attach any kind of self-documenting information to Puppet content, or produce dynamic reports about what Puppet is doing on a target system based on documentation or annotations written for human consumption.
Further, while we have puppet-strings to create self-documenting code, we don't have any tooling to create self-documenting catalogs or reports—these being examples of artifact outputs produced by the potentially documented code.
Feature Request
Provide a solve for use case #1 above, in support of the rest of the use cases.
Suggested Solution
A simple way to solve for this would be to add a new, non-operative metaparam, "metadata". As a metaparam, "metadata" would be available to specify on any Puppet resource or class. Because it is non-operative and for reporting purposes only, the addition of the metaparam would by itself constitute foundational delivery of this feature. Metaparameters are present in catalogs and queryable from PuppetDB for building reports already; the only thing missing is a hook to hang this sort of data on to begin with.
The metadata metaparam could be built on by later PE features to produce polished reports, but would not depend on such a thing to deliver value today.
Example usage:
notify { 'example':
message => 'this is a notify resource',
metadata => 'this is some metadata, a description, about it',
}
file { '/tmp/example.conf':
ensure => file,
owner => 'root',
metadata => {
'description' => 'Metadata does not need to be a string',
'product' => 'Example Product',
'owner' => 'Kelly',
},
}
What about tags?
Tags have two characteristics that make them unsuitable to fully address these use cases.
- Tags cannot contain text written for human consumption, such as descriptions or text-form comments, due to not allowing spaces and other special characters.
- Tags propagate. Especially for long-form comments, it may be desirable NOT to propagate them, as duplication and accidental scope escape can be undesirable.
For some use cases the propagation feature of tags may make them more desirable than using metadata. Metadata would be different enough that a meaningful decision could be made about which to use for a given purpose.
Compatibility considerations
As far as I can tell, there are no concerns with regards to backwards compatibility. If an existing class or type already uses a parameter called "metadata", that will mask/override a metaparam by the same name.
Probable Implementation Difficulty: trivial
Improper diff to demonstrate:
Initial discussion is best suited for the mailing list. This thread is now open for feedback and discussion. After any initial discussion, updates will be made to the ticket.