Use this when automating Proxmox with Ansible.
Ansible · Proxmox Automation
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.
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.
playbook → modules/API → Proxmox
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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 · 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.
- community.general.proxmox modules manage VMs and containers.
- Use API tokens for authentication.
- Configure guests in a separate play.
ansible-galaxy collection list | grep -E 'community.general|community.proxmox'— collectionsansible-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.
Mechanics
The linked authority for bounded mechanics is Ansible Documentation; documentation support is separate from observed lab/production Evidence.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
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%