this post was submitted on 13 Dec 2023
18 points (100.0% liked)

Self Hosted - Self-hosting your services.

11419 readers
1 users here now

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

Important

Beginning of January 1st 2024 this rule WILL be enforced. Posts that are not tagged will be warned and if not fixed within 24h then removed!

Cross-posting

If you see a rule-breaker please DM the mods!

founded 4 years ago
MODERATORS
 

I would like to have a mechanism to set up a server automagically…

Similarly I would like to set up my user account settings (Tmux plugins, .zshrc and vim settings, etc) that I can replicate in multiple machines via a script (I have a custom script for this but I want a more solid alternative)

Thoughts on what infra-as-code solution would work best? Any similar experiences or use cases with one Thanks!
Cc @selfhost@lemmy.ml @selfhosted@lemmy.world

top 16 comments
sorted by: hot top controversial new old
[–] MajorHavoc@lemmy.world 16 points 2 years ago (1 children)

I think you're looking for Ansible. Have fun!

The difference between an Anible playbook and a script, is Ansible has a 'check', 'change', 'verify' pattern, and is declarative (meaning that once the playbook is made, it tends to keep working on future versions of Ansible.)

[–] marx2k@lemmy.world -1 points 2 years ago (1 children)

Ehhh... as someone who does devops, you should dive into ansible core changelogs on github sometime ;)

[–] MajorHavoc@lemmy.world 2 points 2 years ago (1 children)

I assume you mean to check on his often they're is the breaking changes? :)

Declarative style isn't perfect, but it's a massive improvement from straight bash scripting.

[–] marx2k@lemmy.world 2 points 2 years ago

💯

We're an ansible shop and yeah it's better than bash scripting (where it makes sense) but ansible.. man it does have some peculiarities :/

[–] Atemu@lemmy.ml 11 points 2 years ago

I would like to have a mechanism to set up a server automagically…

NixOS.

Similarly I would like to set up my user account settings

Home-manager.

[–] sudneo@lemmy.world 9 points 2 years ago (1 children)

Ansible is definitely one way to do this. If your machines are VMs, then also building VM images with packer can be the way.

For tmux, vim, etc. You can still use ansible or some specific tool for dotfiles, like chezmoi (there are a bunch). You can even use ansible to run chezmoi!

[–] mhzawadi@lemmy.horwood.cloud 1 points 2 years ago (1 children)

on top of ansible to setup system services and user accounts, I have found this https://github.com/andsens/homeshick to help getting my user settings back

[–] sudneo@lemmy.world 1 points 2 years ago

I use https://www.chezmoi.io/ for the same purpose of managing dotfiles. There are a bunch of tools to do this that you can pick your poison :)

[–] hanke@feddit.nu 5 points 2 years ago

Make an ansible playbook

[–] Moonrise2473@feddit.it 4 points 2 years ago

If it's because you set new servers very frequently: Ansible

If it's because moving stuff once every two years to a new server is an hassle: everything in custom docker images

[–] Zoe8338@lemmy.ml 2 points 2 years ago

Hey, please remember to tag your post! Thank you

[–] johntash@eviltoast.org 2 points 2 years ago

You're probably looking for some sort of configuration management tool like chef, ansible, saltstack, or puppet. If you're not already familiar with one, ansible is pretty easy to get started with.

If you're also wanting something that can create the server itself, terraform is great and supports most cloud providers and supervisors.

[–] thirdBreakfast@lemmy.world 1 points 2 years ago

Bare metal servers, VPSs, or VM's you host? If it's for VM's you host, then consider Proxmox as hypervisor and use VM templates. I'm sure old school sysops could to the same with QEMU and Virtmanager or something. But basically, I just set up a VM exactly how I like it, then convert it to a template and cookie cutter it out.

I can sense the Nix guys shaking their heads - it's on my list to try :- )

[–] bouh@lemmy.world 1 points 2 years ago

Why is infra as a code so sought after? I feel like this is installation scripts and config like bare bones, but you need another layer to make it work on top. What am I missing?

[–] OddFed@feddit.de 1 points 2 years ago (1 children)
[–] ReversalHatchery@beehaw.org 1 points 2 years ago

Containers have to run somewhere too..