top | item 33414338

A configuration management system for computers that are pets, not cattle

193 points| mmcclure | 3 years ago |github.com | reply

90 comments

order
[+] throwamon|3 years ago|reply
I might just be biased by selective attention, but it seems like more and more of these are popping up lately.

I feel like we will eventually recognize a variant of Greenspun's Tenth Rule as common wisdom:

> Any sufficiently complicated build system or configuration management system contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of Nix.

(Although to be honest it might make more sense to replace "Nix" with "Guix"...)

[+] travisgriggs|3 years ago|reply
I think it’s a cyclic pendulum sort of thing. We crave the networking/herding effect. So we promote a bandwagon, and try to get everyone on the same. We get there and realize we’ve turned a trip to Starbucks into an Artemis launch. Frustrated that we’ve rediscovered you can’t please all the people all of the time, we race back to individual tooling, each doing one task and one task well, factionalized and repeated in hundreds of tribes. It’s lonely at this extreme and we crave the networking/herding… coda.
[+] ximm|3 years ago|reply
I tend to think about it differently: Some ideas get reinvented and simplified until only the idea is left. And the idea then seems so obvious to everyone that no one considers it necessary to have a reusable implementation. That isn't the same as NIH. It is sharing ideas rather than code.
[+] blowski|3 years ago|reply
Perhaps the belt-tightening going at the moment has made people realise how much money they're wasting on Kubernetes et al.
[+] whalesalad|3 years ago|reply
was going to say the same thing - but for ansible.

an inventory file is literally a static list of pets in its simplest form, and with some simple convention you could have a directory per-host with any playbooks required. plus you have docs, community modules, etc.

[+] erebeee|3 years ago|reply
Shameless plug but here how I manage my personal servers with K3s (kubernetes) https://news.ycombinator.com/item?id=33406938

I stopped using configuration management a while ago for my servers because they are too complex and fragile for a sporadic usage. My main issue is that you need to use them daily in order to keep them working and for you to keep muscle memory.

For a time I tried to restrict myself to only Debian package, but with the time I felt like it was too restrictive, and not enough flexible.

I also tried Nix and really liked it, but my main issue was me having to google every time I wanted to make a change due to config file/package being awful to write/remember.

Maybe you will take a different path, but for personal usage, configuration management is really a waste of time imho, the frequency at which you will touch files will be low, and your tool/setup will become outdated before you realize it. And nowaday everything run inside a container, so you will have to adapt your tool to manage docker/podman/docker-compose at some point

[+] Izkata|3 years ago|reply
> I also tried Nix and really liked it, but my main issue was me having to google every time I wanted to make a change due to config file/package being awful to write/remember.

I just use it package-management-style with "nix-env" instead of using the whole configuration language. Pretty simple and easy to remember.

[+] matai_kolila|3 years ago|reply
I dunno, I just feel like in my time playing pretend DevOps, I've just ended up learning how to use Terraform/Puppet/Ansible/whatever and now all of my infra actually is cattle, even though I think 9 out of 10 devs in my shoes would have gone the pets route.

It was some extra work to set up, but now I feel supremely confident in the hardiness of the infra, and can scale it at will with some small tweaks.

Is it perfect? Heck no! But I know for a fact when I go the "pets" route it ends up being more work in the end for me than just biting the bullet and learning a new tool.

I just like knowing stuff! I enjoy diving in and getting my hands dirty learning the "best" way to handle a use case, or at least setting things up to be well understood if I ever have to pass it off to someone else more qualified than me.

[+] notyourday|3 years ago|reply
In reality there are three classes of systems:

* pets

* cattle

* betsy[0][1]

The problem is that configuration management systems think everything is either cattle or pets.

[0] Betsy is a special cow. She will also be slaughtered, so she is not a pet, but she needs to be taken care of in a special way, so she is not a cattle.

[1] When the herd becomes large, you get joahna. joahna is like betsy, but not exactly like betsy so she needs a care and feeding slightly different than the betsys.

[+] freedinosaur|3 years ago|reply
This seems more approachable than NixOS/Guix, which I see as state or the art for declarative hosts.

https://discourse.nixos.org/t/documentation-team-flattening-... aims to flatten the learning curve for NixOS.

[+] 1MachineElf|3 years ago|reply
I love the concepts behind NixOS as well as Guix. I've tinkered with both, and Nix has served the daily driver role for multiple computers of mine.

One advantage this has over Nix is a simpler build toolchain. For some, that advantage may be quite useful. Even more so for the sh-based configuration management tool, rest[0], submitted several days ago.

While Guix is similar to Nix in it's higher amount of build dependencies, in theory, Guix's bootstrapping is at least elegant in comparison.

[0] https://news.ycombinator.com/item?id=33387081

[+] dfee|3 years ago|reply
I’ve been reading the pills (tutorials) and it’s actually been pretty nice. You just have to realize it’s more complicated than mapping JSON <> YAML.

https://nixos.org/guides/nix-pills/

[+] lamontcg|3 years ago|reply
> The idea behind Pets is that Configuration Management of individual hosts shouldn’t be harder than administering the system by hand.

Just administer it by hand and back it up.

[+] pmontra|3 years ago|reply
It's about what I'm thinking to do with my Odroid running from a microSD card. dd the microsd to another one and swap it when it will inevitably fail, more sooner than later. The only problem is that I don't want to pull the card off and copy it periodically or after an apt update. I'm storing configs in git but restoring them is a tedious task. Maybe Pets can help me. Or rsnapshot as on my laptop.
[+] JamesSwift|3 years ago|reply
If people were good about doing it by hand and keeping track of what was done to the box, and ensuring that changes only happen via the documented pipeline, then we wouldn't have a cottage industry of configuration management tools. Maybe you are an outlier and are able to keep good notes, but I think its obvious that the general population is not diligent enough.
[+] djrobstep|3 years ago|reply
Very unhealthy attitude. Why shouldn’t things be easily configurable from scratch?
[+] xylon|3 years ago|reply
but then you dont have visibility of what changes you have made. having config management improves visibility of how something is configured
[+] wkdneidbwf|3 years ago|reply
give me this for mac os please. my home-rolled dotfiles repo is ok, but id really love some config management system that’s not ansible that i could use to bootstrap my workstations.

i used to write a lot of chef and generally like ruby, but i can’t make heads or tails of whatever progress chef is. mostly seems like chef as an oss tool is dead.

anybody got something else they like to configure their mac os systems with?

[+] CGamesPlay|3 years ago|reply
Ansible is a little heavyweight for what you want, but if you wrap it in a script and only use the built-in modules, it's probably got everything you need.

Here's the wrapper script:

  ansible-playbook -i localhost, --connection=local playbook.yml "$@"
You run the script with "-CD" for dry run mode, and without arguments for production mode. And here's the docs for the available modules [0].

[0] https://docs.ansible.com/ansible/latest/collections/ansible/...

[+] theshrike79|3 years ago|reply
I use chezmoi + homebrew.

1) Install homebrew (one-liner, easily googled) 2) Use brew to install chezmoi 3) chezmoi pulls my dotfiles, including my Brewfile 4) Say 'brew bundle' and 90-95% of the software I need is installed

Then I need to set up settings sync in VSCode and Alfred and I'm pretty much done. What few things are missing I can install manually, or update the Brewfile to match.

[+] okasaki|3 years ago|reply
What's wrong with ansible?
[+] datalopers|3 years ago|reply
ansible just runs commands over ssh. can’t get more simple.
[+] hnarn|3 years ago|reply
I use salt stack, and with all its warts I think it works just fine for environments with "pets". The idea is of course that in theory, you should be able to re-deploy any system as it's nothing but a collection of "states", but it works just as well for patching, maintaining and upgrading existing systems that never move.

I don't have much experience with Ansible or the other popular configuration management alternatives, but I don't imagine they are much different in this respect.

[+] gyulai|3 years ago|reply
Great use of metaphor to make a complex and subtle technical concept into a readily-understood one-liner.
[+] LAC-Tech|3 years ago|reply
"Cattle, not pets" is not a great analogy in the first place. Maybe I only talk to smaller farmers, but they definitely care if a cow dies. Maybe not as much as if the dog dies, but it's a sign something is seriously wrong with their operation.
[+] soulofmischief|3 years ago|reply
Pets, not cattle is the general mantra for configuration management systems. Personally I use Ansible for fleet management.
[+] pjz|3 years ago|reply
I use etckeeper for this, along with a cron entry to put the currently-installed set of packages into a file (/etc/packages.installed). Thus rebuilding becomes: base-install, pull /etc, reinstall-packages, re-checkout /etc.
[+] COGlory|3 years ago|reply
Interesting. Almost like a declarative configuration scheme.
[+] zellyn|3 years ago|reply
If you like this, be sure to check out bundlewrap. It's a little more complex, but I think things like templates are actually useful.
[+] fny|3 years ago|reply
I just use Fabric and shell scripts.

It works, and its not complicated.

[+] pabs3|3 years ago|reply
I just use Debian packages containing config files for maintaining pets.
[+] charlesrocket|3 years ago|reply
I would never install linux on my pet. Strict BSD diet.
[+] turtleyacht|3 years ago|reply
A replacement for "pets, not cattle" could be "goldfish, not trout" [0]. Due to certain beliefs around the latter.

Has that come up for anyone?

Maybe unique to us?

[0] Not my idea. Source: a colleague.

[+] sweetheart|3 years ago|reply
The alternative you provide is still speciesist to a degree. I like the suggestion in a sibling comment to this one which avoids referring to any animals, though.
[+] zenbit|3 years ago|reply
I like to say "farmed, not gardened" as a veggie alternative to "cattle, not pets". As in "containers are farmed, not gardened".

No idea if that sounds right to a native speaker, though.

[+] qwerty456127|3 years ago|reply
Is it common for computers "that are pets, not cattle" to run Debian-like (APT) and RedHat-like (YUM)?

I would use all kinds except these.

[+] ms4720|3 years ago|reply
Have you looked at salt?
[+] morelisp|3 years ago|reply
I've used masterless salt for managing pet hosts, and the experience was pretty good (though I also already had experience using salt on a 30ish node cluster). However, these days it would be the only reason I would have Python installed on some of them. Avoiding that dependency management would definitely be a selling point.