--- - name: install sanoid package apt: name: sanoid state: present - name: create syncoid directory file: path: /var/lib/syncoid state: directory mode: 0700 - name: genarate ssh keypair for syncoid openssh_keypair: path: /var/lib/syncoid/id_ssh_ed25519 type: ed25519 comment: ZFS Backup syncoid@{{ host_name }} - name: generate syncoid ssh config wrapper copy: content: | #!/bin/bash exec /usr/sbin/syncoid --sshoption "UserKnownHostsFile=/var/lib/syncoid/ssh.knownhosts" --sshoption "HashKnownHosts=no" --sshkey "/var/lib/syncoid/id_ssh_ed25519" --no-sync-snap --compress zstd-fast "$@" dest: /var/lib/syncoid/syncoid_wrapper mode: 0755 - name: configure lvm to ignore zfs volumes lineinfile: path: /etc/lvm/lvm.conf backrefs: yes regexp: '^\s*#?\s*global_filter\s*=' line: ' global_filter = [ "r|/dev/zd[0-9]+|" ]' - name: create target datasets loop: "{{ zfs_syncoid_sources | dict2items }}" loop_control: loop_var: source label: "{{ source.key }}" include_tasks: datasets.yml - name: create systemd units loop: "{{ zfs_syncoid_sources | dict2items }}" loop_control: label: "{{ item.key }}" template: src: systemd.service.j2 dest: "/etc/systemd/system/syncoid-{{ item.key }}.service"