2019-02-26 03:49:51 +00:00
|
|
|
---
|
|
|
|
|
2020-04-19 06:04:02 +00:00
|
|
|
- name: include zfs-release tasks (CentOS/RHEL/Fedora)
|
2020-04-19 07:11:36 +00:00
|
|
|
include_tasks: zfs-release.yml
|
|
|
|
when: ('zfs-release' not in ansible_facts.packages) and (ansible_distribution in ["CentOS" , "Red Hat Enterprise Linux", "Fedora" ])
|
2020-04-18 00:40:13 +00:00
|
|
|
|
2020-04-19 06:04:02 +00:00
|
|
|
- name: include zfs installation tasks (Ubuntu)
|
|
|
|
include_tasks: ubuntu.yml
|
2019-06-14 01:56:43 +00:00
|
|
|
when: ansible_distribution in ["Ubuntu"]
|
|
|
|
|
2020-04-19 06:04:02 +00:00
|
|
|
- name: include zfs installation tasks (CentOS/RHEL/Fedora)
|
|
|
|
include_tasks: el.yml
|
|
|
|
when: (ansible_distribution in ["CentOS" , "Red Hat Enterprise Linux", "Fedora" ] and not is_atomic)
|
2019-02-26 03:49:51 +00:00
|
|
|
|
|
|
|
- name: load zfs module
|
|
|
|
modprobe:
|
|
|
|
name: zfs
|
|
|
|
state: present
|
|
|
|
|
|
|
|
- name: add zfs to modules-load.d
|
|
|
|
copy:
|
|
|
|
dest: "/etc/modules-load.d/zfs.conf"
|
|
|
|
content: |
|
|
|
|
zfs
|
2019-03-31 01:10:57 +00:00
|
|
|
register: zfsload
|
2019-02-26 03:49:51 +00:00
|
|
|
|
2019-06-14 01:18:09 +00:00
|
|
|
# does not adjust to 20% of each host, depends on consistency between hosts - inconsistency leads to disproportionate allocations
|
2020-06-04 02:13:26 +00:00
|
|
|
- name: set zfs_arc_max to 20% of system memory
|
2019-06-14 01:18:09 +00:00
|
|
|
lineinfile:
|
|
|
|
path: "/etc/modprobe.d/zfs.conf"
|
|
|
|
regexp: '^options zfs zfs_arc_max='
|
|
|
|
line: 'options zfs zfs_arc_max="{{ zfs_arc_size_bytes }}"'
|
|
|
|
create: yes
|
2019-03-31 01:10:57 +00:00
|
|
|
|
|
|
|
# really bad idempotence in here...
|
2020-04-19 06:04:02 +00:00
|
|
|
#- name: create zpool
|
|
|
|
# command: "zpool create -f -O compression=lz4 data {{ zfs_disk }} -o ashift=13 -O secondarycache=all"
|
|
|
|
# args:
|
|
|
|
# creates: /etc/zvol/data/*
|