this post was submitted on 14 Jan 2025
342 points (91.7% liked)

memes

10923 readers
3438 users here now

Community rules

1. Be civilNo trolling, bigotry or other insulting / annoying behaviour

2. No politicsThis is non-politics community. For political memes please go to [email protected]

3. No recent repostsCheck for reposts when posting a meme, you can only repost after 1 month

4. No botsNo bots without the express approval of the mods or the admins

5. No Spam/AdsNo advertisements or spam. This is an instance rule and the only way to live.

Sister communities

founded 2 years ago
MODERATORS
 
(page 2) 20 comments
sorted by: hot top controversial new old
[–] [email protected] 16 points 16 hours ago (11 children)
load more comments (11 replies)
[–] [email protected] 45 points 17 hours ago* (last edited 17 hours ago) (4 children)

"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] 12 points 16 hours ago (2 children)

Jist wait until you have to start fucking around with multiple incompatible versions of python for different targets.

[–] [email protected] 4 points 16 hours ago (2 children)

Because group or host vars are hard?

load more comments (2 replies)
load more comments (1 replies)
load more comments (3 replies)
[–] [email protected] 16 points 19 hours ago* (last edited 19 hours ago) (1 children)

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.

edit: tbh my biggest issue with Ansible is other people who ask me "why not wrtie a bash script instead?"

[–] [email protected] 7 points 18 hours ago

Finally, KISS enforced software

[–] [email protected] 7 points 20 hours ago (1 children)

I finally understand Ansible.

[–] [email protected] 6 points 20 hours ago

WASTHATSOFUCKINGHARD?!?!!

[–] [email protected] 72 points 21 hours ago (2 children)

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] 1 points 16 hours ago (2 children)

That's what ansible-lint is for.

load more comments (2 replies)
[–] [email protected] 33 points 20 hours ago (1 children)

The scandinavian country codes, as understood by yaml:

  • se
  • false
  • dk
[–] [email protected] 9 points 17 hours ago (4 children)

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.

load more comments (4 replies)
[–] [email protected] 5 points 21 hours ago* (last edited 21 hours ago)

Also completely parses your whole goddamn secrets file multiple times per run, so if you need to change a single server, make sure you have time.

[–] [email protected] 58 points 21 hours ago (5 children)

uses yaml for scripting so it's clean and readable.

Eh....

I guess yaml is fine.
I hate the significance of whitespace, and the fact that I cannot find any editor that can auto-format. Which are both related, I guess: there is no way to know a yaml document is actually correctly formatted without knowing the intended schema.

Whereas JSON doesn't have this ambiguity. But JSON has it's own drawbacks.

[–] [email protected] 25 points 20 hours ago (3 children)

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.

[–] [email protected] 2 points 17 hours ago

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.

load more comments (2 replies)
[–] [email protected] 26 points 20 hours ago* (last edited 20 hours ago) (1 children)

I kinda like YAML for simple configuration files, but the YAML spec is borderline insane.

https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-from-hell

And don't get me started with ansible, it never works the way I think it should and almost every playbook or role I write is a pain to get right. When it works, it's a really nice tool and I couldn't manage my homelab as efficiently without Ansible, but it frustrated the hell out of me way too often.

[–] [email protected] 3 points 17 hours ago (1 children)

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.

load more comments (1 replies)
[–] [email protected] -4 points 21 hours ago (1 children)
[–] [email protected] 3 points 17 hours ago (2 children)

XML is extremely verbose.
Again, requires some other tooling to generate (I feel I can point to JavaScript for an example of XML manipulation)

load more comments (2 replies)
load more comments (2 replies)
load more comments
view more: ‹ prev next ›