Hacker News new | ask | show | jobs
by nicexe 1030 days ago
I'm thinking if invalid characters in the examples given would be an acceptable solution. For DNS records this could be XML-like tags like <someprefix>.<yourdomain>.<tld>

On one hand, it prevents blind copy-pasting but on the other hand, your example is invalid.

3 comments

For procedure documentation I often use ${service_namr:?} For similar reasons. If the variable isn't set you get a clear error. And it provides an easy way to use the template without modification.

It isn't perfect, common variable names may already be set or have been set in a previous execution of this playbook on a different problem. But it catches common issues while being convenient.

Yeah I think this is the only good solution, really. Otherwise it's just often unclear which things are required to have a specific value, and which things can be replaced. In this example, I'm sure plenty of people thought it was possible that "someprefix" was required, rather than just an example.
An invalid example could confuse the customer and create unnecessary support calls.