Fix location of zpool command

TIL lookups are executed on the host
This commit is contained in:
Jake Howard 2021-01-26 22:02:58 +00:00
parent 3de14efd9e
commit 909f693cba
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -5,11 +5,19 @@
mode: "0644" mode: "0644"
become: true 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 - name: ZFS Scrub
cron: cron:
name: scrub {{ item }} ZFS pool name: scrub {{ item }} ZFS pool
special_time: weekly special_time: weekly
job: "{{ lookup('pipe', 'which zpool') }} scrub {{ item }}" job: "{{ which_zpool.stdout }} scrub {{ item }}"
become: true become: true
loop: "{{ zpools_to_scrub }}" loop: "{{ zpools_to_scrub }}"