3 ms·
YAML is far easier for humans, and has a few advanced features (node references) that are REALLY nice for any kind of configuration, since you can re-use blocks
by RangerScience 8y ago
YAML is far easier for humans, and has a few advanced features (node references) that are REALLY nice for any kind of configuration, since you can re-use blocks.
Let's say you have to define a bunch of services, with mostly the same environment variables. You can make a "defaults" node, and then a) reference that node in the service descriptions to re-use those env vars, and b) selectively override those defaults in the service description's node while leaving the rest of the defaults untouched. It's really nice.
- sbr464 8y agoThat's good to know, thanks for that tip. I've been using secrets with Kubernetes for sharing things currently, but only in small cases.
- RangerScience 8y agoIt's super useful. There's a way to reference a node that just places that node as a child, whole cloth, and another way that merges the node reference with the local node. This is useful, say, if you're actually de/serializing objects and want to maintain actual references, or if you're just trying to share data between nodes.
- crooked-v 8y agoYAML is bad because it has far too much magic behavior. See, for example, Ansible's big list of gotchas: https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html https://docs.ansible.com/ansible/latest/reference_appendices...