this post was submitted on 31 May 2025
42 points (90.4% liked)

Selfhosted

46679 readers
335 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

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?

you are viewing a single comment's thread
view the rest of the comments
[–] possiblylinux127@lemmy.zip 2 points 1 week ago* (last edited 1 week ago)

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.