Commit 972055ef authored by Jocelyn Delalande's avatar Jocelyn Delalande

rsync-server: Add ability to cleaup old backup clients

parent c742c840
......@@ -56,6 +56,9 @@ Example:
- `path` is the local path you want to allow pulling data from.
- `ssh_pubkey` is the pubkey, as appearing verbatim in the *.pub* file SSH generates.
- `rsync_server_removed_backup_clients` is a list of old backup clients you want
to deconfigure.
Limits
------
......
rsync_server_removed_clients: []
\ No newline at end of file
......@@ -57,3 +57,19 @@
dest: "~{{ rsync_server_user }}/.ssh/authorized_keys"
owner: "{{ rsync_server_user }}"
mode: 0700
- name: Remove old backup client incoming btrfs subvolumes
command: >
btrfs subvolume delete {{ rsync_server_path }}/{{ item }}/incoming
removes={{ rsync_server_path }}/{{ item }}/incoming
with_items: "{{ rsync_server_removed_backup_clients }}"
- name: Delete old backup client dedicated btrfs main subvolumes
command: >
btrfs subvolume delete {{ rsync_server_path }}/{{ item }}
removes={{ rsync_server_path }}/{{ item }}
with_items: "{{ rsync_server_removed_backup_clients }}"
- name: Remove old clients backup dirs
file: name={{ rsync_server_path }}/{{ item }} state=absent
with_items: "{{ rsync_server_removed_backup_clients }}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment