diff --git a/linux/VMSwappiness.sls b/linux/VMSwappiness.sls new file mode 100644 index 0000000..55c6ffc --- /dev/null +++ b/linux/VMSwappiness.sls @@ -0,0 +1,23 @@ +{% if grains['kernel'] == 'Linux' %} + {% if grains['virtual'] == 'qemu' %} + /etc/sysctl.conf: + file.append: + - makedirs: True + - text: vm.swappiness = 1 + {% elif grains['virtual'] == 'LXC' %} + /etc/sysctl.conf: + file.append: + - makedirs: True + - text: vm.swappiness = 5 + {% elif grains['os'] == 'Fedora' %} + /etc/sysctl.conf: + file.append: + - makedirs: True + - text: vm.swappiness = 10 + {% elif grains['os'] == 'CentOS' %} + /etc/sysctl.conf: + file.append: + - makedirs: True + - text: vm.swappiness = 25 + {% endif %} +{% endif %}