Add playbooks/xcp_xo_vm_snapshot.yml

This commit is contained in:
2026-03-31 14:13:42 -07:00
parent ea2f00c098
commit 2f0a557e98

View File

@@ -0,0 +1,23 @@
---
- name: Create VM Snapshot via Xen Orchestra
hosts: localhost
gather_facts: false
vars:
vm_name: "target_vm_name"
snapshot_name: "backup_{{ ansible_date_time.iso8601_basic_short }}"
tasks:
- name: Create snapshot of {{ vm_name }}
community.general.xen_orchestra_vm:
api_url: "{{ xo_host }}"
api_user: "{{ xo_user }}"
api_password: "{{ xo_password }}"
validate_certs: "{{ xo_validate_certs }}"
name: "{{ vm_name }}"
snapshot: yes
snapshot_name: "{{ snapshot_name }}"
register: snap_result
- name: Debug Snapshot Info
debug:
msg: "Snapshot {{ snapshot_name }} created for {{ vm_name }}"