-
Notifications
You must be signed in to change notification settings - Fork 49
/
map.jinja
84 lines (76 loc) · 2.43 KB
/
map.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{# Debian (up to and excluding 9.x 'Stretch') uses snmpd init script for both snmpd/snmptrapd! #}
{% load_yaml as snmp %}
pkg: net-snmp
service: snmpd
servicetrap: snmptrapd
config: /etc/snmp/snmpd.conf
configtrap: /etc/snmp/snmptrapd.conf
configagent: /etc/snmp/snmp.conf
mibsdir: /usr/share/snmp/mibs
source: salt://snmp/files/snmpd.conf
sourcetrap: salt://snmp/files/snmptrapd.conf
sourceagent: salt://snmp/files/snmp.conf
trapdargs: -Lsd -p /var/run/snmptrapd.pid
rootgroup: root
{% endload %}
{% load_yaml as platform_specific %}
RedHat:
pkg: net-snmp
pkgutils: net-snmp-utils
options: /etc/sysconfig/snmpd
optionstrap: /etc/sysconfig/snmptrapd
sourceoptions: salt://snmp/files/snmpd.options
sourceoptionstrap: salt://snmp/files/snmptrapd.options
Debian:
pkg: snmpd
pkgutils: snmp
configdefault: /etc/default/snmpd
sourcedefault: salt://snmp/files/snmpd.default
snmpdargs: -Lsd -Lf /dev/null -u snmp -g snmp -I -smux,mteTrigger,mteTriggerConf -p /var/run/snmpd.pid
mibs:
snmpdrun: "yes"
trapdrun: "no"
Suse:
pkg: net-snmp
pkgutils: net-snmp
options: /etc/sysconfig/net-snmp
sourceoptions: salt://snmp/files/snmpd.options.suse
sourceoptionstrap: salt://snmp/files/snmptrapd.options.suse
Gentoo:
pkg: net-analyzer/net-snmp
configdefault: /etc/conf.d/snmpd
sourcedefault: salt://snmp/files/snmpd.confd
snmpdargs: -I -smux
mibs:
snmpdrun: "yes"
trapdrun: "no"
FreeBSD:
config: /usr/local/etc/snmp/snmpd.conf
pkg: net-snmp
pkgutils: net-snmp
rootgroup: wheel
fallback: {}
{% endload %}
{% load_yaml as rhel_specific %}
'7':
snmpdargs: '-LS0-6d'
'6':
snmpdargs: '-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a'
'5':
snmpdargs: '-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a'
{% endload %}
{% set platform_addition = salt['grains.filter_by'](platform_specific, default='fallback') %}
{% set rhel_addition = salt['grains.filter_by'](rhel_specific, grain='osmajorrelease', default='default') %}
{% set user_override = salt['pillar.get']('snmp', {}) %}
{% do snmp.update(platform_addition) %}
{% if rhel_addition %}
{% do snmp.update(rhel_addition) %}
{% endif %}
{% import_yaml "snmp/codenamemap.yaml" as codemap %}
{% set oscode = salt['grains.filter_by'](codemap, grain='oscodename', default=None) %}
{% if oscode is not none %}
{% do snmp.update(oscode) %}
{% endif %}
{% if user_override %}
{% do snmp.update(user_override) %}
{% endif %}