infrastructure/ansible/roles/zfs/tasks/main.yml
Jake Howard 909f693cba
Fix location of zpool command
TIL lookups are executed on the host
2021-01-26 22:02:58 +00:00

31 lines
695 B
YAML

- name: Set module options
template:
src: files/zfs-modprobe.conf
dest: /etc/modprobe.d/zfs.conf
mode: "0644"
become: true
- name: Locate zpool command
command:
cmd: which zpool
strip_empty_ends: true
register: which_zpool
changed_when: false
become: true
- name: ZFS Scrub
cron:
name: scrub {{ item }} ZFS pool
special_time: weekly
job: "{{ which_zpool.stdout }} scrub {{ item }}"
become: true
loop: "{{ zpools_to_scrub }}"
- name: Give user passwordless access to ZFS commands
lineinfile:
path: /etc/sudoers
line: "{{ user }} ALL=(ALL) NOPASSWD: /usr/sbin/zfs,/usr/sbin/zpool"
become: true
- name: Sanoid
include: sanoid.yml