3 ms·
Things like AWS Cloudformation require YAML input, so there's no real choice on what you emit. But writing the YAML is fiddly and annoying, so that's a good ex
by stevekemp 6y ago
Things like AWS Cloudformation require YAML input, so there's no real choice on what you emit.
But writing the YAML is fiddly and annoying, so that's a good example of something where it is better to generate it via troposphere (a python module) or some similar system.
To be less specific I guess the answer is that sometimes you don't control both ends - the part that emits and the part that consumes, and having faught ansible, and similar tools, if I can avoid it I'd never want to write YAML by hand for non-trivial purposes if I could script it instead.
- noctune 6y agoJust write JSON and pretend it's YAML. YAML is a superset of JSON so there's no need to generate "nice" YAML if there isn't a human reading or writing it.
- throwaway894345 6y agoIt’s still good for humans to be able to debug it, and there’s no downside to generating YAML over JSON (I say this as someone who typically prefers JSON).