Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Ansible · Proxmox Automation

Direct answer

Ansible for Proxmox uses the community.general.proxmox modules to create, clone and manage VMs and containers through the API, and roles to configure the guests afterwards.

When to use this

Use this when automating Proxmox with Ansible.

First 30 seconds

1. Ansible for Proxmox: modules (proxmox_kvm, proxmox, proxmox_template), dynamic inventory, node config.

2. API tokens.

3. Check mode support varies.

4. Configure nodes themselves via SSH roles.

5. Pin collections.

Operational verification

playbook → modules/API → Proxmox

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Ansible automation for Proxmox
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformAnsible automation for Proxmox · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when automating Proxmox with Ansible.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 What it is Narrow the fault

Ansible manages Proxmox with the community.general.proxmox* modules (or the newer community.proxmox collection) and configures guests over SSH.

Step 2 Common mistakes Narrow the fault
  • Module collection versions not pinned.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • community.general.proxmox modules manage VMs and containers.
  • Use API tokens for authentication.
  • Configure guests in a separate play.
Key checks
  • ansible-galaxy collection list | grep -E 'community.general|community.proxmox' — collections
  • ansible-playbook proxmox.yml --check — preview
  • proxmox inventory plugin — dynamic inventory
ReferenceWhy it matters1 section · depth on demand

Internals and state

Ansible resolves inventory/group/host variables, renders task/module arguments, establishes the connection/become context, executes modules on the selected target and reports changed/ok/failed.

ReferenceHow it works1 section · depth on demand

Example

- community.general.proxmox_kvm:
    api_host: pve1
    api_token_id: ansible
    api_token_secret: "{{ vault_token }}"
    clone: debian12-tpl
    newid: 120
    name: web01
    node: pve1
ReferenceImportant terms & boundaries3 sections · depth on demand

In depth

Ansible automates Proxmox at two levels: managing the hypervisor itself (packages, networking, users on the nodes) and managing VMs and containers through the API with modules from community.general (the newer community.proxmox collection takes over these modules).

- community.general.proxmox_kvm:
    api_host: pve01.example.com
    api_user: automation@pve
    api_token_id: ci
    api_token_secret: "{{ vault_pve_token }}"
    node: pve01
    clone: tpl-debian12
    newid: 214
    name: app-oslo-014
    full: true
    storage: ceph-vm
    state: present

After creation, a second play configures the guest OS over SSH. Keep tokens in Ansible Vault, and run API tasks from the control node (delegate_to: localhost).

Platform, version and operating-envelope scope

Ansible collection/module behavior depends on ansible-core and collection versions plus target OS/provider.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docAnsible automation for Proxmox current

Authoritative/upstream documentation reviewed for bounded claims in Proxmox Automation > Ansible. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://docs.ansible.com/ansible/latest/ · confidence 94%
Confirmation

Confirm action

Continue?