Merge "Remove obsolete Swap alerts"
diff --git a/linux/map.jinja b/linux/map.jinja
index f4bb986..f9b9ea0 100644
--- a/linux/map.jinja
+++ b/linux/map.jinja
@@ -447,3 +447,7 @@
'netdev_budget_squeeze_rate': 0.1
},
}, grain='os_family', merge=salt['pillar.get']('linux:monitoring')) %}
+
+{%- set sysctl_min_kernel = {
+ 'net.core.netdev_budget_usecs': '4.12',
+} %}
diff --git a/linux/network/interface.sls b/linux/network/interface.sls
index 04b13ab..706af45 100644
--- a/linux/network/interface.sls
+++ b/linux/network/interface.sls
@@ -403,13 +403,21 @@
cmd.run:
- name: ifdown {{ interface_name }}
- prereq:
+ {%- if interface.type == 'eth' %}
- network: linux_interface_{{ interface_name }}
+ {%- else %}
+ - file: ovs_port_{{ interface_name }}
+ {%- endif %}
linux_interface_up_on_ipflush_{{ interface_name }}:
cmd.run:
- name: ifup {{ interface_name }}
- onchanges:
+ {%- if interface.type == 'eth' %}
- network: linux_interface_{{ interface_name }}
+ {%- else %}
+ - file: ovs_port_{{ interface_name }}
+ {%- endif %}
{%- elif interface.get('ipflush_onchange', False)%}
linux_interface_ipflush_onchange_{{ interface_name }}:
diff --git a/linux/system/kernel.sls b/linux/system/kernel.sls
index 3dc3046..59405d0 100644
--- a/linux/system/kernel.sls
+++ b/linux/system/kernel.sls
@@ -1,4 +1,5 @@
{%- from "linux/map.jinja" import system with context %}
+{%- from "linux/map.jinja" import sysctl_min_kernel %}
{%- if system.enabled %}
{%- if system.kernel is defined %}
@@ -82,13 +83,19 @@
{%- endfor %}
{%- endif %}
+{%- set cur_kernel = salt['grains.get']('kernelrelease') %}
+
{%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).items() %}
+ {%- if not sysctl_name in sysctl_min_kernel or salt['pkg.version_cmp'](cur_kernel, sysctl_min_kernel[sysctl_name]) >= 0 %}
+
linux_kernel_{{ sysctl_name }}:
sysctl.present:
- name: {{ sysctl_name }}
- value: {{ sysctl_value }}
+ {%- endif %}
+
{%- endfor %}
{%- endif %}