Infrastructure-as-code for friendly neighbourhood single board computer? - eviltoast

I have an Odroid N2+ running Arch Linux ARM that I just love. I have installed a bunch of shit on it like jellyfin (TV), miniflux (RSS), gonic/airsonic-refix (music), soju/gamja (IRC), komga (comics).

I am starting to lose track of things. Like which port which service is running on. Sometimes I even forget which service I am running.

It would be nice to maintain a text configuration that I can use to provision this setup if I have to reinstall everything (as is tradition) and something I can glance over to get a state of things.

Any ideas for this? I feel like something like ansible should for this. I tried looking up stuff for this but search results always show some sweaty nerd managing kubernetes on a fleet of Raspberry Pis (the sweaty nerd calls it “homelab”). Before I start hacking my own stuff I would like to hear if someone else has experience with this.

Thanks.

  • iawia@feddit.nl
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

    I have Ansible to configure my media server. Some roles for basic setup (storage, directories, network sharing, software installation), and a bunch of services which are mostly run as docker containers. Those rules just setup storage, config, and then start the container.

    Traefik runs as an automatic reverse proxy, picking up new services as they are added. For the few non-docker containers, there’s a little config file template added.

    All config is separated out into a separate file, and I’ve run the same script against another machine, with different accounts and such, to take it from fresh Ubuntu server install to fully functioning in 5 minutes. Well. Plus aan hour filling in all the variables for my friend’s accounts😀

  • lckdscl [they/them]@whiskers.bim.boats
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    10 months ago

    For not having to remember ports, use a reverse proxy. Keep configuration text files in a repository somewhere, online or offline. Then maybe write an ansible playbook to install all the packages you need and configure as you want. For services that don’t have config files, document in a personal wiki what you do to have it set up.

    I currently have a lot of things installed and use a mixture of docker compose files and config files (podman can also use compose-style files). I’ve written down a guide for myself on how to redeploy my whole server and plan to use ansible to reproduce the setup.

    Flow charts are also good to visualize the state of things.

    • loathsome dongeater@lemmygrad.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      For not having to remember ports, use a reverse proxy.

      Do you do this? The prospect of editing nginx configuration scares the shit out of me. I am also scared of breakages if I (for example) set up a service at a subpath like ip_address/jellyfin/ rather than at a port (ip_address:8000) which feels like a root domain.

  • FuckyWucky [none/use name]@hexbear.net
    link
    fedilink
    English
    arrow-up
    2
    ·
    10 months ago

    I just use docker for everything. Docker compose file for “saving” configuration. If you have trouble remembering ports use nginx proxy manager of traifik.

    • loathsome dongeater@lemmygrad.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      10 months ago

      I use podman wherever possible. Some things don’t have upstream container images though which sucks. If I was simply using podman for everything I could just backup the /etc/containers/systemd folder which would have been nice. But I also want to backup things like firewall and DNS configuration because I keep forgetting how those things work.