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

NodeBB

  1. Home
  2. Selfhosted
  3. Ansible sounds interesting

Ansible sounds interesting

Scheduled Pinned Locked Moved Selfhosted
selfhosted
3 Posts 3 Posters 4 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 This user is from outside of this forum
    T This user is from outside of this forum
    [email protected]
    wrote on last edited by
    #1

    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 vegetaaaaaaa@lemmy.worldV 2 Replies 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
      #2

      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
      • 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?

        vegetaaaaaaa@lemmy.worldV This user is from outside of this forum
        vegetaaaaaaa@lemmy.worldV This user is from outside of this forum
        [email protected]
        wrote last edited by [email protected]
        #3

        If you needs are simple, write a simple playbook using the proxmox ansible module https://docs.ansible.com/ansible/latest/collections/community/general/proxmox_kvm_module.html

        Terraform/Opentofu provides more advanced stuff but then you have to worry about persistent state storage, the clunky DSL... used it when acsolutely needed, you can do 90% of this stuff with the proxmox ansible module.

        If you need to make your playbook less verbose, move the logic to a role so that you can configure your VMs from a few lines in the playbook/host_vars. Mine looks like this (it's for libvirt and not proxmox, but the logic is the same)

        # playbook.yml
        - hosts: hypervisor.example.org
          roles:
            - libvirt
        
        # host_vars/hypervisor.example.org.yml
        libvirt_vms:
          - name: vm1.example.org
            xml_file: "{{ playbook_dir }}/data/libvirt/vm1.example.org.xml"
            state: running
            autostart: yes
          - name: vm2.example.org
            xml_file: "{{ playbook_dir }}/data/libvirt/vm2.example.org.xml"
            autostart: no
          - name: vm3.example.org
            xml_file: "{{ playbook_dir }}/data/libvirt/vm3.example.org.xml"
            autostart: no
          - name: vm4.example.org
            xml_file: "{{ playbook_dir }}/data/libvirt/vm4.example.org.xml"
            autostart: no
            disk_size: 100G
        
        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.
        Powered by NodeBB Contributors
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups