From 23376f81f77e438502a361040962bdd4d228b509 Mon Sep 17 00:00:00 2001 From: Jose Date: Sun, 15 Feb 2026 17:37:36 +0100 Subject: [PATCH] =?UTF-8?q?refactor=20=E2=99=BB=EF=B8=8F:=20Refactor=20mem?= =?UTF-8?q?ory=20calculation=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Removed unused variable and updated memory calculation to use ansible_memtotal_mb for more accurate results. --- defaults/main.yml | 1 - tasks/ram.yml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 56f713a..1c18c96 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -37,7 +37,6 @@ log2ram_ram_percent: 10 log2ram_min_size_mb: 128 log2ram_max_size_mb: 1024 -log2ram_host_memtotal_mb: "{{ host_memtotal_mb | default(4086) }}" # Journald RAM usage limit journald_runtime_max_use: "100M" diff --git a/tasks/ram.yml b/tasks/ram.yml index f8f8937..98f113e 100644 --- a/tasks/ram.yml +++ b/tasks/ram.yml @@ -6,8 +6,8 @@ - name: ram | Calculate log2ram size ansible.builtin.set_fact: - _total_ram_mb: "{{ log2ram_host_memtotal_mb }}" - _calculated_size_mb: "{{ (log2ram_host_memtotal_mb * log2ram_ram_percent / 100) | int }}" + _total_ram_mb: "{{ ansible_memtotal_mb }}" + _calculated_size_mb: "{{ (_total_ram_mb * log2ram_ram_percent / 100) | int }}" log2ram_size_mb: >- {{ [log2ram_min_size_mb,