68 lines
1.3 KiB
YAML
68 lines
1.3 KiB
YAML
- name: Install dependencies for Arch
|
|
package:
|
|
name: "{{ item }}"
|
|
loop:
|
|
- perl
|
|
- perl-capture-tiny
|
|
- perl-config-inifiles
|
|
- pv
|
|
- lzop
|
|
when: ansible_os_family == 'Archlinux'
|
|
become: true
|
|
|
|
- name: Install dependencies for Debian-based distros
|
|
package:
|
|
name: "{{ item }}"
|
|
loop:
|
|
- libcapture-tiny-perl
|
|
- libconfig-inifiles-perl
|
|
- pv
|
|
- lzop
|
|
- mbuffer
|
|
when: ansible_os_family == 'Debian'
|
|
become: true
|
|
|
|
- name: Download
|
|
git:
|
|
repo: https://github.com/jimsalterjrs/sanoid.git
|
|
dest: /opt/sanoid
|
|
version: v2.0.3
|
|
become: true
|
|
|
|
- name: Create config directory
|
|
file:
|
|
path: /etc/sanoid
|
|
state: directory
|
|
become: true
|
|
|
|
- name: Install default config
|
|
file:
|
|
src: /opt/sanoid/sanoid.defaults.conf
|
|
dest: /etc/sanoid/sanoid.defaults.conf
|
|
state: link
|
|
become: true
|
|
|
|
- name: Install executables
|
|
file:
|
|
src: /opt/sanoid/{{ item }}
|
|
dest: /usr/local/sbin/{{ item }}
|
|
state: link
|
|
loop:
|
|
- sanoid
|
|
- syncoid
|
|
- findoid
|
|
- sleepymutex
|
|
become: true
|
|
|
|
- name: Install config
|
|
template:
|
|
src: files/sanoid.conf
|
|
dest: /etc/sanoid/sanoid.conf
|
|
become: true
|
|
|
|
- name: Install cron job
|
|
cron:
|
|
name: sanoid
|
|
special_time: hourly
|
|
job: TZ=UTC /usr/local/sbin/sanoid --cron --verbose
|
|
become: true
|