Files
operating-automation/roles/proxmox-automation/tasks/create-snapshots.yaml
2026-04-14 11:38:07 +02:00

17 lines
518 B
YAML

- name: Create new snapshot and keep only the 2 newest snapshots
community.proxmox.proxmox_snap:
api_host: "{{ proxmox_host }}"
api_user: "{{ proxmox_user }}"
api_token_id: "{{ proxmox_token_id }}"
api_token_secret: "{{ proxmox_token_secret }}"
vmid: "{{ vmid }}"
state: present
snapname: "{{ snapshot_name | default('before_update') }}"
retention: 2
timeout: 300
delegate_to: localhost
retries: 3
delay: 10
register: snapshot_result
until: snapshot_result is succeeded