{% 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 %}