infrastructure/ansible/roles/zfs/tasks/main.yml

34 lines
711 B
YAML
Raw Normal View History

- name: Set module options
template:
src: files/zfs-modprobe.conf
dest: /etc/modprobe.d/zfs.conf
mode: "0644"
become: true
2020-07-26 18:03:09 +01:00
- name: Locate zpool command
command:
cmd: which zpool
strip_empty_ends: true
register: which_zpool
changed_when: false
become: true
2020-07-26 22:17:28 +01:00
- name: ZFS Scrub
cron:
name: scrub {{ item }} ZFS pool
2021-05-30 13:55:44 +01:00
hour: 5
minute: 0
weekday: 5
job: "{{ which_zpool.stdout }} scrub {{ item }}"
become: true
2021-01-09 20:52:51 +00:00
loop: "{{ zpools_to_scrub }}"
2020-07-26 22:17:28 +01:00
- 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
2020-07-26 18:03:09 +01:00
- name: Sanoid
include: sanoid.yml