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