THi, new to this. . . . Testing out a Ansible play to update the swappiness setting on a test box.
---
- hosts: "{{ target }}"
become: yes
tasks:
- name: swapness
lineinfile:
path: /etc/sysctl.conf
state: present
regexp: vm.swappiness=*
line: vm.swappiness=6
Currently, it is set to vm.swappiness=4 but running the above does not change that.
the way I read the logic is...
look for a line with "vm.swappiness=" and replace it with "vm.swappiness=6"