diff --git a/roles/zfs/defaults/main.yml b/roles/zfs/defaults/main.yml index 154149e..4017f28 100644 --- a/roles/zfs/defaults/main.yml +++ b/roles/zfs/defaults/main.yml @@ -56,6 +56,7 @@ zfs_repl: [] # - dataset: zpool # dest: zfs-recv@10.33.255.253:zpool # id: stor-bkp # a uniq string id, used to name the service. It must be uniq, and one will be created if not defined +# force: True # Force deletion of dest dataset if no snapshot matches # compress: lz4 # recursive: True # ssh_cipher: aes128-ctr diff --git a/roles/zfs/templates/syncoid.service.j2 b/roles/zfs/templates/syncoid.service.j2 index 2ed9cad..2758e7d 100644 --- a/roles/zfs/templates/syncoid.service.j2 +++ b/roles/zfs/templates/syncoid.service.j2 @@ -4,7 +4,7 @@ Description=Sync ZFS datasets [Service] Type=oneshot PrivateTmp=yes -ExecStart=/sbin/syncoid --identifier={{ item.1.id }} --force-delete {% if item.1.compress | default('lz4') is string %}--compress={{ item.1.compress | default('lz4') }} {%elif item.1.compress | default('lz4') == True %}--compress {% endif %}{% if item.1.recursive | default(True) == True %}--recursive{% endif %} {% if item.1.skip_parent | default(True) == True %}--skip-parent {% endif %} --sshcipher={{ item.1.ssh_cipher | default('aes128-ctr') }} {% if item.1.ssh_port is defined %}--sshport={{ item.1.ssh_port }} {% endif %}{% if item.1.bw_limit is defined %}--source-bwlimit={{ item.1.bw_limit }} {% endif %}{{ item.1.syncoid_opts | default('') }} {{ item.1.dataset }} {{ item.1.dest }} +ExecStart=/sbin/syncoid --identifier={{ item.1.id }}{% if item.1.force | default(True) %} --force-delete {% endif %}{% if item.1.compress | default('lz4') is string %}--compress={{ item.1.compress | default('lz4') }} {%elif item.1.compress | default('lz4') == True %}--compress {% endif %}{% if item.1.recursive | default(True) == True %}--recursive{% endif %} {% if item.1.skip_parent | default(True) == True %}--skip-parent {% endif %} --sshcipher={{ item.1.ssh_cipher | default('aes128-ctr') }} {% if item.1.ssh_port is defined %}--sshport={{ item.1.ssh_port }} {% endif %}{% if item.1.bw_limit is defined %}--source-bwlimit={{ item.1.bw_limit }} {% endif %}{{ item.1.syncoid_opts | default('') }} {{ item.1.dataset }} {{ item.1.dest }} {% if item.1.max_duration is defined %} TimeoutSec={{ item.1.max_duration }} {% endif %}