diff --git a/roles/el/files/zram-generator.conf b/roles/el/files/zram-generator.conf new file mode 100644 index 0000000..a5432f9 --- /dev/null +++ b/roles/el/files/zram-generator.conf @@ -0,0 +1,9 @@ +# This config file enables a /dev/zram0 device with the default settings: +# — size — same as available RAM or 8GB, whichever is less +# — compression — most likely lzo-rle +# +# To disable, uninstall zram-generator-defaults or create empty +# /etc/systemd/zram-generator.conf file. +[zram0] +zram-fraction = 1.0 +max-zram-size = 8192 diff --git a/roles/el/tasks/main.yml b/roles/el/tasks/main.yml index 52d040b..d86933a 100644 --- a/roles/el/tasks/main.yml +++ b/roles/el/tasks/main.yml @@ -21,3 +21,4 @@ - import_tasks: solokeys.yml - import_tasks: packagekit.yml - import_tasks: vscode.yml +- import_tasks: zram.yml diff --git a/roles/el/tasks/packages-cli.yml b/roles/el/tasks/packages-cli.yml index f98d7f8..34e56a1 100644 --- a/roles/el/tasks/packages-cli.yml +++ b/roles/el/tasks/packages-cli.yml @@ -71,4 +71,5 @@ - podman - toolbox - wireguard-tools + - zram-generator when: ansible_distribution_major_version == '9' diff --git a/roles/el/tasks/zram.yml b/roles/el/tasks/zram.yml new file mode 100644 index 0000000..be1b531 --- /dev/null +++ b/roles/el/tasks/zram.yml @@ -0,0 +1,20 @@ +--- +# Copyright 2021 Anthony Perkins +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +- name: Install zram-generator.conf + become: true + ansible.builtin.copy: + src: zram-generator.conf + dest: /etc/systemd/zram-generator.conf