I am working on setting up a home server but I want it to be reproducible if I need to make large changes, switch out hardware, or restore from a failure. What do you use to handle this?

  • dontsayaword@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    15 days ago

    I used to have a fille with every cli command and notes on how each thing was set up. When I had to reinstall it from scratch it took all day going through lots of manual steps and remembering how it should all go.

    Recently I converted the whole thing to Ansible. Now I could rebuild my entire system on a brand new OS installation with one command that completes in minutes. It’s all modular and I can add new services easily whether they are docker containers or scripts or whatever. If I ever break anything, it will reset everything to its intended state and leave it alone otherwise. And it’s free and pretty easy to learn and start using.

    Plus I use git along with it for version control, so I can always revert to any previous configuration instantly.

    • xyx@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      0
      ·
      15 days ago

      Out of curiosity: Are you running nix-ops with nix-secrets or how did you cover orchestration & credentials?

      • adf@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        15 days ago

        I use flakes and all hosts are configured from a single flake, where each host has its own configuration. I have some custom modules and even custom package in the same flake. I also use home manager. I have 4 hosts managed in total: home server, laptop, gaming PC, and a cloud server. All hosts were provisioned using nixos-anywhere + disko, except for the first one which was installed manually. For secrets I use sops-nix, encrypted secrets are stored in the same flake/repo.

  • wersooth@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    12 days ago

    Currently I’m migrating from compose.y(a)ml to terraform. I’m using proxmox -> 2x VM -> docker swarm. I will soon try to engineer a solution to quickly scale up and down any service I want using the same terraform codebase with rundeck. I have my configs as terraform templates and it gets deployed as a swarm config (or secret), then mapped to the container the same way.

  • atzanteol@sh.itjust.works
    link
    fedilink
    English
    arrow-up
    1
    ·
    15 days ago

    Terraform and ansible. Script service configuration and use source control. Containerize services where possible to make them system agnostic.

      • atzanteol@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        14 days ago

        They’re good at different things.

        Terraform is better at “here is a configuration file - make my infrastructure look like it” and Ansible is better at “do these things on these servers”.

        In my case I use Terraform to create proxmox VMs and then Ansible provisions and configures software on those VMs.