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

16 lines
392 B
YAML
Raw Normal View History

2022-04-15 15:51:58 +02:00
- name: Check if ZFS is installed
ansible.builtin.stat:
path: "/usr/sbin/zfs"
register: zfs_bin
- name: Install ZFS
when: not zfs_bin.stat.exists
include_tasks: install.yml
- name: Give user passwordless access to ZFS commands
become: true
lineinfile:
path: /etc/sudoers
line: "{{ item }} ALL=(ALL) NOPASSWD: /usr/sbin/zfs,/usr/sbin/zpool"
loop: "{{ zfs_users }}"