From 12ab5a96a21cbc8c44e903a349f98a3b25c3ae28 Mon Sep 17 00:00:00 2001 From: DerLinkman Date: Tue, 26 May 2026 21:46:14 +0200 Subject: [PATCH] add sysctl configuration (swappiness) --- roles/bootstrap/tasks/configure-sysctl.yml | 9 +++++++++ roles/bootstrap/tasks/main.yml | 5 ++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 roles/bootstrap/tasks/configure-sysctl.yml diff --git a/roles/bootstrap/tasks/configure-sysctl.yml b/roles/bootstrap/tasks/configure-sysctl.yml new file mode 100644 index 0000000..f3841fe --- /dev/null +++ b/roles/bootstrap/tasks/configure-sysctl.yml @@ -0,0 +1,9 @@ +--- +- name: Configure swappiness to reduce swap usage + become: yes + ansible.posix.sysctl: + name: vm.swappiness + value: 10 + state: present + reload: yes + when: ansible_facts['virtualization_type'] != "lxc" \ No newline at end of file diff --git a/roles/bootstrap/tasks/main.yml b/roles/bootstrap/tasks/main.yml index cd271cd..1ea047c 100644 --- a/roles/bootstrap/tasks/main.yml +++ b/roles/bootstrap/tasks/main.yml @@ -18,4 +18,7 @@ tags: ssh - import_tasks: setup-bashrc.yml - tags: bashrc \ No newline at end of file + tags: bashrc + +- import_tasks: configure-sysctl.yml + tags: sysctl \ No newline at end of file