I usually connect with my server via ssh in a terminal and run basic commands. What’s a better, more efficient and modern way of doing that? Especially considering ai and documentation along the way? I wonder if there’s a better approach than “connect from remote and act local”. Is there a method to “code local and push to remote”?

I use a fedora server with podman, caddyfile and vi.

  • kossa@feddit.org
    link
    fedilink
    English
    arrow-up
    22
    ·
    3 days ago

    Ansible is one way to “code local, push to remote(s)”. Can define so-called playbooks, which is basically just a script, to do reoccuring tasks like e.g. updates.

    • ElectricVocalist@jlai.lu
      link
      fedilink
      English
      arrow-up
      3
      arrow-down
      1
      ·
      edit-2
      3 days ago

      Ansible is great, I just wish it would automatically cleanup stuff on the server when I remove parts of the config. I know it’s not the goal, but I dream about a tool that works this way. I get many leftover stuff over years

        • ElectricVocalist@jlai.lu
          link
          fedilink
          English
          arrow-up
          1
          ·
          edit-2
          3 days ago

          That works but that’s only useful if you have many machines. I have a single server so it’s the same burden as doing it manually. If only the uninstall step could be completely automated by just reverting the install step

          • med@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            ·
            edit-2
            2 days ago

            I generally find writing a good role takes longer than doing it manually. Especially as you have to keep testing failure conditions as you think of them.

            However, the point is, that once you’re finished with the role, you never have to do that process again.

            Not if you want to rebuild Not if you want to migrate to a new os Not if you build a second server Not if you move to a newcloud hosting provider

            Porting to a new OS or after an update that changes how the software works is about as fast as doing it manually

            Maybe it’s only one server today, but how many times would you need to rebuild it over the running lifetime?

            The killer feature is that having something like ansible lets you kill your darlings, and keep servers aa cattle, not pets.

            Manual setup chops isn’t a different skill here. I view ansible as a combination setup and documentation. If you’re going to figure out how, why not write down how you did it? If you’re going to write it down complete with code lines to run, why not script it?

          • Matt The Horwood@lemmy.horwood.cloud
            link
            fedilink
            English
            arrow-up
            3
            ·
            3 days ago

            Not quite, if you write the role to manage the life cycle of a bit of software then uninstall is part of that life cycle.

            But I do see that investment in time looks more then just do it by hand

          • SayCyberOnceMore@feddit.uk
            link
            fedilink
            English
            arrow-up
            2
            ·
            3 days ago

            To be fair to Ansible, that’s probably a packaging issue.

            If the 1st run of an application creates a bunch of files and folders, then the packager won’t know about them and Ansible’s just relying on that.

            But yeah, for 1 machine I’d find Ansible overkill (not a problem per se), but really helps when you have 5 Rasperry Pi Zeros scattered around the house 😉