init
This commit is contained in:
commit
883f31932e
169 changed files with 5676 additions and 0 deletions
37
ansible/roles/host/tasks/setup-zram.yml
Normal file
37
ansible/roles/host/tasks/setup-zram.yml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
---
|
||||
-
|
||||
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
|
||||
Loading…
Add table
Add a link
Reference in a new issue