From e3c0aec81c2432c0bab22043623cd67a93eed7da Mon Sep 17 00:00:00 2001 From: Michael Grote Date: Tue, 29 Oct 2024 14:55:46 +0100 Subject: [PATCH] sdfsa --- group_vars/all.yml | 41 ++++++++++++++ host_vars/pve5.mgrote.net.yml | 31 +++++++++++ roles/mgrote_rsync/defaults/main.yml | 80 ++++++++++++++-------------- 3 files changed, 111 insertions(+), 41 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 0764c61d..a9f9a8a7 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -247,6 +247,47 @@ munin_node_plugins: env.config_dir /etc/fail2ban user root +### mgrote_sync (für pbs + pve) +rsync_mirror_user_group: "{{ rsync_mirror_user }}" +rsync_mirror_user: rsync_mirror +rsync_mirror_bw_limit: "2m" # 2 Megabytes +rsync_mirror_timer: '*-*-* 23:00:00' # jeden Tag um 2300 + +rsync_mirror_private_key: "{{ lookup('viczem.keepass.keepass', 'rsync_mirror_private_key', 'notes') }}" +rsync_mirror_public_key: "{{ lookup('viczem.keepass.keepass', 'rsync_mirror_public_key', 'notes') }}" + +rsync_mirror_dirs: # "/" beachten! +- src: /hdd_data/tmp + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" +- src: hdd_data/archiv + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/archiv" +- src: hdd_data/backup + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/backup" +- src: hdd_data/bilder + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/bilder" +- src: hdd_data/buecher + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/buecher" +- src: hdd_data/music + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/music" +- src: hdd_data/papa_backup + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/papa_backup" +- src: hdd_data/programme + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/programme" +- src: hdd_data/pve_backup + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/pve_backup" +- src: hdd_data/restic + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/restic" +- src: hdd_data/scans + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/scans" +- src: hdd_data/tmp + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" +- src: hdd_data/videos + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/videos" +- src: hdd_data/vm + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/vm" + + + # Ansible Variablen ### User ansible_user: "ansible-user" diff --git a/host_vars/pve5.mgrote.net.yml b/host_vars/pve5.mgrote.net.yml index 4ab4446a..83b03548 100644 --- a/host_vars/pve5.mgrote.net.yml +++ b/host_vars/pve5.mgrote.net.yml @@ -231,3 +231,34 @@ pve_pbs_datastore: username: user_pve5@pbs password: "{{ lookup('viczem.keepass.keepass', 'pbs_pve_user', 'password') }}" fingerprint: "7F:AC:54:75:1C:33:55:84:1E:1E:3A:15:5A:5E:AF:79:33:C9:D4:E1:C0:A0:1C:0D:9E:6A:EA:82:F9:27:57:79" + +### mgrote_sync +rsync_mirror_dirs: # "/" beachten! +- src: /hdd_data/tmp + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" +- src: hdd_data/archiv + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/archiv" +- src: hdd_data/backup + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/backup" +- src: hdd_data/bilder + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/bilder" +- src: hdd_data/buecher + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/buecher" +- src: hdd_data/music + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/music" +- src: hdd_data/papa_backup + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/papa_backup" +- src: hdd_data/programme + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/programme" +- src: hdd_data/pve_backup + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/pve_backup" +- src: hdd_data/restic + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/restic" +- src: hdd_data/scans + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/scans" +- src: hdd_data/tmp + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" +- src: hdd_data/videos + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/videos" +- src: hdd_data/vm + dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/vm" diff --git a/roles/mgrote_rsync/defaults/main.yml b/roles/mgrote_rsync/defaults/main.yml index 166e3268..8031a63a 100644 --- a/roles/mgrote_rsync/defaults/main.yml +++ b/roles/mgrote_rsync/defaults/main.yml @@ -1,41 +1,39 @@ ---- -rsync_mirror_user_group: "{{ rsync_mirror_user }}" -rsync_mirror_user: rsync_mirror -rsync_mirror_bw_limit: "2m" # 2 Megabytes -rsync_mirror_timer: '*-*-* 23:00:00' # jeden Tag um 2300 - -rsync_mirror_private_key: "{{ lookup('viczem.keepass.keepass', 'rsync_mirror_private_key', 'notes') }}" -rsync_mirror_public_key: "{{ lookup('viczem.keepass.keepass', 'rsync_mirror_public_key', 'notes') }}" - -rsync_mirror_dirs: # "/" beachten! -- src: /hdd_data/tmp - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" -- src: hdd_data/archiv - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/archiv" -- src: hdd_data/backup - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/backup" -- src: hdd_data/bilder - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/bilder" -- src: hdd_data/buecher - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/buecher" -- src: hdd_data/music - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/music" -- src: hdd_data/papa_backup - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/papa_backup" -- src: hdd_data/programme - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/programme" -- src: hdd_data/pve_backup - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/pve_backup" -- src: hdd_data/restic - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/restic" -- src: hdd_data/scans - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/scans" -- src: hdd_data/tmp - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" -- src: hdd_data/videos - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/videos" -- src: hdd_data/vm - dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/vm" - -## todo ssh konfig in datei statt inline? -# nach host vars +# --- +# rsync_mirror_user_group: "{{ rsync_mirror_user }}" +# rsync_mirror_user: rsync_mirror +# rsync_mirror_bw_limit: "2m" # 2 Megabytes +# rsync_mirror_timer: '*-*-* 23:00:00' # jeden Tag um 2300 +# +# rsync_mirror_private_key: "{{ lookup('viczem.keepass.keepass', 'rsync_mirror_private_key', 'notes') }}" +# rsync_mirror_public_key: "{{ lookup('viczem.keepass.keepass', 'rsync_mirror_public_key', 'notes') }}" +# +# rsync_mirror_dirs: # "/" beachten! +# - src: /hdd_data/tmp +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" +# - src: hdd_data/archiv +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/archiv" +# - src: hdd_data/backup +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/backup" +# - src: hdd_data/bilder +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/bilder" +# - src: hdd_data/buecher +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/buecher" +# - src: hdd_data/music +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/music" +# - src: hdd_data/papa_backup +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/papa_backup" +# - src: hdd_data/programme +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/programme" +# - src: hdd_data/pve_backup +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/pve_backup" +# - src: hdd_data/restic +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/restic" +# - src: hdd_data/scans +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/scans" +# - src: hdd_data/tmp +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" +# - src: hdd_data/videos +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/videos" +# - src: hdd_data/vm +# dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/vm" +#