Skip to content

Instantly share code, notes, and snippets.

@dotcomr
Last active January 16, 2023 16:56
Show Gist options
  • Save dotcomr/0e95756a725361c74fb2c1acfeb6ce16 to your computer and use it in GitHub Desktop.
Save dotcomr/0e95756a725361c74fb2c1acfeb6ce16 to your computer and use it in GitHub Desktop.
Ansible backup Home Assistant in Proxmox Playbook
Here is an example Ansible playbook that can be used to backup a Home Assistant VM in Proxmox:
Copy code
- name: Backup Home Assistant VM
hosts: localhost
gather_facts: no
tasks:
- name: Backup Home Assistant VM
proxmox_kvm:
api_user: "root@pam"
api_password: "your_password"
api_host: "https://proxmox_host:8006/api2/json"
vmid: 100
state: backup
backup_name: "homeassistant-backup"
backup_storage: "local"
backup_mode: "snapshot"
This playbook connects to the Proxmox API as the root user, with the specified password. It then creates a backup of the VM with ID 100, and names the backup "homeassistant-backup". The backup is stored in the "local" storage, and it is created using snapshot mode.
Please note that you need to install the proxmoxer and proxmoxer_kvm python modules before running this playbook.
pip install proxmoxer
pip install proxmoxer_kvm
Also, please replace the your_password with the actual password and proxmox_host with the IP or domain name of the Proxmox host, and vmid with the actual vmid of your Home Assistant vm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment