Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible_lza_install_common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Preservation
ansible_lza_install_common
Commits
3b4fe91a
Commit
3b4fe91a
authored
2 years ago
by
Jörg Sachse
Browse files
Options
Downloads
Patches
Plain Diff
fix: configure udev rule to make zram swap reboot persistent
parent
b47e36ac
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tasks/configure_swap.yml
+6
-1
6 additions, 1 deletion
tasks/configure_swap.yml
with
6 additions
and
1 deletion
tasks/configure_swap.yml
+
6
−
1
View file @
3b4fe91a
...
@@ -15,7 +15,6 @@
...
@@ -15,7 +15,6 @@
when
:
ansible_os_family == "Debian"
when
:
ansible_os_family == "Debian"
# RHEL part is based on https://www.techrepublic.com/article/how-to-enable-zram-rocky-linux/
# RHEL part is based on https://www.techrepublic.com/article/how-to-enable-zram-rocky-linux/
# Note: all that udev stuff from that guide doesn't work. We'll use CLI commands.
# More docu on zram at https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html
# More docu on zram at https://www.kernel.org/doc/html/latest/admin-guide/blockdev/zram.html
-
name
:
configure zram based swap (RedHat)
-
name
:
configure zram based swap (RedHat)
block
:
block
:
...
@@ -41,6 +40,12 @@
...
@@ -41,6 +40,12 @@
create
:
true
create
:
true
line
:
"
options
zram
num_devices=1"
line
:
"
options
zram
num_devices=1"
mode
:
"
0644"
mode
:
"
0644"
-
name
:
configure udev to initialise zram device on bootup
ansible.builtin.lineinfile
:
path
:
"
/etc/udev/rules.d/99-zram.rules"
create
:
true
line
:
"
KERNEL==
\"
zram0
\"
,
ATTR{disksize}=
\"
{{
(
ansible_facts.memtotal_mb
/
2
)
|
round
|
int
}}M
\"
,TAG+=
\"
systemd
\"
"
mode
:
"
0644"
-
name
:
find out if zram Kernel module has been loaded already
-
name
:
find out if zram Kernel module has been loaded already
ansible.builtin.command
:
"
lsmod"
ansible.builtin.command
:
"
lsmod"
register
:
kernel_modules
register
:
kernel_modules
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment