Go to file
2024-12-24 15:50:32 +01:00
defaults initial commit 2024-12-11 17:58:34 +01:00
meta initial commit 2024-12-11 17:58:34 +01:00
tasks typo ! 2024-12-24 15:21:48 +01:00
templates template brain_backup - add condition for backup_id 2024-12-24 15:50:32 +01:00
LICENSE Initial commit 2024-12-06 17:38:36 +01:00
README.md add backup_host_id 2024-12-24 15:33:59 +01:00

proxmox-backup

This ansible role :

  • installs proxmox-backup-client on host
  • copy a custom backup script

It has been successfully tested on :

  • Debian "Bullseye" 11
  • Debian "Bookworm" 12

Custom backup script

The custom script :

  • copy & compress the entire system
  • extract informations from your system (packages list, crontab, partition table, etc)
  • can dump MySQL database(s)
  • can dump PostgreSQL database(s)

All files are then send it to a custom Proxmox Backup Server.

Role variables

Variable Type Choices Default Comment
pbs_debian_release_name string bookworm
pbs_repo_key string https://enterprise.proxmox.com/debian/proxmox-release-bookworm.gpg
pbs_repo_no_subscription string deb http://download.proxmox.com/debian/pbs-client {{ pbs_debian_release_name }} main
pbs_user string mandatory
pbs_server string mandatory
pbs_datastore string mandatory
pbs_fingerprint string mandatory
pbs_password string mandatory
backup_host_id string
backup_dir string mandatory
backup_local_retention string mandatory
backup_path_include dict
- path: /etc list string
- path: /var/www list string
fs_mount: true list boolean
backup_path_exclude list
backup_mysql_enabled boolean
backup_postgreslq_enabled boolean
backup_cron_minute int
backup_cron_hour int

Dependencies

None.

Example Playbook

  - hosts: example
    ignore_errors: "{{ ansible_check_mode }}" # ignore errors only in check mode !

    roles:
      - { role: proxmox-backup, tags: ['proxmox-backup'] }

Example variables

---
pbs_user: 'my_user'
pbs_server: 'my_pbs_server:8007'
pbs_datastore: 'my_datastore'
pbs_fingerprint: 'aa:bb:cc:dd:ee:ff:'
pbs_password: 'my_password'

backup_dir: /backup
backup_local_retention: 2

backup_path_include:
  - path: /etc
  - path: /var/www
    fs_mount: true

backup_path_exclude:
  - /var/backups
  - *.log
  - cache/

backup_mysql_enabled: true

backup_cron_minute: 30
backup_cron_hour: 5

License

MIT Modern

Author Information

Written by Ludovic Cartier ludovic.cartier@brainsys.io