diff --git a/ansible-swappiness.yml b/ansible-swappiness.yml new file mode 100644 index 0000000..3dd3a79 --- /dev/null +++ b/ansible-swappiness.yml @@ -0,0 +1,18 @@ +--- +- name: Set vm.swappiness to 1 + hosts: all + become: true + + tasks: + - name: Make vm.swappiness setting persistent + lineinfile: + path: /etc/sysctl.d/99-swappines.conf + regexp: '^vm.swappiness=' + line: 'vm.swappiness=1' + create: yes + notify: + - Reload sysctl + + handlers: + - name: Reload sysctl + command: sysctl -p