From 05c7785d7c6b74bf0d793221fb441062564b12ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iwan=20Cl=C3=A9ment?= Date: Sun, 29 Apr 2018 20:19:32 +0200 Subject: [PATCH] Config swappiness --- linux/VMSwappiness.sls | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 linux/VMSwappiness.sls 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 %}