deploy-base/roles/zfs/tasks/main.yml

40 lines
1.3 KiB
YAML
Raw Normal View History

2019-02-26 03:49:51 +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" ])
- name: include zfs installation tasks (Ubuntu)
include_tasks: ubuntu.yml
2019-06-14 01:56:43 +00:00
when: ansible_distribution in ["Ubuntu"]
- 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
# does not adjust to 20% of each host, depends on consistency between hosts - inconsistency leads to disproportionate allocations
- name: set zfs_arc_max to 20% installed memory ({{ zfs_arc_size_bytes }} bytes)
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...
#- name: create zpool
# command: "zpool create -f -O compression=lz4 data {{ zfs_disk }} -o ashift=13 -O secondarycache=all"
# args:
# creates: /etc/zvol/data/*