This commit is contained in:
2026-07-19 17:33:14 +02:00
parent 4daebed7e0
commit b50bd0c303
24 changed files with 585 additions and 5 deletions
+48
View File
@@ -0,0 +1,48 @@
- name: Ensure rsync is installed
package:
name: rsync
state: present
- name: Create backup root
file:
path: "{{ backup_root }}"
state: directory
owner: root
group: root
mode: "0700"
- name: Generate pull ssh key
command:
cmd: ssh-keygen -t ed25519 -N "" -C aurbis-backup-pull -f {{ backup_key_path }}
creates: "{{ backup_key_path }}"
- name: Read pull public key
slurp:
src: "{{ backup_key_path }}.pub"
register: backup_pubkey_slurp
- name: Export public key as fact for the source hosts
set_fact:
aurbis_backup_pubkey: "{{ backup_pubkey_slurp.content | b64decode | trim }}"
- name: Install pull script
template:
src: backup/aurbis-backup-pull.sh.j2
dest: /usr/local/bin/aurbis-backup-pull
mode: "0750"
- name: Install pull service and timer
copy:
src: "backup/{{ item }}"
dest: /etc/systemd/system/
mode: "0644"
with_items:
- aurbis-backup-pull.service
- aurbis-backup-pull.timer
- name: Enable pull timer
systemd:
name: aurbis-backup-pull.timer
enabled: yes
state: started
daemon_reload: yes