From 909f693cbadf75bb91e100bae7d20aa319e0e17b Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Tue, 26 Jan 2021 22:02:58 +0000 Subject: [PATCH] Fix location of `zpool` command TIL lookups are executed on the host --- ansible/roles/zfs/tasks/main.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ansible/roles/zfs/tasks/main.yml b/ansible/roles/zfs/tasks/main.yml index c573175..9a02502 100644 --- a/ansible/roles/zfs/tasks/main.yml +++ b/ansible/roles/zfs/tasks/main.yml @@ -5,11 +5,19 @@ 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: "{{ lookup('pipe', 'which zpool') }} scrub {{ item }}" + job: "{{ which_zpool.stdout }} scrub {{ item }}" become: true loop: "{{ zpools_to_scrub }}"