23 lines
696 B
YAML
23 lines
696 B
YAML
---
|
|
- 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 }}" |