diff --git a/group_vars/pbs.yml b/group_vars/pbs.yml index 358c4634..6520ac76 100644 --- a/group_vars/pbs.yml +++ b/group_vars/pbs.yml @@ -1,7 +1,4 @@ --- -### mgrote_rsync -rsync_host_role: destination - ### mgrote_netplan netplan_configure: false diff --git a/group_vars/pve.yml b/group_vars/pve.yml index 1225340a..b2b56dcc 100644 --- a/group_vars/pve.yml +++ b/group_vars/pve.yml @@ -1,7 +1,4 @@ --- -### mgrote_rsync -rsync_host_role: source - ### mgrote_netplan netplan_configure: false diff --git a/host_vars/pbs.mgrote.net.yml b/host_vars/pbs.mgrote.net.yml index 132f04d9..52d4e97c 100644 --- a/host_vars/pbs.mgrote.net.yml +++ b/host_vars/pbs.mgrote.net.yml @@ -167,3 +167,6 @@ sanoid_datasets: recursive: 'no' # noqa yaml[truthy] snapshots: true template: '14tage' + +### mgrote_rsync +rsync_host_role: destination diff --git a/host_vars/pve5.mgrote.net.yml b/host_vars/pve5.mgrote.net.yml index 43c991cb..459917ff 100644 --- a/host_vars/pve5.mgrote.net.yml +++ b/host_vars/pve5.mgrote.net.yml @@ -9,7 +9,6 @@ ## hdd_data "neu" ### sudo zpool create -o ashift=12 -o feature@encryption=enabled -O encryption=on -O keylocation=prompt -O keyformat=passphrase hdd_data /dev/disk/by-id/ata-ST18000NM003D-3DL103_ZVTBSAYS - # mgrote.zfs_manage_datasets ### mgrote_zfs_extra # Variablen für mgrote.zfs_health/trim/scrub/zed/arc_mem/ sind zusammengefasst unter zfs_extra_* @@ -229,6 +228,7 @@ pve_pbs_datastore: 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_host_role: source rsync_mirror_dirs: # bei Src+Dest KEIN "/" am Ende - src: /hdd_data/tmp dest: "{{ rsync_mirror_user }}@pbs.mgrote.net:/backup/pve5/tmp" diff --git a/roles/mgrote_rsync/tasks/main.yml b/roles/mgrote_rsync/tasks/main.yml index 55583b95..af0f694b 100644 --- a/roles/mgrote_rsync/tasks/main.yml +++ b/roles/mgrote_rsync/tasks/main.yml @@ -1,18 +1,21 @@ --- -- name: Include user tasks - ansible.builtin.include_tasks: user.yml +- name: Block + when: ("'source' in rsync_host_role") or ("'destination' in rsync_host_role") + block: + - name: Include user tasks + ansible.builtin.include_tasks: user.yml -- name: Ensure packages are present - become: true - ansible.builtin.package: - name: - - rsync - state: present + - name: Ensure packages are present + become: true + ansible.builtin.package: + name: + - rsync + state: present -- name: Include source tasks - ansible.builtin.include_tasks: source.yml - when: "'source' in rsync_host_role" + - name: Include source tasks + ansible.builtin.include_tasks: source.yml + when: "'source' in rsync_host_role" -- name: Include destination tasks - ansible.builtin.include_tasks: destination.yml - when: "'destination' in rsync_host_role" + - name: Include destination tasks + ansible.builtin.include_tasks: destination.yml + when: "'destination' in rsync_host_role"