GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - pvelati/ansible-role-proxmox-kvm-mgmt: Ansible Role - Create and manage Proxmox KVM VMs

This repository was archived by the owner on Jul 9, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
defaults/main
defaults/main
 
 
extras
extras
 
 
meta
meta
 
 
tasks
tasks
 
 
tests
tests
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Ansible Role: Proxmox KVM Management

Create and manage Proxmox KVM virtual machines.

Requirements

See requirements.txt.

Use this command to install all requirements:

python3 -m pip install --user -r requirements.txt

Setup credentials in ENV with:

source extras/proxmox-variables.sh

The script will add automatically @pem to the username.

If you prefer, you can setup the credentials in a secure vault file, using these parameters:

credentials:
  username: root@pem
  password: yourpassword

Role Variables

See defaults/globals.yml for the complete list of variables. See also proxmox_kvm module page.

Dependencies

Module community.general.proxmox_kvm that can be found in collection community.general.

Usage

Define a list of virtual machines in this format:

vm_list:
   - name: vm1
     net: {"net0":"virtio=32:5F:B4:35:16:0F,bridge=vmbr0"}
     scsi: {"scsi0":"local-lvm:8,ssd=1"}
     bootdisk: 'scsi0'
     cores: 1
     memory: 1024
     balloon: 512
     vga: vmware
   - name: vm2
     net: {"net0":"virtio=32:5F:B4:37:16:0F,bridge=vmbr1"}
     scsi: {"scsi0":"local-lvm:16,ssd=1"}
     bootdisk: 'scsi0'
     cores: 4
     memory: 4096
     protection: yes

Execute playbook:

ansible-playbook ansible-proxmox-kvm-mgmt.yml --tags "OPERATION"

Tag OPERATION:

  • Create VMs
    • present
    • create
  • Start VMs
    • started
    • start
  • Delete VMs
    • absent
    • delete
  • Stop VMs
    • stopped
    • stop
  • Restart VMs
    • restarted
    • restart
  • List VMs
    • current
    • list
  • Update VMs
    • update

Example Playbook

---
- hosts: localhost  
  roles:
    - ansible-proxmox-kvm-mgmt
  vars:
    - global_api_host: NODE_IP or NODE_DNS_NAME
    - global_node: "NODENAME"
    - vm_list:
        - name: example-vm1
          net: {"net0":"virtio=32:5F:B4:35:16:0F,bridge=vmbr0"}
          scsi: {"scsi0":"local-lvm:8,ssd=1"}
          bootdisk: 'scsi0'

And other variables from defaults/main/globals.yml

License

GPL-3.0

About

Ansible Role - Create and manage Proxmox KVM VMs

Topics

ansibleansible-roleautomationkvmproxmoxproxmox-apisvirtual-machine

Resources

Readme
GPL-3.0 license

Contributing

Contributing
Activity

Stars

9 stars

Watchers

1 watching

Forks

10 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.