• 22 Posts
  • 110 Comments
Joined 2 years ago
cake
Cake day: June 18th, 2023

help-circle












  • ansible can seem like just a fancy way to run shell scripts with extra syntax, but the real power shows up when you start managing more than one machine or need repeatable, “idempotent” (i love this word) setups. ansible handles state rather than just running commands, so you can describe what you want instead of how to do it step by step. it’s also easier to maintain over time, especially if your setup grows or changes. just add that new vm to the inventory list.

    if you’re already comfortable with shell scripts and just want to get a few vms going, you could totally get by without ansible. but if you’re planning to do this more than once, or want to be able to rebuild things cleanly, it’s worth it, imo. it could save you a lot of headaches later on.

    i use it at work, i manage about 40 vms in our pre-production environment with ansible. if i need to install a new package on all, it’s one line and one command (ran in a pipeline). if i need to change the settings for unattended-upgrades on the debian machines only, same thing.

    however, our “production” environment is k8s and a handful of external services, and we use terraform to manage all that.

    i guess it all depends on your needs.







  • Oversimplifying it, Ansible playbooks are nothing more than some commands that should be run on a remote machine via ssh. Ansible knows or has modules for a variety of different package managers (apt, yum, etc) and automagically knows how to handle services or various config files.

    It can get complex, but I think just the startup phase, until you have an inventory of remote machines, the ssh keys are in place, etc. I second the Jeff Geerling recommendation, his stuff is solid, both ready to use playbooks, and tutorials.

    I would suggest to also look into cloudinit. Makes setting up VMs on proxmox easier, faster, more consistent, with users, networking, ssh keys, etc ready to use (by you or by Ansible).




















  • beerclue@lemmy.worldtoSelfhosted@lemmy.worldTesting vs Prod
    link
    fedilink
    English
    arrow-up
    3
    ·
    2 months ago

    I personally use my home lab to test and learn, and I try to mimic a corporate environment. I have multiple instances of DNS, proxy, etc and I have a “prod” and a separate “staging” k8s environment. I try as much as possible, without going nuts about it, to update and try new changes that might be breaking in the staging cluster.