feat : Add configuration options for log2ram and journald settings #30

Merged
Jose merged 4 commits from dev into main 2026-02-15 09:48:03 +01:00
2 changed files with 24 additions and 24 deletions
Showing only changes of commit 83febca09a - Show all commits

View File

@@ -31,6 +31,3 @@
ansible.builtin.systemd:
name: systemd-journald
state: restarted
Review

[Lines 24-33] [Score: 3] Adding new handlers may require testing to ensure they don't interfere with existing functionality. Always consider maintainability and potential side effects when extending playbooks.

[Lines 24-33] [Score: 3] Adding new handlers may require testing to ensure they don't interfere with existing functionality. Always consider maintainability and potential side effects when extending playbooks.
- name: Reload sysctl
ansible.builtin.command: sysctl --system

View File

@@ -40,21 +40,22 @@
mode: '0644'
register: download_archive
- name: ram | Extract log2ram
ansible.builtin.unarchive:
src: "/tmp/log2ram.tar.gz"
dest: "/tmp"
remote_src: yes
when: download_archive.changed
- name: Installation Logic
block:
- name: ram | Extract log2ram
ansible.builtin.unarchive:
src: "/tmp/log2ram.tar.gz"
dest: "/tmp"
remote_src: yes
- name: ram | Install log2ram
ansible.builtin.command: bash install.sh
args:
chdir: "/tmp/log2ram-master"
# 'creates' makes the command idempotent by checking for the binary
creates: /usr/local/bin/log2ram
- name: ram | Install log2ram
ansible.builtin.command: bash install.sh
args:
chdir: "/tmp/log2ram-master"
# 'creates' makes the command idempotent by checking for the binary
creates: /usr/local/bin/log2ram
notify: Restart log2ram
when: download_archive.changed
notify: Restart log2ram
# Configure log2ram
@@ -93,11 +94,13 @@
# Enable log2ram on boot
- name: ram | Configure memory tuning sysctl
ansible.builtin.copy:
dest: /etc/sysctl.d/99-proxmox-memory.conf
content: |
vm.swappiness = {{ vm_swappiness }}
vm.dirty_ratio = {{ vm_dirty_ratio }}
vm.dirty_background_ratio = {{ vm_dirty_background_ratio }}
mode: '0644'
notify: Reload sysctl
ansible.posix.sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/99-proxmox-memory.conf
reload: yes
loop:
- { name: 'vm.swappiness', value: "{{ vm_swappiness }}" }
- { name: 'vm.dirty_ratio', value: "{{ vm_dirty_ratio }}" }
- { name: 'vm.dirty_background_ratio', value: "{{ vm_dirty_background_ratio }}" }