add trottle to backups

This commit is contained in:
tolerryan
2026-08-05 05:34:05 +00:00
parent b5ca9028a7
commit b6008750a6
2 changed files with 8 additions and 3 deletions

View File

@@ -2,7 +2,7 @@
- name: Centralized Restic Fleet Backup with Systemd Hooks
hosts: app_data,app_docker,home_grail
become: true
serial: 5
serial: 1
vars:
# Map of group -> {label, path}. A host can belong to more than one of
@@ -55,6 +55,7 @@
env: *restic_env
register: restic_unlock_result
failed_when: restic_unlock_result.status != 0
throttle: 1
- name: Init restic repo (per target)
community.docker.docker_container:
@@ -74,6 +75,7 @@
loop: "{{ backup_targets }}"
loop_control:
label: "{{ item.label }}"
throttle: 1
- name: Run restic backup (per target)
community.docker.docker_container:
@@ -95,6 +97,7 @@
loop: "{{ backup_targets }}"
loop_control:
label: "{{ item.label }}"
throttle: 1
- name: Show backup output
ansible.builtin.debug:
@@ -122,8 +125,10 @@
loop: "{{ backup_targets }}"
loop_control:
label: "{{ item.label }}"
throttle: 1
always:
- name: Ensure the application is started back up
ansible.builtin.systemd:
name: app
state: started
state: started