Keep it simple
-
[email protected]replied to [email protected] last edited by
Anyone that says yaml is readable is psychotic. It's literally objectively not readable because a random white space character can break the entire thing and that's by definition not readable I can't see whether there's a white space or not without explicitly setting that up in an editor
-
[email protected]replied to [email protected] last edited by
XML master race
-
[email protected]replied to [email protected] last edited by
The scandinavian country codes, as understood by yaml:
- se
- false
- dk
-
[email protected]replied to [email protected] last edited by
I kinda like YAML for simple configuration files, but the YAML spec is borderline insane.
The yaml document from hell
As a data format, yaml is extremely complicated and it has many footguns. In this post I explain some of those pitfalls by means of an example, and I suggest a few simpler and safer yaml alternatives.
(ruudvanasseldonk.com)
-
[email protected]replied to [email protected] last edited by
I finally understand Ansible.
-
[email protected]replied to [email protected] last edited by
YAML is fine as a configuration language and ok data input language.
YAML is absolutely cursed as a programming language. As in Ansible has created a really shitty programming language inside of YAML. Should be burned with fire.
-
WASTHATSOFUCKINGHARD?!?!!
-
[email protected]replied to [email protected] last edited by
I've been using Ansible for almost 10 years now and one thing I learned is to keep things simple, most issues I had with Ansible in the past were due to me taking the wrong approach to problem solving. In way, it forced me to not overcomplicate things.
I'm not the biggest fan of it, but I do prefer it over other IaCs
-
[email protected]replied to [email protected] last edited by
Finally, KISS enforced software
-
[email protected]replied to [email protected] last edited by
"Keep it simple" says the project that decided it would be great to program in YAML...
I've tried using it to manage a few home servers and parameterizing anything was painful and boilerplate-ridden
-
[email protected]replied to [email protected] last edited by
I guess it's like HTML if it tried to also adopt it's own scripting language. Whereas JS interacts with the HTML DOM. Sure, it has quirks, but essentially modified a config.
I've never found a nice way writing YAML with variables and configurability.
Trying to use yaml to natively describe how a yaml config should be produced is broken. It diverges from the underlying schema, and (because it's.yaml
) isn't distinguishable from any other yaml.
Things like helm treat yaml as a template. And I don't think language servers & tooling are up to scratch yet (happy to be corrected). So basic yaml formatters shit the bed.Yaml is a computer readable config file that tries to be human readable, and fails at being actually useful.
Why projects try and make it useful, I will never understand.
I honestly think generating yaml from something like python would be a million times easier.
But then tools like ansible adopt yaml to essentially be a scripting language. As opposed to creating an actually decent solution that uses both python (to generate) and yaml (to apply).
Or whatever language. -
[email protected]replied to [email protected] last edited by
Only 1.1. Which everybody has been fiercely clinging onto since 2009, because YAML 1.2 did not seem to consider it a problem that they broke backwards compatibility on that behavior. So now the only way to keep existing YAML files working is for us all to keep pretending YAML 1.2 does not exist.
-
[email protected]replied to [email protected] last edited by
I feel I spend more time iterating yaml.
There isn't any tooling that actually helps you write it.I feel like there is a gap in the market for a solution that uses typescript, typed python or some other type-able scripting language, which then generates the yaml files.
A language that has language servers, intellisense, all the modern dev tools. Schemas are provided as simple type descriptors. And whatever script you write then produces the correct result.
Some sort of framework on top of that to provide an opinionated workflow, and some tooling to lint/validate/produce.
And the result is yaml files which can be checked/diffed against in-place config, and version controlled for consistency. -
[email protected]replied to [email protected] last edited by
XML is extremely verbose.
Again, requires some other tooling to generate (I feel I can point to JavaScript for an example of XML manipulation) -
Jist wait until you have to start fucking around with multiple incompatible versions of python for different targets.
-
[email protected]replied to [email protected] last edited by
Hello? Its me, NixOS.
-
Because group or host vars are hard?
-
[email protected]replied to [email protected] last edited by
That's what ansible-lint is for.
-
[email protected]replied to [email protected] last edited by
Reminds me of AutoHotkey
-
[email protected]replied to [email protected] last edited by
You mean like ansible-lint or yaml-lint?