notmycloud.proxmox_backup_client
Ansible-Proxmox-Backup-Client
This role installs and sets up the Proxmox Backup Client on a Debian-based operating system. You can find the documentation for the Proxmox Backup Client here.
Variables (Vars)
Variable | Required | Default | Description |
---|---|---|---|
proxmox_backup | Yes | Configuration settings for this role | |
.server | Yes | Details for connecting to your Proxmox Backup Server. | |
.server.user | Yes | Username for the PBS (e.g., backup@pbs). | |
.server.pass | Yes | Password or token for the provided username. | |
.server.host | Yes | Hostname or IP address of the PBS. | |
.server.datastore | Yes | Location to save backups. | |
.server.port | No | 8007 | Custom port for the PBS API. |
.server.fingerprint | No | Server certificate fingerprint, found on the dashboard. | |
.client | Yes | Settings for the Proxmox Backup Client. | |
.client.archives | Yes | List of items to backup. | |
.client.archives.name | Yes | Name for the archive file (must not include '/' character). | |
.client.archives.path | Yes | Directory to backup. | |
.client.archives.format | Yes | File formats, like .pxar for file archives or .img for block devices. | |
.client.encrypt | No | Settings for client-side encryption. | |
.client.encrypt.enable | Yes | No | Enables or disables client-side encryption. |
.client.encrypt.pass | No | Password for the encryption key, if needed. | |
.client.encrypt.key | Yes | ~/.config/proxmox-backup/encryption-key.json | Path to save the encryption key. |
.client.encrypt.master | No | Path to local master-public.pem to copy to the client. | |
.client.output | No | Settings for output log formatting. | |
.client.output.format | No | text | Formats available: text, json, or json-pretty. |
.client.output.border | No | If set, won't show table borders. | |
.client.output.header | No | If set, won't show table headers. | |
.client.include_devices | No | List of mount points to include, as they are ignored by default. | |
.client.skip_lost_found | No | No | Option to skip lost+found directories. |
.client.schedule.calendar | No | '--* 4:00:00' | Schedule for backups, default is daily at 4am. |
.client.schedule.runifmissed | No | No | Runs the service if the last scheduled time was missed. |
.client.exclude | No | Settings for .pxarexclude files. | |
.client.exclude[#].path | Yes | Path for .pxarexclude (parent folder). | |
.client.exclude[#].enabled | Yes | Indicates whether to create the exclusion file or not. | |
.client.exclude[#].rules | Yes | List of rules for exclusions, can include specific inclusions. |
Default Configuration
default_config:
client:
encrypt:
enable: false
key: ~/.config/proxmox-backup/encryption-key.json
output:
format: text
skip_lost_found: no
schedule:
calendar: '*-*-* 4:00:00' # Runs daily at 4am
runifmissed: no
Examples
Group Variables (YAML format)
pbs_global_server:
user: backup@pbs
pass: ProxmoxBackupPassword
host: pbs.example.com
datastore: backups
fingerprint: 7f:f1:ee:...:3d:de:2b
pbs_global_client:
skip_lost_found: yes
exclude:
- path: /
rules:
- /boot/*
- /tmp/*
- path: /var/
rules:
- /run/*
- /log/*.[0-9]
- /log/*.[0-9].*
- /log/**/*.[0-9]
- /log/**/*.[0-9].*
archives:
- name: root
path: /
format: .pxar
- name: boot
path: /boot
format: .pxar
Host Variables (YAML format)
pbs_client:
archives:
- name: ssd
path: /ssd
format: .pxar
- name: data
path: /Data
format: .pxar
exclude:
- path: /ssd/qbit/
rules:
- /incomplete/*
- path: /ssd/media/
rules:
- /_transcode/temp/*
- /_transcode/log/*
- /converted/*.jpg
- /converted/*.mp4
- /.Trash*
Merging Group Defaults with Host Overrides
In this case, pbs_global_client
is the group variable, while pbs_client
is a host variable. Using combine(pbs_client, recursive=true)
merges them, with host variables taking priority.
# Merge the arrays to avoid overwriting.
- name: Merge PBS Client Arrays
set_fact:
pbs_client_merged:
archives: "{{ pbs_global_client.archives + pbs_client.archives }}"
exclude: "{{ pbs_global_client.exclude + pbs_client.exclude }}"
- name: Setup Proxmox Backup Client
include_role:
name: proxmox-backup-client
vars:
proxmox_backup:
server: "{{ pbs_global_server }}"
client: "{{ pbs_global_client | combine(pbs_client, recursive=true) | combine(pbs_client_merged, recursive=true) }}"
Informazioni sul progetto
Ansible role to install and configure the Proxmox Backup Client.
Installa
ansible-galaxy install notmycloud.proxmox_backup_client
Licenza
mit
Download
320
Proprietario