3 ms·
I just use Ansible for this purpose. All my work machines are set up using a single, parameterized Ansible playbook.
by cybrox 4y ago
I just use Ansible for this purpose.
All my work machines are set up using a single, parameterized Ansible playbook.
- makach 4y agoClever, I'll have to look into that. I thought this was a no-brainer and that this was something everyone did some way or another. I use github for my dotfiles, also, try to keep them synchronized on my mac/pc/linux for familiarity. very simple stuff though. Also easy to pack and transport in cases where I cannot directly connect to internet.
- Tajnymag 4y agoCan you share it?
- cybrox 4y agoUnfortunately, I can't share it "as is", as it has grown a lot over the years and contains a lot of information about my home and work network topology and setups. (I host it on a private git server) I copied some of it into an example repository to showcase the structure and left the playbook.yaml intact for reference. You can find it on: https://github.com/cybrox/ansible-setup-example https://github.com/cybrox/ansible-setup-example I don't want to claim that this structure is in any way better or worse than anything else, it's just one that works for me. There's a lot of discussion on how Ansible projects should be structured. This allows me to simply run `WORKSTATION=home DESKTOP=wayland ansible-playbook playbook.yaml` on a fresh Arch Linux install and everything is ready to go. For maintaining the repository, I got used to changing things in there and deploying them instead of changing dotfiles directly. However, I do also deploy a bash script to copy all the files from the system back to the repo to catch dotfile edits I did hastily at 3am. An example of dotfiles being deployed with this approach is roles/shell/tasks/zsh.yaml
- mxuribe 4y agoOh, if you wouldn't mind sharing, that would be greatly appreciated! For set up of my machine(s), I was going to go the route of using a bash or python script...but when i learned (a high level summary) of ansible, figured that might be a skill that i can leverage for work in the future too. So, I'm trying to play, learn about ansible. (I already have basics of python, so ansible was an add-on for me.) The more that i can learn from examples of others, the better i can learn what are good practices, etc. Thanks!
- cybrox 4y agoI've shared an example based on what I currently use here: https://news.ycombinator.com/item?id=32639329 https://news.ycombinator.com/item?id=32639329 :) I used to use bash scripts myself, however, I did transition to Ansible because I often ran into problems with replayability of scripts (running them multiple times). Ansible (and other tools like it) handle stuff like "change a line in this config file to that" or "add this flag here when xyz" easily and you can run it as many times as you like. Also, Ansible Galaxy offers a lot of roles ready-to-use such as docker setup or asdf version manager plugin management. Though a lot of it is often not that well maintained.
- skyfaller 4y agoAvoiding Ansible is precisely why I use chezmoi. Unfortunately I still have to use Ansible for stuff that isn't my dotfiles, but the less Ansible, the better. It feels like whatever use cases I have for Ansible are weird and not what other people are doing, because everything I try to do is difficult and poorly documented. For example, when I try to spin up a machine running Alpine Linux using Ansible, I've encountered all sorts of strange bugs, some of which I've reported and are (being) fixed, but it boggles my mind that what I thought would be really basic stuff, like setting the hostname or the timezone, is buggy as heck.