this post was submitted on 10 May 2024
106 points (98.2% liked)
linuxmemes
21272 readers
550 users here now
Hint: :q!
Sister communities:
Community rules (click to expand)
1. Follow the site-wide rules
- Instance-wide TOS: https://legal.lemmy.world/tos/
- Lemmy code of conduct: https://join-lemmy.org/docs/code_of_conduct.html
2. Be civil
- Understand the difference between a joke and an insult.
- Do not harrass or attack members of the community for any reason.
- Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
- Bigotry will not be tolerated.
- These rules are somewhat loosened when the subject is a public figure. Still, do not attack their person or incite harrassment.
3. Post Linux-related content
- Including Unix and BSD.
- Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of
sudo
in Windows.
- No porn. Even if you watch it on a Linux machine.
4. No recent reposts
- Everybody uses Arch btw, can't quit Vim, and wants to interject for a moment. You can stop now.
Please report posts and comments that break these rules!
founded 1 year ago
MODERATORS
Exactly, ansible is basically imperative, where write the steps declaratively.
Whereas nixos is more like a compiler that compiles to a working linux install.
If I added the software
myprogram
and a config file at/etc/myprogram.conf
, that’s pretty easy in both. But if I needed to to then remove those it gets different .With nixos it’s at easy as removing the two lines that add the program and the config file; after the next “compile”, the file is gone and
myprogram
is no longer available in the PATH.With ansible you need to change the relevant step to use
apt remove
instead ofapt install
and to change the config file step in a step that removes the file.Don’t get me wrong, ansible is still better than writing a lot of bash scripts, especially if you don’t have people with a lot of shell experience.
But tools like nixos and guix are on a whole other level.
Wait until you have 2 services that use the same resource. Now you need:
Doing this with Ansible is a nightmare. And 99% of the time you don't even realize that you have this problem until your configs don't work for some reason.
Yeah, ansible is just full of these scenarios. Even in the best of times it demands an awful amount of verbosity.
Half the time I see people land with no more idempotency than they had before, which is supposed to be one of the big draws. A lot of the things they are frontending are inherently idempotent, and a lot of other times the modules themselves fail to be safe to run multiple times for the admins input. I've been shocked how fragile some modules have been given its regard in the industry.