Merge pull request #108 from salt-formulas/meta
Graph metadata
diff --git a/README.rst b/README.rst
index 30be47c..6170e0b 100644
--- a/README.rst
+++ b/README.rst
@@ -157,6 +157,7 @@
salt-ops-2nd:
name: salt-ops
nopasswd: false
+ setenv: true # Enable sudo -E option
runas:
- DBA
commands:
@@ -290,6 +291,23 @@
"cs_CZ.UTF-8 UTF-8":
enabled: true
+Systemd settings:
+
+.. code-block:: yaml
+
+ linux:
+ system:
+ ...
+ systemd:
+ system:
+ Manager:
+ DefaultLimitNOFILE: 307200
+ DefaultLimitNPROC: 307200
+ user:
+ Manager:
+ DefaultLimitCPU: 2
+ DefaultLimitNPROC: 4
+
Kernel
~~~~~~
@@ -316,6 +334,21 @@
- tp_smapi
- 8021q
+Configure or blacklist kernel modules with additional options to `/etc/modprobe.d` following example
+will add `/etc/modprobe.d/nf_conntrack.conf` file with line `options nf_conntrack hashsize=262144`:
+
+.. code-block:: yaml
+
+ linux:
+ system:
+ kernel:
+ module:
+ nf_conntrack:
+ option:
+ hashsize: 262144
+
+
+
Install specific kernel version and ensure all other kernel packages are
not present. Also install extra modules and headers for this kernel:
@@ -345,7 +378,7 @@
CPU
~~~
-Disable ondemand cpu mode service:
+Enable cpufreq governor for every cpu:
.. code-block:: yaml
@@ -600,6 +633,21 @@
printf "This is [company name] network.\n"
printf "Unauthorized access strictly prohibited.\n"
+Services
+~~~~~~~~
+
+Stop and disable linux service:
+
+.. code-block:: yaml
+
+ linux:
+ system:
+ service:
+ apt-daily.timer:
+ status: dead
+
+Possible status is dead (disable service by default), running (enable service by default), enabled, disabled.
+
RHEL / CentOS
^^^^^^^^^^^^^
@@ -1009,6 +1057,7 @@
enabled: true
type: dpdk_ovs_port
n_rxq: 2
+ pmd_rxq_affinity: "0:1,1:2"
bridge: br-prv
mtu: 9000
br-prv:
@@ -1039,6 +1088,7 @@
enabled: true
type: dpdk_ovs_port
n_rxq: 2
+ pmd_rxq_affinity: "0:1,1:2"
mtu: 9000
dpdk_first_nic:
name: ${_param:primary_first_nic}
@@ -1048,6 +1098,7 @@
enabled: true
type: dpdk_ovs_port
n_rxq: 2
+ pmd_rxq_affinity: "0:1,1:2"
mtu: 9000
dpdkbond0:
enabled: true
diff --git a/linux/files/governor.conf.jinja b/linux/files/governor.conf.jinja
new file mode 100644
index 0000000..026a478
--- /dev/null
+++ b/linux/files/governor.conf.jinja
@@ -0,0 +1,3 @@
+{% for cpu_core in range(salt['grains.get']('num_cpus', 1)) %}
+devices/system/cpu/cpu{{ cpu_core }}/cpufreq/scaling_governor = {{ governor }}
+{% endfor %}
diff --git a/linux/files/grafana_dashboards/system_prometheus.json b/linux/files/grafana_dashboards/system_prometheus.json
new file mode 100644
index 0000000..735155b
--- /dev/null
+++ b/linux/files/grafana_dashboards/system_prometheus.json
@@ -0,0 +1,1659 @@
+{
+ "annotations": {
+ "list": []
+ },
+ "editable": true,
+ "gnetId": null,
+ "graphTooltip": 1,
+ "hideControls": false,
+ "id": null,
+ "links": [],
+ "refresh": "1m",
+ "rows": [
+ {
+ "collapse": false,
+ "height": "250px",
+ "panels": [
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "rgba(245, 54, 54, 0.9)",
+ "rgba(237, 129, 40, 0.89)",
+ "rgba(50, 172, 45, 0.97)"
+ ],
+ "datasource": null,
+ "format": "s",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": false,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "id": 16,
+ "interval": null,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "span": 2,
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "system_uptime{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "",
+ "refId": "A",
+ "step": 60
+ }
+ ],
+ "thresholds": "",
+ "title": "Uptime",
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 1,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 5,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "cpu_usage_guest{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "guest",
+ "metric": "",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_guest_nice{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "guest_nice",
+ "metric": "",
+ "refId": "B",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_idle{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "idle",
+ "metric": "",
+ "refId": "C",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_iowait{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "iowait",
+ "metric": "",
+ "refId": "D",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_irq{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "irq",
+ "metric": "",
+ "refId": "E",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_nice{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "nice",
+ "metric": "",
+ "refId": "F",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_softirq{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "softirq",
+ "metric": "",
+ "refId": "G",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_steal{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "steal",
+ "metric": "",
+ "refId": "H",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_system{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "system",
+ "metric": "",
+ "refId": "I",
+ "step": 10
+ },
+ {
+ "expr": "cpu_usage_user{cpu=\"cpu-total\",host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "user",
+ "metric": "",
+ "refId": "J",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "CPU usage",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "percent",
+ "label": null,
+ "logBase": 1,
+ "max": "100",
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 2,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 5,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "mem_used{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "mem_buffered{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "buffered",
+ "metric": "",
+ "refId": "B",
+ "step": 10
+ },
+ {
+ "expr": "mem_cached{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "cached",
+ "metric": "",
+ "refId": "C",
+ "step": 10
+ },
+ {
+ "expr": "mem_free{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "free",
+ "metric": "",
+ "refId": "D",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Memory",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "decbytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 3,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 4,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "system_load1{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "short",
+ "metric": "system_load1",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "system_load5{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "mid",
+ "metric": "system_load1",
+ "refId": "B",
+ "step": 10
+ },
+ {
+ "expr": "system_load15{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "long",
+ "metric": "system_load1",
+ "refId": "C",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "System load",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 5,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 4,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "processes_blocked{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "blocked",
+ "metric": "",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "processes_paging{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "paging",
+ "metric": "",
+ "refId": "B",
+ "step": 10
+ },
+ {
+ "expr": "processes_running{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "running",
+ "metric": "",
+ "refId": "C",
+ "step": 10
+ },
+ {
+ "expr": "processes_sleeping{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "sleeping",
+ "metric": "",
+ "refId": "D",
+ "step": 10
+ },
+ {
+ "expr": "processes_stopped{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "stopped",
+ "metric": "",
+ "refId": "E",
+ "step": 10
+ },
+ {
+ "expr": "processes_zombie{host=\"$host\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "zombie",
+ "metric": "",
+ "refId": "F",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Processes",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": "",
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 4,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": false,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 4,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(kernel_processes_forked{host=\"$host\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "fork rate",
+ "metric": "kernel_processes_forked",
+ "refId": "A",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Process forks",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": "per second",
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ }
+ ],
+ "repeat": null,
+ "repeatIteration": null,
+ "repeatRowId": null,
+ "showTitle": true,
+ "title": "General",
+ "titleSize": "h6"
+ },
+ {
+ "collapse": false,
+ "height": 250,
+ "panels": [
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "rgba(245, 54, 54, 0.9)",
+ "rgba(237, 129, 40, 0.89)",
+ "rgba(50, 172, 45, 0.97)"
+ ],
+ "datasource": null,
+ "format": "percent",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": true,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "hideTimeOverride": false,
+ "id": 11,
+ "interval": null,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "span": 2,
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "disk_used_percent{host=\"$host\",path=\"$mount\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "refId": "A",
+ "step": 60
+ }
+ ],
+ "thresholds": "",
+ "timeFrom": null,
+ "title": "Used space on $mount",
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "cacheTimeout": null,
+ "colorBackground": false,
+ "colorValue": false,
+ "colors": [
+ "rgba(245, 54, 54, 0.9)",
+ "rgba(237, 129, 40, 0.89)",
+ "rgba(50, 172, 45, 0.97)"
+ ],
+ "datasource": null,
+ "format": "percent",
+ "gauge": {
+ "maxValue": 100,
+ "minValue": 0,
+ "show": true,
+ "thresholdLabels": false,
+ "thresholdMarkers": true
+ },
+ "hideTimeOverride": false,
+ "id": 12,
+ "interval": null,
+ "links": [],
+ "mappingType": 1,
+ "mappingTypes": [
+ {
+ "name": "value to text",
+ "value": 1
+ },
+ {
+ "name": "range to text",
+ "value": 2
+ }
+ ],
+ "maxDataPoints": 100,
+ "nullPointMode": "connected",
+ "nullText": null,
+ "postfix": "",
+ "postfixFontSize": "50%",
+ "prefix": "",
+ "prefixFontSize": "50%",
+ "rangeMaps": [
+ {
+ "from": "null",
+ "text": "N/A",
+ "to": "null"
+ }
+ ],
+ "span": 2,
+ "sparkline": {
+ "fillColor": "rgba(31, 118, 189, 0.18)",
+ "full": false,
+ "lineColor": "rgb(31, 120, 193)",
+ "show": false
+ },
+ "tableColumn": "",
+ "targets": [
+ {
+ "expr": "100 * disk_inodes_used{host=\"$host\",path=\"$mount\"} / disk_inodes_total{host=\"$host\",path=\"$mount\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "",
+ "refId": "A",
+ "step": 60
+ }
+ ],
+ "thresholds": "",
+ "timeFrom": null,
+ "title": "Used inodes on $mount",
+ "type": "singlestat",
+ "valueFontSize": "80%",
+ "valueMaps": [
+ {
+ "op": "=",
+ "text": "N/A",
+ "value": "null"
+ }
+ ],
+ "valueName": "current"
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 7,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 4,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "disk_used{host=\"$host\",path=\"$mount\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "disk_free{host=\"$host\",path=\"$mount\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "free",
+ "metric": "",
+ "refId": "B",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Usage on $mount partition",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "decbytes",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 10,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 2,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 4,
+ "stack": true,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "disk_inodes_used{host=\"$host\",path=\"$mount\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "used",
+ "metric": "",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "disk_inodes_free{host=\"$host\",path=\"$mount\"}",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "free",
+ "metric": "",
+ "refId": "B",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Inodes on $mount partition",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ }
+ ],
+ "repeat": null,
+ "repeatIteration": null,
+ "repeatRowId": null,
+ "showTitle": true,
+ "title": "File system",
+ "titleSize": "h6"
+ },
+ {
+ "collapse": false,
+ "height": 250,
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 9,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 6,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(diskio_read_bytes{host=\"$host\",name=\"$disk\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "read",
+ "metric": "",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "irate(diskio_write_bytes{host=\"$host\",name=\"$disk\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "write",
+ "metric": "",
+ "refId": "B",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Throughput on $disk",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "Bps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 1,
+ "id": 6,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 6,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(diskio_reads{host=\"$host\",name=\"$disk\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "read",
+ "metric": "diskio_reads",
+ "refId": "A",
+ "step": 10
+ },
+ {
+ "expr": "irate(diskio_writes{host=\"$host\",name=\"$disk\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "write",
+ "metric": "diskio_reads",
+ "refId": "B",
+ "step": 10
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Operations on $disk",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "ops",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ }
+ ],
+ "repeat": null,
+ "repeatIteration": null,
+ "repeatRowId": null,
+ "showTitle": true,
+ "title": "Disk",
+ "titleSize": "h6"
+ },
+ {
+ "collapse": false,
+ "height": 250,
+ "panels": [
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 0,
+ "id": 8,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 3,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(net_bytes_recv{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "rx",
+ "metric": "",
+ "refId": "A",
+ "step": 20
+ },
+ {
+ "expr": "irate(net_bytes_sent{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "tx",
+ "metric": "",
+ "refId": "B",
+ "step": 20
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Throughput on $interface",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "Bps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 0,
+ "id": 15,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 3,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(net_packets_recv{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "rx",
+ "metric": "",
+ "refId": "A",
+ "step": 20
+ },
+ {
+ "expr": "irate(net_packets_sent{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "tx",
+ "metric": "",
+ "refId": "B",
+ "step": 20
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Packets on $interface",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "pps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 0,
+ "id": 13,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 3,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(net_err_in{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "rx",
+ "metric": "",
+ "refId": "A",
+ "step": 20
+ },
+ {
+ "expr": "irate(net_err_out{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "tx",
+ "metric": "",
+ "refId": "B",
+ "step": 20
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Errors on $interface",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "pps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ },
+ {
+ "aliasColors": {},
+ "bars": false,
+ "dashLength": 10,
+ "dashes": false,
+ "datasource": null,
+ "fill": 0,
+ "id": 14,
+ "legend": {
+ "avg": false,
+ "current": false,
+ "max": false,
+ "min": false,
+ "show": true,
+ "total": false,
+ "values": false
+ },
+ "lines": true,
+ "linewidth": 1,
+ "links": [],
+ "nullPointMode": "null",
+ "percentage": false,
+ "pointradius": 5,
+ "points": false,
+ "renderer": "flot",
+ "seriesOverrides": [],
+ "spaceLength": 10,
+ "span": 3,
+ "stack": false,
+ "steppedLine": false,
+ "targets": [
+ {
+ "expr": "irate(net_drop_in{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "rx",
+ "metric": "",
+ "refId": "A",
+ "step": 20
+ },
+ {
+ "expr": "irate(net_drop_out{host=\"$host\",interface=\"$interface\"}[1m])",
+ "format": "time_series",
+ "intervalFactor": 2,
+ "legendFormat": "tx",
+ "metric": "",
+ "refId": "B",
+ "step": 20
+ }
+ ],
+ "thresholds": [],
+ "timeFrom": null,
+ "timeShift": null,
+ "title": "Dropped packets on $interface",
+ "tooltip": {
+ "shared": true,
+ "sort": 0,
+ "value_type": "individual"
+ },
+ "type": "graph",
+ "xaxis": {
+ "buckets": null,
+ "mode": "time",
+ "name": null,
+ "show": true,
+ "values": []
+ },
+ "yaxes": [
+ {
+ "format": "pps",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": "0",
+ "show": true
+ },
+ {
+ "format": "short",
+ "label": null,
+ "logBase": 1,
+ "max": null,
+ "min": null,
+ "show": true
+ }
+ ]
+ }
+ ],
+ "repeat": null,
+ "repeatIteration": null,
+ "repeatRowId": null,
+ "showTitle": true,
+ "title": "Network",
+ "titleSize": "h6"
+ }
+ ],
+ "schemaVersion": 14,
+ "style": "dark",
+ "tags": [],
+ "templating": {
+ "list": [
+ {
+ "allValue": null,
+ "current": {},
+ "datasource": "prometheus",
+ "hide": 0,
+ "includeAll": false,
+ "label": null,
+ "multi": false,
+ "name": "host",
+ "options": [],
+ "query": "label_values(cpu_usage_idle,host)",
+ "refresh": 1,
+ "regex": "",
+ "sort": 1,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allValue": null,
+ "current": {},
+ "datasource": "prometheus",
+ "hide": 0,
+ "includeAll": false,
+ "label": null,
+ "multi": false,
+ "name": "disk",
+ "options": [],
+ "query": "query_result(diskio_read_bytes{host=\"$host\"})",
+ "refresh": 1,
+ "regex": "/name=\"([^\"]+)/",
+ "sort": 1,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allValue": null,
+ "current": {},
+ "datasource": "prometheus",
+ "hide": 0,
+ "includeAll": false,
+ "label": null,
+ "multi": false,
+ "name": "mount",
+ "options": [],
+ "query": "query_result(disk_free{host=\"$host\"})",
+ "refresh": 1,
+ "regex": "/path=\"([^\"]+)/",
+ "sort": 1,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ },
+ {
+ "allValue": null,
+ "current": {},
+ "datasource": "prometheus",
+ "hide": 0,
+ "includeAll": false,
+ "label": null,
+ "multi": false,
+ "name": "interface",
+ "options": [],
+ "query": "query_result(net_bytes_recv{host=\"$host\"})",
+ "refresh": 1,
+ "regex": "/interface=\"([^\"]+)/",
+ "sort": 1,
+ "tagValuesQuery": "",
+ "tags": [],
+ "tagsQuery": "",
+ "type": "query",
+ "useTags": false
+ }
+ ]
+ },
+ "time": {
+ "from": "now-1h",
+ "to": "now"
+ },
+ "timepicker": {
+ "refresh_intervals": [
+ "5s",
+ "10s",
+ "30s",
+ "1m",
+ "5m",
+ "15m",
+ "30m",
+ "1h",
+ "2h",
+ "1d"
+ ],
+ "time_options": [
+ "5m",
+ "15m",
+ "1h",
+ "6h",
+ "12h",
+ "24h",
+ "2d",
+ "7d",
+ "30d"
+ ]
+ },
+ "timezone": "browser",
+ "title": "System",
+ "version": 31
+}
diff --git a/linux/files/modprobe.conf.jinja b/linux/files/modprobe.conf.jinja
new file mode 100644
index 0000000..2314bdb
--- /dev/null
+++ b/linux/files/modprobe.conf.jinja
@@ -0,0 +1,9 @@
+{% if module_content.get('blacklist', false) -%}
+blacklist {{ module_name }}
+{%- else -%}
+
+{%- for option, value in module_content.get('option', {}) | dictsort -%}
+options {{ module_name }} {{ option }}={{ value }}
+{%- endfor %}
+
+{%- endif %}
diff --git a/linux/files/sudoer-users b/linux/files/sudoer-users
index 4e05269..738d25d 100644
--- a/linux/files/sudoer-users
+++ b/linux/files/sudoer-users
@@ -2,6 +2,6 @@
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
{%- for user,spec in users.iteritems() %}
-{{ spec.name|default(user) }} {{ spec.get('hosts', ['ALL'])|join(',') }}=({{ spec.get('runas', ['ALL'])|join(', ') }}) {% if spec.get('nopasswd', True) %}NOPASSWD: {% endif %}{{ spec.get('commands', ['ALL'])|join(', ') }}
+{{ spec.name|default(user) }} {{ spec.get('hosts', ['ALL'])|join(',') }}=({{ spec.get('runas', ['ALL'])|join(', ') }}) {% if spec.get('nopasswd', True) %}NOPASSWD:{% endif %}{% if spec.get('setenv', False) %}SETENV:{% endif %} {{ spec.get('commands', ['ALL'])|join(', ') }}
{%- endfor %}
diff --git a/linux/files/systemd.conf b/linux/files/systemd.conf
new file mode 100644
index 0000000..36e01a5
--- /dev/null
+++ b/linux/files/systemd.conf
@@ -0,0 +1,7 @@
+{%- from "linux/map.jinja" import system with context -%}
+{%- for section, options in settings.iteritems() -%}
+[{{ section }}]
+{%- for option, value in options.iteritems() %}
+{{ option }}={{ value }}
+{%- endfor -%}
+{%- endfor -%}
diff --git a/linux/meta/grafana.yml b/linux/meta/grafana.yml
index f454e09..06efc68 100644
--- a/linux/meta/grafana.yml
+++ b/linux/meta/grafana.yml
@@ -1,4 +1,9 @@
dashboard:
- linux:
+ linux_prometheus:
+ datasource: prometheus
+ format: json
+ template: linux/files/grafana_dashboards/system_prometheus.json
+ linux_influxdb:
+ datasource: influxdb
format: json
template: linux/files/grafana_dashboards/system_influxdb.json
diff --git a/linux/meta/sensu.yml b/linux/meta/sensu.yml
index 596538b..b0ee28f 100644
--- a/linux/meta/sensu.yml
+++ b/linux/meta/sensu.yml
@@ -18,7 +18,7 @@
occurrences: 1
subscribers:
- local-linux-system
-{%- if storage.swap is defined %}
+{%- if storage.swap|length > 0 %}
local_linux_storage_swap_usage_{{ system.name|replace('.', '-') }}-{{ system.domain|replace('.', '-') }}:
command: "PATH=$PATH:/usr/lib64/nagios/plugins:/usr/lib/nagios/plugins check_swap -a -w {{ monitoring.swap.warn }} -c {{ monitoring.swap.crit }}"
interval: 60
diff --git a/linux/meta/telegraf.yml b/linux/meta/telegraf.yml
index 1cd5277..bc689ae 100644
--- a/linux/meta/telegraf.yml
+++ b/linux/meta/telegraf.yml
@@ -4,5 +4,9 @@
percpu: true
totalcpu: true
disk:
+ diskio:
+ kernel:
+ net:
mem:
+ processes:
system:
diff --git a/linux/network/dpdk.sls b/linux/network/dpdk.sls
index 6ddd856..cadc599 100644
--- a/linux/network/dpdk.sls
+++ b/linux/network/dpdk.sls
@@ -115,6 +115,7 @@
{# create override for openvswitch dependency for dpdk br-prv #}
/etc/systemd/system/ifup@{{ interface_name }}.service.d/override.conf:
file.managed:
+ - makedirs: true
- require:
- cmd: linux_network_dpdk_bridge_interface_{{ interface_name }}
- contents: |
@@ -147,8 +148,8 @@
- require:
- cmd: linux_network_dpdk_bridge_interface_{{ interface.bridge }}
- {# Multiqueue n_rxq and mtu setup on interfaces #}
- {%- elif interface.type == 'dpdk_ovs_port' and (interface.n_rxq is defined or interface.mtu is defined) %}
+ {# Multiqueue n_rxq, pmd_rxq_affinity and mtu setup on interfaces #}
+ {%- elif interface.type == 'dpdk_ovs_port' and (interface.n_rxq is defined or interface.mtu is defined or interface.pmd_rxq_affinity is defined) %}
{%- if interface.n_rxq is defined %}
@@ -160,6 +161,16 @@
{%- endif %}
+ {%- if interface.pmd_rxq_affinity is defined %}
+
+linux_network_dpdk_bridge_port_interface_pmd_rxq_affinity_{{ interface_name }}:
+ cmd.run:
+ - name: "ovs-vsctl set Interface {{ interface_name }} other_config:pmd-rxq-affinity={{ interface.pmd_rxq_affinity }} "
+ - unless: |
+ ovs-vsctl get Interface {{ interface_name }} other_config | grep 'pmd-rxq-affinity="{{ interface.pmd_rxq_affinity }}"'
+
+ {%- endif %}
+
{%- if interface.mtu is defined %}
{# MTU ovs dpdk setup on interfaces #}
diff --git a/linux/storage/init.sls b/linux/storage/init.sls
index 19d2ade..a5b78eb 100644
--- a/linux/storage/init.sls
+++ b/linux/storage/init.sls
@@ -4,15 +4,15 @@
{%- if storage.loopback|length > 0 %}
- linux.storage.loopback
{%- endif %}
+{%- if storage.lvm|length > 0 %}
+- linux.storage.lvm
+{%- endif %}
{%- if storage.mount|length > 0 %}
- linux.storage.mount
{%- endif %}
{%- if storage.swap|length > 0 %}
- linux.storage.swap
{%- endif %}
-{%- if storage.lvm|length > 0 %}
-- linux.storage.lvm
-{%- endif %}
{%- if storage.multipath.enabled %}
- linux.storage.multipath
{%- endif %}
diff --git a/linux/system/cpu.sls b/linux/system/cpu.sls
index 658457d..5292585 100644
--- a/linux/system/cpu.sls
+++ b/linux/system/cpu.sls
@@ -1,9 +1,45 @@
{%- from "linux/map.jinja" import system with context %}
{%- if system.cpu.governor is defined %}
+linux_sysfs_package:
+ pkg.installed:
+ - pkgs:
+ - sysfsutils
+ - refresh: true
+
+/etc/sysfs.d:
+ file.directory:
+ - require:
+ - pkg: linux_sysfs_package
+
ondemand_service_disable:
service.dead:
- - name: ondemand
- - enable: false
+ - name: ondemand
+ - enable: false
-{%- endif %}
\ No newline at end of file
+{%- if grains.get('virtual', None) in ['physical', None] %}
+{#- Governor cannot be set in VMs, etc. #}
+
+/etc/sysfs.d/governor.conf:
+ file.managed:
+ - source: salt://linux/files/governor.conf.jinja
+ - template: jinja
+ - user: root
+ - group: root
+ - mode: 0644
+ - defaults:
+ governor: {{ system.cpu.governor }}
+
+{% for cpu_core in range(salt['grains.get']('num_cpus', 1)) %}
+
+governor_write_sysfs_cpu_core_{{ cpu_core }}:
+ module.run:
+ - name: sysfs.write
+ - key: devices/system/cpu/cpu{{ cpu_core }}/cpufreq/scaling_governor
+ - value: {{ system.cpu.governor }}
+
+{%- endfor %}
+
+{%- endif %}
+
+{%- endif %}
diff --git a/linux/system/group.sls b/linux/system/group.sls
index 2c1c769..d990889 100644
--- a/linux/system/group.sls
+++ b/linux/system/group.sls
@@ -7,7 +7,7 @@
system_group_{{ group_name }}:
group.present:
- - name: {{ group.name }}
+ - name: {{ group.get('name', group_name) }}
{%- if group.system is defined and group.system %}
- system: True
{%- endif %}
diff --git a/linux/system/hugepages.sls b/linux/system/hugepages.sls
index af62ab8..669e254 100644
--- a/linux/system/hugepages.sls
+++ b/linux/system/hugepages.sls
@@ -27,7 +27,7 @@
- device: Hugetlbfs-kvm
- fstype: hugetlbfs
- mkmnt: true
- - opts: mode=775,gid=kvm,pagesize={{ hugepages.size }}
+ - opts: mode=775,pagesize={{ hugepages.size }}
{%- endif %}
diff --git a/linux/system/init.sls b/linux/system/init.sls
index 3961bca..13f1565 100644
--- a/linux/system/init.sls
+++ b/linux/system/init.sls
@@ -80,3 +80,9 @@
{%- if system.netconsole is defined %}
- linux.system.netconsole
{%- endif %}
+{%- if system.service is defined %}
+- linux.system.service
+{%- endif %}
+{%- if system.systemd is defined %}
+- linux.system.systemd
+{%- endif %}
diff --git a/linux/system/job.sls b/linux/system/job.sls
index c0c6b5f..f0373a4 100644
--- a/linux/system/job.sls
+++ b/linux/system/job.sls
@@ -23,6 +23,10 @@
{%- if job.dayweek is defined %}
- dayweek: '{{ job.dayweek }}'
{%- endif %}
+ {%- if job.user in system.get('user', {}).keys() %}
+ - require:
+ - user: system_user_{{ job.user }}
+ {%- endif %}
{%- else %}
cron.absent:
- name: {{ job.command }}
diff --git a/linux/system/kernel.sls b/linux/system/kernel.sls
index 3c7619e..e3e6bd1 100644
--- a/linux/system/kernel.sls
+++ b/linux/system/kernel.sls
@@ -53,6 +53,21 @@
{%- endfor %}
+{%- for module_name, module_content in system.kernel.get('module', {}).iteritems() %}
+
+/etc/modprobe.d/{{ module_name }}.conf:
+ file.managed:
+ - user: root
+ - group: root
+ - mode: 0644
+ - template: jinja
+ - source: salt://linux/files/modprobe.conf.jinja
+ - defaults:
+ module_content: {{ module_content }}
+ module_name: {{ module_name }}
+
+{%- endfor %}
+
{%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).iteritems() %}
linux_kernel_{{ sysctl_name }}:
diff --git a/linux/system/repo.sls b/linux/system/repo.sls
index 2ba2114..813c1e1 100644
--- a/linux/system/repo.sls
+++ b/linux/system/repo.sls
@@ -39,7 +39,7 @@
{%- endif %}
{%- for name, repo in system.repo.iteritems() %}
-
+{%- set name=repo.get('name', name) %}
{%- if grains.os_family == 'Debian' %}
# per repository proxy setup
@@ -183,7 +183,7 @@
- user: root
- group: root
- mode: 0644
-{%- if system.purge_repos %}
+{%- if system.purge_repos|default(False) %}
- replace: True
{%- endif %}
- defaults:
@@ -191,6 +191,12 @@
- require:
- pkg: linux_repo_prereq_pkgs
+refresh_default_repo:
+ module.wait:
+ - name: pkg.refresh_db
+ - watch:
+ - file: default_repo_list
+
{%- endif %}
{%- endif %}
diff --git a/linux/system/service.sls b/linux/system/service.sls
new file mode 100644
index 0000000..869760d
--- /dev/null
+++ b/linux/system/service.sls
@@ -0,0 +1,16 @@
+{%- from "linux/map.jinja" import system with context %}
+{%- if system.enabled %}
+
+{%- for name, service in system.service.iteritems() %}
+
+linux_service_{{ name }}:
+ service.{{ service.status }}:
+ {%- if service.status == 'dead' %}
+ - enable: {{ service.get('enabled', False) }}
+ {%- elif service.status == 'running' %}
+ - enable: {{ service.get('enabled', True) }}
+ {%- endif %}
+ - name: {{ name }}
+
+{%- endfor %}
+{%- endif %}
diff --git a/linux/system/systemd.sls b/linux/system/systemd.sls
new file mode 100644
index 0000000..d5377f1
--- /dev/null
+++ b/linux/system/systemd.sls
@@ -0,0 +1,34 @@
+{%- from "linux/map.jinja" import system with context %}
+{%- if system.enabled and grains.get('init', None) == 'systemd' %}
+
+{%- if system.systemd.system is defined %}
+linux_systemd_system_config:
+ file.managed:
+ - name: /etc/systemd/system.conf.d/90-salt.conf
+ - source: salt://linux/files/systemd.conf
+ - template: jinja
+ - makedirs: True
+ - defaults:
+ settings: {{ system.systemd.system }}
+ - watch_in:
+ - module: linux_systemd_reload
+{%- endif %}
+
+{%- if system.systemd.user is defined %}
+linux_systemd_user_config:
+ file.managed:
+ - name: /etc/systemd/user.conf.d/90-salt.conf
+ - source: salt://linux/files/systemd.conf
+ - template: jinja
+ - makedirs: True
+ - defaults:
+ settings: {{ system.systemd.user }}
+ - watch_in:
+ - module: linux_systemd_reload
+{%- endif %}
+
+linux_systemd_reload:
+ module.wait:
+ - name: service.systemctl_reload
+
+{%- endif %}
\ No newline at end of file
diff --git a/linux/system/user.sls b/linux/system/user.sls
index 70c9c51..5c6ba92 100644
--- a/linux/system/user.sls
+++ b/linux/system/user.sls
@@ -5,6 +5,14 @@
{%- if user.enabled %}
+{%- set requires = [] %}
+{%- for group in user.get('groups', []) %}
+ {%- if group in system.get('group', {}).keys() %}
+ {%- do requires.append({'group': 'system_group_'+group}) %}
+ {%- endif %}
+{%- endfor %}
+
+
system_user_{{ name }}:
user.present:
- name: {{ name }}
@@ -25,6 +33,7 @@
{%- if user.uid is defined and user.uid %}
- uid: {{ user.uid }}
{%- endif %}
+ - require: {{ requires|yaml }}
system_user_home_{{ user.home }}:
file.directory:
diff --git a/metadata/service/support.yml b/metadata/service/support.yml
index 7699edd..031dcfb 100644
--- a/metadata/service/support.yml
+++ b/metadata/service/support.yml
@@ -10,7 +10,7 @@
heka:
enabled: true
sensu:
- enabled: true
+ enabled: false
sphinx:
enabled: true
grafana:
diff --git a/tests/pillar/system.sls b/tests/pillar/system.sls
index 8d34cc6..58358f8 100644
--- a/tests/pillar/system.sls
+++ b/tests/pillar/system.sls
@@ -43,7 +43,8 @@
full_name: Test User
home: /home/test
groups:
- - root
+ - db-ops
+ - salt-ops
salt_user1:
enabled: true
name: saltuser1
@@ -58,18 +59,19 @@
uid: 9992
full_name: Salt Sudo User2
home: /home/saltuser2
+ groups:
+ - sudogroup1
group:
- testgroup:
+ test:
enabled: true
name: test
gid: 9999
system: true
db-ops:
enabled: true
- name: testgroup
salt-ops:
enabled: true
- name: sudogroup0
+ name: salt-ops
sudogroup1:
enabled: true
name: sudogroup1