From 4f12625afd4120b2d858b77ed4c7e1f6d9627101 Mon Sep 17 00:00:00 2001 From: ben Date: Fri, 24 May 2024 17:37:04 +1000 Subject: [PATCH] Control snmp listen in observium --- data/common.yaml | 3 +++ manifests/init.pp | 1 + manifests/snmp.pp | 1 + spec/data/common.yaml | 2 +- 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/data/common.yaml b/data/common.yaml index cfac302..b3ccd02 100644 --- a/data/common.yaml +++ b/data/common.yaml @@ -14,6 +14,9 @@ observium::snmpv3_authpass: "setme1234" observium::snmpv3_authalgo: "SHA" observium::snmpv3_cryptopass: "setme1234" observium::snmpv3_cryptoalgo: "AES" +observium::snmpd_agentaddress: + - udp:127.0.0.1:161 + - udp6:[::1]:161 observium::mib_locations: - /opt/observium/mibs/rfc - /opt/observium/mibs/net-snmp diff --git a/manifests/init.pp b/manifests/init.pp index b6cb0a2..c5d1cf7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -174,6 +174,7 @@ Enum['SHA','MD5'] $snmpv3_authalgo, String $snmpv3_cryptopass, Enum['AES','DES'] $snmpv3_cryptoalgo, + Array $snmpd_agentaddress, # need to document if this stays in module Array $mib_locations, Array $additional_mib_location = [], Array $additional_snmp_conf_options = [], diff --git a/manifests/snmp.pp b/manifests/snmp.pp index 800072b..16b138f 100644 --- a/manifests/snmp.pp +++ b/manifests/snmp.pp @@ -29,6 +29,7 @@ # Setup SNMP class with snmpv3 user class { 'snmp': snmpd_config => ["rouser ${observium::snmpv3_authname} ${observium::snmpv3_authlevel}"], + agentaddress => $observium::snmpd_agentaddress, service_config_dir_group => $ubuntu2004user, service_config_dir_owner => $ubuntu2004user, varnetsnmp_owner => $ubuntu2004user, diff --git a/spec/data/common.yaml b/spec/data/common.yaml index c7dafe1..5a6b434 100644 --- a/spec/data/common.yaml +++ b/spec/data/common.yaml @@ -1,3 +1,3 @@ --- -snmp::agentaddress: +observium::snmpd_agentaddress: - udp:127.0.0.1:161 \ No newline at end of file