Merge pull request 'refactor ♻️: Refactor memory variables and calculations' (#32) from dev into main
Reviewed-on: #32
This commit was merged in pull request #32.
This commit is contained in:
@@ -37,6 +37,7 @@ log2ram_ram_percent: 10
|
|||||||
|
|
||||||
log2ram_min_size_mb: 128
|
log2ram_min_size_mb: 128
|
||||||
log2ram_max_size_mb: 1024
|
log2ram_max_size_mb: 1024
|
||||||
|
log2ram_host_memtotal_mb: "{{ host_memtotal_mb | default(4086) }}"
|
||||||
|
|
||||||
# Journald RAM usage limit
|
# Journald RAM usage limit
|
||||||
journald_runtime_max_use: "100M"
|
journald_runtime_max_use: "100M"
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
- name: ram | Calculate log2ram size
|
- name: ram | Calculate log2ram size
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_total_ram_mb: "{{ ansible_memtotal_mb }}"
|
_total_ram_mb: "{{ log2ram_host_memtotal_mb }}"
|
||||||
_calculated_size_mb: "{{ (ansible_memtotal_mb * log2ram_ram_percent / 100) | int }}"
|
_calculated_size_mb: "{{ (log2ram_host_memtotal_mb * log2ram_ram_percent / 100) | int }}"
|
||||||
log2ram_size_mb: >-
|
log2ram_size_mb: >-
|
||||||
{{
|
{{
|
||||||
[log2ram_min_size_mb,
|
[log2ram_min_size_mb,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
ansible.builtin.command: swapoff -a
|
ansible.builtin.command: swapoff -a
|
||||||
when:
|
when:
|
||||||
- proxmox_disable_swap
|
- proxmox_disable_swap
|
||||||
- ansible_memtotal_mb >= proxmox_min_ram_mb_for_no_swap
|
- log2ram_host_memtotal_mb >= proxmox_min_ram_mb_for_no_swap
|
||||||
- active_swaps.stdout | bool
|
- active_swaps.stdout | bool
|
||||||
changed_when: active_swaps.stdout | bool
|
changed_when: active_swaps.stdout | bool
|
||||||
|
|
||||||
@@ -26,4 +26,4 @@
|
|||||||
replace: '\1# \2'
|
replace: '\1# \2'
|
||||||
when:
|
when:
|
||||||
- proxmox_disable_swap
|
- proxmox_disable_swap
|
||||||
- ansible_memtotal_mb >= proxmox_min_ram_mb_for_no_swap
|
- log2ram_host_memtotal_mb >= proxmox_min_ram_mb_for_no_swap
|
||||||
|
|||||||
Reference in New Issue
Block a user