From 90deddcc78ad9367714865d3044426fa03c94c03 Mon Sep 17 00:00:00 2001 From: Danny Smit Date: Thu, 24 Nov 2022 16:39:34 +0100 Subject: [PATCH] feat: add debian releases --- snmp/codenamemap.yaml | 33 +++++++++++++++++++++ snmp/files/snmpd-systemd-dropin.options | 16 ++++++++++ snmp/files/snmptrapd-systemd-dropin.options | 12 ++++++++ snmp/options.sls | 1 + snmp/optionstrap.sls | 1 + 5 files changed, 63 insertions(+) create mode 100644 snmp/files/snmpd-systemd-dropin.options create mode 100644 snmp/files/snmptrapd-systemd-dropin.options diff --git a/snmp/codenamemap.yaml b/snmp/codenamemap.yaml index 3877d9f..6e6db5b 100644 --- a/snmp/codenamemap.yaml +++ b/snmp/codenamemap.yaml @@ -11,3 +11,36 @@ stretch: optionstrap: /etc/systemd/system/snmptrapd.service sourceoptions: salt://snmp/files/snmpd-systemd.options sourceoptionstrap: salt://snmp/files/snmptrapd-systemd.options + +buster: + # use the default OS parameters except for -LS6d (which was -Lsd) + # yamllint disable-line rule:line-length + snmpdargs: -LS6d -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f + # the value null means that the default OS parameters should be used + trapdargs: null + options: /etc/systemd/system/snmpd.service.d/10-snmpd.conf + optionstrap: /etc/systemd/system/snmptrapd.service.d/10-snmptrapd.conf + sourceoptions: salt://snmp/files/snmpd-systemd-dropin.options + sourceoptionstrap: salt://snmp/files/snmptrapd-systemd-dropin.options + +bullseye: + # use the default OS parameters except for -LS6d (which was -Lsd) + # yamllint disable-line rule:line-length + snmpdargs: -LS6d -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f + # the value null means that the default OS parameters should be used + trapdargs: null + options: /etc/systemd/system/snmpd.service.d/10-snmpd.conf + optionstrap: /etc/systemd/system/snmptrapd.service.d/10-snmptrapd.conf + sourceoptions: salt://snmp/files/snmpd-systemd-dropin.options + sourceoptionstrap: salt://snmp/files/snmptrapd-systemd-dropin.options + +bookworm: + # use the default OS parameters except for -LS6d (which was -Lsd) + # yamllint disable-line rule:line-length + snmpdargs: -LS6d -Lf /dev/null -u Debian-snmp -g Debian-snmp -I -smux,mteTrigger,mteTriggerConf -f + # the value null means that the default OS parameters should be used + trapdargs: null + options: /etc/systemd/system/snmpd.service.d/10-snmpd.conf + optionstrap: /etc/systemd/system/snmptrapd.service.d/10-snmptrapd.conf + sourceoptions: salt://snmp/files/snmpd-systemd-dropin.options + sourceoptionstrap: salt://snmp/files/snmptrapd-systemd-dropin.options diff --git a/snmp/files/snmpd-systemd-dropin.options b/snmp/files/snmpd-systemd-dropin.options new file mode 100644 index 0000000..9e105ef --- /dev/null +++ b/snmp/files/snmpd-systemd-dropin.options @@ -0,0 +1,16 @@ +# DO NOT EDIT +# +# This file is managed by Salt via {{ source }} +# Modify the config that generates this file instead +# +{%- from "snmp/map.jinja" import snmp with context %} + +[Service] +{%- if snmp.mibs is not none %} +Environment="MIBS='{{ snmp.mibs }}'" +{%- endif %} + +{%- if snmp.snmpdargs is not none %} +ExecStart= +ExecStart=/usr/sbin/snmpd {{ snmp.snmpdargs }} +{%- endif %} diff --git a/snmp/files/snmptrapd-systemd-dropin.options b/snmp/files/snmptrapd-systemd-dropin.options new file mode 100644 index 0000000..f4daf19 --- /dev/null +++ b/snmp/files/snmptrapd-systemd-dropin.options @@ -0,0 +1,12 @@ +# DO NOT EDIT +# +# This file is managed by Salt via {{ source }} +# Modify the config that generates this file instead +# +{%- from "snmp/map.jinja" import snmp with context %} + +[Service] +{%- if snmp.trapdargs is not none %} +ExecStart= +ExecStart=/usr/sbin/snmptrapd {{ snmp.trapdargs }} +{%- endif %} diff --git a/snmp/options.sls b/snmp/options.sls index d8da8cd..1ba6f8e 100644 --- a/snmp/options.sls +++ b/snmp/options.sls @@ -11,5 +11,6 @@ snmp_options: - user: root - group: root - mode: 644 + - makedirs: True - watch_in: - service: {{ snmp.service }} diff --git a/snmp/optionstrap.sls b/snmp/optionstrap.sls index 624787e..85c907c 100644 --- a/snmp/optionstrap.sls +++ b/snmp/optionstrap.sls @@ -11,5 +11,6 @@ trap_options: - user: root - group: root - mode: 644 + - makedirs: True - watch_in: - service: {{ snmp.servicetrap }}