feat: proxmox backup
This commit is contained in:
32
opdracht-5/playbook.yml
Normal file
32
opdracht-5/playbook.yml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
- name: Backup proxmox VM's
|
||||||
|
hosts: proxmox
|
||||||
|
gather_facts: false
|
||||||
|
vars:
|
||||||
|
proxmox_api_host: node
|
||||||
|
proxmox_api_user: user
|
||||||
|
proxmox_api_password: password
|
||||||
|
backup_storage: backup_vm
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
- name: Retrieve VM info
|
||||||
|
community.general.proxmox_vm_info:
|
||||||
|
api_host: "{{ proxmox_api_host }}"
|
||||||
|
api_user: "{{ proxmox_api_user }}"
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
validate_certs: false
|
||||||
|
register: vm_list
|
||||||
|
|
||||||
|
- name: Backup VM
|
||||||
|
community.general.proxmox:
|
||||||
|
api_host: "{{ proxmox_api_host }}"
|
||||||
|
api_user: "{{ proxmox_api_user }}"
|
||||||
|
api_password: "{{ proxmox_api_password }}"
|
||||||
|
validate_certs: false
|
||||||
|
vmid: "{{ item.vmid }}"
|
||||||
|
storage: "{{ backup_storage }}"
|
||||||
|
mode: snapshot
|
||||||
|
remove: false
|
||||||
|
loop: "{{ vm_list.proxmox_vms }}"
|
||||||
|
when:
|
||||||
|
- item.type == "qemu"
|
||||||
|
register: backup_results
|
Reference in New Issue
Block a user