Ask HN: How do you manage dotfiles and provision machines?
=======
TL;DR -- I am looking for tool(s) that (1) will manage my configs / dotfiles and (2) will install software from a central recipe to any machine I have access to. Chezmoi and Ansible look to be good candidates on a first glace but I am open to other ideas.
=======
I'd like to setup several Linux machines at home, mostly because my main dev machine (Mac) doesn't allow me to tinker as much as I'd like (ZFS and Docker are a pain on macOS; and VMs I currently don't want to deal with). And because I want to be mobile for my programming work and other IT hobbies (I recently got told I am a fairly decent data analyst without me realizing it; I just enjoyed learning a ton of CLI tools and how to slice and dice data in the terminal).
I am a beginner at Chezmoi and I have a cursory knowledge in Ansible, Puppet and Chef. Let me describe what I am after and I'll hope that you would be kind enough to share your tips and tricks. I am looking for a solution where the following applies:
- Configurations / dotfiles are to be added explicitly. Zero automatic magic.
- Be OS-agnostic and account for OS specifics i.e. I have GNU tools installed on my Mac and their directory is added to $PATH and I know this directory will be different on my Linux machines. Writing that much shell scripting is fine but stuff beyond that I'd consider an annoyance. I'd like something more declarative that calculates what to do based on the declaration. I hate YAML but I'll write that if I have to.
- It should install any software that's missing from a central "recipe" when I run a command. I am OK with manually composing this global list of software packages once. After that I'll want to invoke one command and the machine being provisioned to start installing everything.
- OPTIONAL: Handle updating. I already have a very good script that goes through everything I want updated -- stuff via `homebrew`, `cargo install`, `go install`, `asdf` and others -- but I do wonder if there are better solutions than my 50-line tailor-made ad-hoc shell script?
---
Basically I want to invest in something that rids me of the manual work of managing N machines. The more declarative -- but easy to compose and edit! -- the better. The less automatic magic, the better. And if I can avoid hundreds of lines of shell scripts, even better.
Naively I'd say Chezmoi + Ansible so far but I am open to any other ideas.
Please share your wisdom. I am willing to read through every comment here and gauge the pros and cons. (I also would concede a bit from my position on super minimal shell scripting and more declarative syntax. Because hey, if it's easier and quicker to just shell script it then OK.)
4 comments
[ 3.4 ms ] story [ 10.8 ms ] threadhttps://www.walmart.com/ip/Magnet-Me-Up-My-Dog-is-Smarter-th...
It's actually quite the glaring hole in dev tooling. Everyone formulating their own cloud or GIT synced adhoc scripts is a huge waste of energy IMO!
Guess I'll have to start allocating time and check out Ansible, Chef and Puppet (I heard they can do OS- and distro-agnostic package management which sounds promising). Or, since I have no plans to use Windows for anything except gaming ever again and will stick to Macs and Linux machines, then I'll just carefully compose a few bash/zsh scripts with some package manager shims and command/arguments translation and nail that and use it to my grave.
Still, I really expected dev tooling to be better. It's weird how each one of us has to invent their own package syncing manager.
The only tool I was able to find is https://github.com/tversteeg/emplace -- but I am still fighting with it and I can't even make it use config file on a custom location, and it does seem semi-defunct. Will research it a bit, still have hope it'll work but likely not. Oh well.
https://news.ycombinator.com/item?id=11070797
https://news.ycombinator.com/item?id=19591033
I know a few of the options mentioned there but I needed something that would take care of e.g. symlinking or (as is the case with chezmoi) just overwrite local files from the GIT repo it maintains.
Anything for syncing between machines?