{{ ansible_header | comment }} [Unit] After=network-online.target Wants=network-online.target StartLimitBurst=3 StartLimitInterval=24h [Service] Restart=on-failure RestartSec=30 EnvironmentFile=/etc/restic/{{ item.0 }}.env ExecStartPre=restic unlock ExecStart=restic backup --files-from=/etc/restic/{{ item.0 }}-includes --exclude-file=/etc/restic/{{ item.0 }}-excludes{{ restic.config[item.0].backup_extra_param | default("") }} ExecStartPost=restic forget --prune{% for freq, n in restic.config[item.0].retention %} {{ freq }} {{ n }}{% endfor %} Type=oneshot User=root