Comment on Ansible sounds interesting

possiblylinux127@lemmy.zip ⁨5⁩ ⁨days⁩ ago

You need a combination of playbooks

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.

source
Sort:hotnewtop