Ansible and Nix. Code is the document.
I've been in the process of migrating everything over do Nix. Love it so much.
What hole does Ansible fill for you? I haven't looked into it in the past really, so just curious. I have a single Paoxmox node so don't really need horizontal scaling orchestration.
This is what I like about git ops and infra/config as Code personally.
Ideally everything is an a tofu/ansible/helm chart and git lab pipeline/Fleet job. I add comments for anything that I had to learn to make work to those files. Follow good commit hygenine (most of the time). And bam I can almost a year later half asleep stumble back into a thing I did.
Do you use this for physical machines too?
Yep! Metal3 for servers with BMCs Tinkerbell for everything else.
I also have an ansible playbook that templates everything into a cloud init scripts as a boot strap server.
About 12 nodes in total now, from new servers to freebee junk laptops in it.
Whenever I set something up I usually make a markdown file listing the commands and steps to take. I do this as I am setting things up and familiarizing myself, so once I'm done, I have a start to finish guide.
Raw text/markdown files will be readable until the end of time.
I agree with the advice that says “Document your setup such that you could recreate it from your notes from scratch” but I’d take it another step further — consider that someone may have to do some work on your system when you are unable or unavailable. The kind of thing you’d keep with your will, or power of attorney. Just a suggestion.
.....and to my family I bequeath my entire collection of Linux iso's
You jest but if I left my wife my Home Assistant setup undocumented she would pee on my grave.
LOL, well I'm single tho I've known my ladyfriend for over 40 years. I offered to set up a server at her house, and connect the two, but she has no interest rifling through all my lab for anything of interest in the case of my passing.
I’m happily married with a kid, and we recently went through the estate planning process. When I brought up IP stuff and digital properties, their advice was pretty much “Hmm… you should pick someone who understands what you’re talking about, get their approval in advance, and then add them as your legacy contacts and document the heck out of everything”. Realistically nobody is going to want my GitHub stuff or anything like that, but I would like my kid to have access to most* of my files after I pass. I am of course excluding the kind of content that “real friends” delete while your body is still warm.
It'd be nice to donate all my equipment to some kid who is very interested. That would be something I'd be interested in.
I believe it is traditional to do so written in blood in the style of an apocalypse log, dealer's choice for who's blood. Make sure it's disjointed and nearly incomprehensible, but that everything is there.
Bonus points if you print the config files and write your documentation on them after stapling them to the walls
I have two systems that sort of work together.
The first system involves a bunch of text files for each task. OS installation, basic post OS installation tasks and a file for each program I add (like UFW, apparmor, ddclient, docker and so on). They basically look like scripts with comments. If I want to I can just copy/paste everything into a terminal and reach a a specific state that I want to be at.
The second system is a sort of "skeleton" file tree that only contains all the files that I have added or modified.
Here's an example of what my server skeleton file tree looks like
.
├── etc
│ ├── crontabs
│ │ └── root
│ ├── ddclient
│ │ └── ddclient.conf
│ ├── doas.d
│ │ └── doas.conf
│ ├── fail2ban
│ │ ├── filter.d
│ │ │ └── alpine-sshd-key.conf
│ │ └── jail.d
│ │ └── alpine-ssh.conf
│ ├── modprobe.d
│ │ ├── backlist-extra.conf
│ │ └── disable-filesystems.conf
│ ├── network
│ │ └── interfaces
│ ├── periodic
│ │ └── 1min
│ │ └── dynamic-motd
│ ├── profile.d
│ │ └── profile.sh
│ ├── ssh
│ │ └── sshd_config
│ ├── wpa_supplicant
│ │ └── wpa_supplicant.conf
│ ├── fstab
│ ├── nanorc
│ ├── profile
│ └── sysctl.conf
├── home
│ └── pi-user
│ ├── .config
│ │ └── ash
│ │ ├── ashrc
│ │ └── profile
│ ├── .ssh
│ │ └── authorized_keys
│ ├── .sync
│ │ ├── file-system-backup
│ │ │ ├── .sync-server-fs_01_root
│ │ │ └── .sync-server-fs_02_boot
│ │ └── .sync-caddy_certs_backup
│ ├── .nanorc
│ └── .tmux.conf
├── root
│ ├── .config
│ │ └── mc
│ │ └── ini
│ ├── .local
│ │ └── share
│ │ └── mc
│ │ └── history -> /dev/null
│ ├── .ssh
│ │ └── authorized_keys
│ ├── scripts
│ │ ├── automated-backup
│ │ └── maintenance
│ ├── .ash_history -> /dev/null
│ └── .nanorc
├── srv
│ ├── caddy
│ │ ├── Caddyfile
│ │ ├── Dockerfile
│ │ └── docker-compose.yml
│ └── kiwix
│ └── docker-compose.yml
└── usr
└── sbin
├── containers-down
├── containers-up
├── emountman
├── fs-backup-quick
└── rtransfer
This is useful to me because I can keep track of every change I make. I even have it set up so I can use rsync to quickly chuck all the files into place after a fresh install or after adding/modifying files.
I also created and maintain a "quick install" guide so I can install a fresh OS, rsync all the modified files from my skeleton file tree into place, then run through all the commands in my quick install guide to get myself back to the same state in a minimal amount of time.
I created something similar to this. It got a lot of love during interviews later down the line. https://external-content.duckduckgo.com/iu/?u=https%3A%2F%2Fi.redd.it%2Fvmd34mabi4r91.jpg&f=1&ipt=2dde77fd04d48156bc514ad4b1f090c8473f4e666ead0e16906eeed55a79aca6
What tool did you use to create the diagram?
Well I guess I was not clear enough, this one is not mine. Lots of identifying info in mine. I go into a bit more details and made mine a but cleaner and easy to read.
For mine, I used Draw.io not amazing, but did what I needed it to and have ot self-hosted, so it is easy to edit.
I'm not real clear what exactly you need to document.
Infrastructure documentation starts with an IPAM.
A good IPAM can help you document all kinds of stuff.
I use NetBox.
https://github.com/netbox-community/netbox?tab=readme-ov-file#getting-started
I'm running it as a Docker container on a Linux VM.
I just looked at their latest screenshots, and it appears they've done quite a bit with it since I stood up my copy.
It does even more now. I'll have to upgrade.
Yeah,Netbox is also my main solution, combined with forgejo repo.
Works very well.
Netbox is a hell of a package, of which I've essentially only touched the IPAM, and I don't even use it programmatically. I just use the web console to keep track of 4 subnets and about 50 IPs.
It's got a whole virtualization section that I haven't touched, although that would make my device mapping more sensible. I just treat em like they are all real, and only map the physical nics on the hypervisor hosts.
I do keep text notes in Netbox entries, but that's sort of a backup. If its something I'm likely to need to know, I'll have a note in Proxmox. Usually login links for apps hosted there and the like. And of course I've got a folder full of text files with all my deepest secrets.
Netbox,especially when combinded with Plugins is so incredibly good and might,that's it's almost funny how good it is. What I do Plugin wise:
-
Documents: not implemented yet by me,but one could store manuals,etc. directly within netbox.
-
Lifecycle and Inventory: While it's not as good as snipe-it (tbh, inventory is imho one of the worst plugins) it does the job for my small deployment
-
Slurp it to scan automatically
-
QR Code for obvious reasons
-
Floorplan as well
Of course that sounds overkill for a small deployment, but I simply forget too many things after a few months otherwise and it's something my family (wife is in IT and far more qualified than me) would need if something happens to me,so a proper documentation would be essential for that as well.
Alright already! I'll work on my upgrade.
I'm wondering if I should just build a new docker and then migrate the data instead of upgrading in place. I bet that's the easier thing to do in the end. Sounds safer too. I got backups and all, but ...
Selfhosted
A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.
Rules:
-
Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.
-
No spam posting.
-
Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.
-
Don't duplicate the full text of your blog or github here. Just post the link for folks to click.
-
Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).
-
No trolling.
-
No low-effort posts. This is subjective and will largely be determined by the community member reports.
Resources:
- selfh.st Newsletter and index of selfhosted software and apps
- awesome-selfhosted software
- awesome-sysadmin resources
- Self-Hosted Podcast from Jupiter Broadcasting
Any issues on the community? Report it using the report flag.
Questions? DM the mods!