37 lines
799 B
YAML
37 lines
799 B
YAML
---
|
|
-
|
|
name: Install zram-tools
|
|
apt:
|
|
name: zram-tools
|
|
state: present
|
|
|
|
-
|
|
name: Configure zram
|
|
copy:
|
|
dest: /etc/default/zramswap
|
|
content: |
|
|
ALGO={{ zram_algorithm | default('zstd') }}
|
|
PERCENT={{ zram_percent | default(50) }}
|
|
PRIORITY={{ zram_priority | default(100) }}
|
|
mode: '0644'
|
|
notify: restart zramswap
|
|
|
|
-
|
|
name: Enable zramswap service
|
|
systemd:
|
|
name: zramswap
|
|
enabled: true
|
|
state: started
|
|
|
|
-
|
|
name: Disable file-backed swap if present
|
|
command: swapoff /swapfile
|
|
failed_when: false
|
|
changed_when: false
|
|
|
|
-
|
|
name: Remove file-backed swap from fstab
|
|
lineinfile:
|
|
path: /etc/fstab
|
|
line: "/swapfile none swap sw 0 0"
|
|
state: absent
|