Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

agnos.is Forums

  1. Home
  2. Selfhosted
  3. Ansible sounds interesting

Ansible sounds interesting

Scheduled Pinned Locked Moved Selfhosted
selfhosted
17 Posts 15 Posters 64 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T [email protected]

    Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

    mhzawadi@lemmy.horwood.cloudM This user is from outside of this forum
    mhzawadi@lemmy.horwood.cloudM This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #2

    Hello
    you maybe best do some reading up on how ansible works, as it can get very complex.

    This might be a good sting point 👉 https://www.jeffgeerling.com/project/ansible-101-youtube-series

    1 Reply Last reply
    2
    • T [email protected]

      Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

      B This user is from outside of this forum
      B This user is from outside of this forum
      [email protected]
      wrote on last edited by
      #3

      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).

      isokiero@sopuli.xyzI chrisp@cyberplace.socialC 2 Replies Last reply
      3
      • B [email protected]

        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).

        isokiero@sopuli.xyzI This user is from outside of this forum
        isokiero@sopuli.xyzI This user is from outside of this forum
        [email protected]
        wrote on last edited by
        #4

        Or, if you're using only one or few distributions you can preseed the image and have the installer do the stuff for you.

        1 Reply Last reply
        0
        • T [email protected]

          Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

          J This user is from outside of this forum
          J This user is from outside of this forum
          [email protected]
          wrote on last edited by
          #5

          If you don't want another dependency, just get familiar with the provisioning tools of whatever distro you intend to use (Fedora Kickstart, for example), and learn how to quickly provision custom scripted thing with cloud-init when you provision something.

          1 Reply Last reply
          1
          • T [email protected]

            Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

            S This user is from outside of this forum
            S This user is from outside of this forum
            [email protected]
            wrote on last edited by
            #6

            I use it to initialize new VPS with my usual setup, but it might be easier to use a container format. I think Ansible itself has become a bit unfashionable since I started using it. I don't know what is cool instead now. It was Saltstack for a while but idk how long that lasted. Ansible is working mostly ok for me so I've stayed with it, til whenever.

            1 Reply Last reply
            0
            • T [email protected]

              Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

              Z This user is from outside of this forum
              Z This user is from outside of this forum
              [email protected]
              wrote on last edited by
              #7

              Besides ansible, also have a look at "templates" and "cloud-init" for VM generation.

              possiblylinux127@lemmy.zipP 1 Reply Last reply
              2
              • T [email protected]

                Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

                J This user is from outside of this forum
                J This user is from outside of this forum
                [email protected]
                wrote on last edited by [email protected]
                #8

                Check out NixOS. It can build qcow images from scratch for you to import into proxmox

                https://github.com/nix-community/nixos-generators

                I have 8 bare-metal servers and I do everything automated with NixOS, I rarely ever access the servers directly.

                Here are the nixos configs for my DHCP server and kubernetes servers that you can use as a base.

                https://codeberg.org/jlh/h5b/src/branch/main/porygonz

                https://codeberg.org/jlh/h5b/src/branch/main/nodes

                For what it's worth, Ive been using Ansible off and on at work for 8 years, and I think it's pretty outdated and clunky these days, there are much smarter ways to manage workloads such as kubernetes, cloud-init, terraform, and NixOS. If you don't want to get into Kubernetes then definitely learn NixOS.

                1 Reply Last reply
                6
                • B [email protected]

                  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).

                  chrisp@cyberplace.socialC This user is from outside of this forum
                  chrisp@cyberplace.socialC This user is from outside of this forum
                  [email protected]
                  wrote on last edited by
                  #9

                  @beerclue Exactly. You can take wiki bash instructions on how a system was set up and translate it to ansible, or back again. The ansible modules are python, but theoretically you could make a bash implementation that just calls dnf/systemctl/etc. directly, like a sys admin would have done.

                  1 Reply Last reply
                  1
                  • T [email protected]

                    Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

                    irmadlad@lemmy.worldI This user is from outside of this forum
                    irmadlad@lemmy.worldI This user is from outside of this forum
                    [email protected]
                    wrote on last edited by
                    #10

                    Watching this thread. I too would like to dip into Ansible. Looks like a really powerful way to automate things.

                    1 Reply Last reply
                    1
                    • T [email protected]

                      Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

                      possiblylinux127@lemmy.zipP This user is from outside of this forum
                      possiblylinux127@lemmy.zipP This user is from outside of this forum
                      [email protected]
                      wrote on last edited by [email protected]
                      #11

                      Start by creating a VM template in Proxmox. Male sure the template regenerates things like SSH host keys and machine-id on startup. Inside the template create a user with passwordless sudo and setup SSH public key authentication.

                      One the host with the private key install Ansible in a python virtual environment.

                      To execute this create a VM in proxmox, get its IP from the DHCP server and then add it to the hosts file for Ansible. From there you can use your playbooks.

                      The automated way to do this would be to use the Ansible Proxmox collection to create the MAC of the VM and then use a different collection to fetch the IP and set it static. From there you could dynamically add it to the hosts file. This is hard and requires more Ansible knowledge.

                      Another tool you could look into is pyinfra. Pyinfra has less of a learning curve since it is just python.

                      1 Reply Last reply
                      0
                      • Z [email protected]

                        Besides ansible, also have a look at "templates" and "cloud-init" for VM generation.

                        possiblylinux127@lemmy.zipP This user is from outside of this forum
                        possiblylinux127@lemmy.zipP This user is from outside of this forum
                        [email protected]
                        wrote on last edited by
                        #12

                        I personally would avoid Cloud init as it is largely a Ubuntu thing.

                        Instead look into Flatcar or bootable containers

                        S 1 Reply Last reply
                        1
                        • T [email protected]

                          Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

                          A This user is from outside of this forum
                          A This user is from outside of this forum
                          [email protected]
                          wrote on last edited by
                          #13

                          I'd recommend using OpenTofu (Terraform) for initial provisioning of VMs and then use Ansible for post-provisioning config & management. That way you're letting both tools play to their strengths.

                          https://registry.terraform.io/providers/bpg/proxmox/latest/docs

                          1 Reply Last reply
                          4
                          • possiblylinux127@lemmy.zipP [email protected]

                            I personally would avoid Cloud init as it is largely a Ubuntu thing.

                            Instead look into Flatcar or bootable containers

                            S This user is from outside of this forum
                            S This user is from outside of this forum
                            [email protected]
                            wrote on last edited by
                            #14

                            It works on debian too, which of course is ubuntu's base distro. Just adding info.

                            possiblylinux127@lemmy.zipP 1 Reply Last reply
                            0
                            • T [email protected]

                              Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

                              C This user is from outside of this forum
                              C This user is from outside of this forum
                              [email protected]
                              wrote on last edited by
                              #15

                              Please, for the love of god, look at other things instead of Ansible.

                              Definitely do openTofu for infrastructure and deployment, but for configuration of VMs please learn about puppet, saltstack, chef(cinc.sh) and especially mgmtConfig .

                              Ansible, by comparison, better matches what we were doing in 2002 at 1/10th the speed, and it's like pascal levels of wordy.

                              Learning about options and finding one that works well for you will often give you a much better experience than fucking Ansible.

                              If you do abandon all hope, though, then go ahead and do Ansible; but remember if you do: there are better options, and hating Ansible doesn't mean you hate automation.

                              1 Reply Last reply
                              3
                              • S [email protected]

                                It works on debian too, which of course is ubuntu's base distro. Just adding info.

                                possiblylinux127@lemmy.zipP This user is from outside of this forum
                                possiblylinux127@lemmy.zipP This user is from outside of this forum
                                [email protected]
                                wrote on last edited by
                                #16

                                You also could just use Ansible

                                Cloud init adds overhead to a clean Debian install. I've never really liked it personally.

                                1 Reply Last reply
                                0
                                • T [email protected]

                                  Hi, got Proxmox installed. Now want to install some VMs but would like to use a simple setup rather than painfully going trough an install. I've read I could accomplish this via ansible. Are there ready playbooks you can hack? Presumably I would need to have Proxmox understand playbooks?

                                  C This user is from outside of this forum
                                  C This user is from outside of this forum
                                  [email protected]
                                  wrote on last edited by
                                  #17

                                  Sounds like you are looking for Opentofu/Terraform. I use Opentofu to fastly create VMs on Proxmox with Cloud Init scripts. In scenario where one VM hosts one service I try to build IaC that way I can destroy VM and create a new one without loosing anything, data nor configuration.

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups