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

16 lines
405 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
2022-10-19 00:16:16 +02:00
become: "{{ do_become }}"
2022-04-15 15:51:58 +02:00
lineinfile:
path: /etc/sudoers
line: "{{ item }} ALL=(ALL) NOPASSWD: /usr/sbin/zfs,/usr/sbin/zpool"
loop: "{{ zfs_users }}"