diff --git a/roles/zfs/defaults/main.yml b/roles/zfs/defaults/main.yml new file mode 100644 index 000000000..8f97660 --- /dev/null +++ b/roles/zfs/defaults/main.yml @@ -0,0 +1,6 @@ +--- +ZFS_PKGS: + - kernel-devel + - "@Development tools" + - dkms + - zfs diff --git a/roles/zfs/tasks/main.yml b/roles/zfs/tasks/main.yml index f30dc5c..6d1c3c0 100644 --- a/roles/zfs/tasks/main.yml +++ b/roles/zfs/tasks/main.yml @@ -43,13 +43,8 @@ - name: install zfs and dkms package: - name: "{{ item }}" + name: "{{ ZFS_PKGS | difference(ansible_facts.packages) }}" state: present - with_items: - - kernel-devel - - "@Development tools" - - dkms - - zfs register: zfs_installed when: ansible_distribution in ["CentOS" , "Red Hat Enterprise Linux", "Fedora" ] and not is_atomic