A configuration management system for computers that are pets, not cattle
github.com
github.com
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"...)
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.
1. When a system comes in, it is scanned and entered into the asset management database, which then triggers a process to enter the scanned MAC address into the DHCP, by generating a new DHCP configuration package.
2. the previous version of the DHCP configuration package is upgraded with the new DHCP configuration package.
3. the system is hooked up to the network and powered on.
4. the firmware is permanently reconfigured to boot in this order: 1. HD0 2. HD1 3. network.
5. since HD0 and HD1 are not bootable, the system boots from the network, whereby the infrastructure automatically provisions it with the standard runtime platform, which consists solely of packages in OS-native format, including configuration packages which configure things which all servers have in common.
6. as part of the automatic installation, the server is automatically installed with additional configuration packages based on which profile it is in, turning it into a specific application server.
7. the server comes up after automatic installation, and reports back to the infrastructure that it is ready to serve.
NEVER by hand!
Turns out that, like Puppet, Ansible seems to have been congealed rather than designed, and it's a mess of inconsistent spaghetti code.
All the other config management systems I've tried, from Salt to Chef have exactly the same problem.
I'd be thrilled to find a config management system that actually was simple and elegant.
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
I just use it package-management-style with "nix-env" instead of using the whole configuration language. Pretty simple and easy to remember.
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.
* 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.
https://discourse.nixos.org/t/documentation-team-flattening-... aims to flatten the learning curve for NixOS.
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.
Just administer it by hand and back it up.
Some people like gardening, although they will never get to "sell produce" at the vegetables market. That doesn't mean gardening is bad, it just means they enjoy it and enjoy wasting their time doing gardening. Other people just go and buy vegetables at the supermarket that were grown at commercial farming.
Same with doing configuration management on your laptop, if you really want to enjoy it, go for it. For most people its a complete waste of time and a useless activity compared to the alternative, which is changing the few files you need changing by hand, and backing it up to solve the "lost my work" problem.
For gardening though I can garantee you that homegrown fruits and vegetables can be far superior to anything you can find at the supermarket, so would argue the end result is not the same.
Maybe a better example would be using hand tools versus power tools -- if one takes the expense of power tools out of the equation.
The visibility of the changes aren't a virtue in themselves, it is only when you do something with them that they become useful.
Spending hours documenting my build system for my pet laptop to save myself 60 seconds a few times a year isn't a good payoff for me. If the payoff is that you also learn configuration management along the way, then that's fine.
(I also don't quite understand how you're testing and validating your build system for your laptop without periodically wiping it and reprovisioning it -- and once you start considering things like that I definitely don't have enough time for all that)
Why do you have a "documented pipeline" for your laptop?
And I never bother keeping notes, I just back it up so that the whole thing is recoverable.
You're getting away from having a pet then.
And once you consider that you might have a third laptop for something work related and be able to duplicate the base configuration then you no longer have pets and you just need configuration management.
That isn't even the common use case of most IT professionals, much less most laptop users.
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?
I’ve thought about using it to set up my machines/machines at work but haven’t gone down that road yet.
Although ansible can be used in local machine, but it is design for multiple remote machine. For example, if you want copy a config file to target, you must use some tools like `scp` or do some hacking. And it's much slow than shell script, and the print in stdio is ugly. (because it's design for running in 100 machines in one time.)
Ansible also had a steep learning curve, and redhat did not prepare a good beginner's manual for it. Searching the web there is only the experience of people who have used it for years, each with their own way of writing. There are no best practices for getting started easily.
Modularizing complicates things obviously but for simple uses I don't see how it can be simplified much further.
Maybe I misunderstood, but I use copy (1) for this in Ansible. This is standard, and you shouldn’t need scp?
(1) https://docs.ansible.com/ansible/latest/collections/ansible/...
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/...
And ansible filters are just something else. I get how to use them by now, but compared to some simple ruby's select + map... yeah. In most cases, once we need two of the complex filters, we just introduce a custom one in pure python because that saves sanity points.
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.
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.
Oh, I didn't realize it was in widespread use. But still. Someone thought of it, and it's great use of language.
Herding was mostly done by people, often kids, and fences, though some neighbors did use herding dogs.
I can understand how trained herding dogs can also be important, but it was certainly not my experience in the countryside.
It works, and its not complicated.
Has that come up for anyone?
Maybe unique to us?
[0] Not my idea. Source: a colleague.
No idea if that sounds right to a native speaker, though.
I would use all kinds except these.