From 6f6494d179134f8cccc1056a29c023b671ef8924 Mon Sep 17 00:00:00 2001 From: Taoyu Li Date: Wed, 11 Apr 2018 00:41:27 +0000 Subject: [PATCH] [snmp] support multiple community strings --- dockers/docker-snmp-sv2/snmpd.conf.j2 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dockers/docker-snmp-sv2/snmpd.conf.j2 b/dockers/docker-snmp-sv2/snmpd.conf.j2 index b46871dfd6f8..32ce30785b28 100644 --- a/dockers/docker-snmp-sv2/snmpd.conf.j2 +++ b/dockers/docker-snmp-sv2/snmpd.conf.j2 @@ -42,7 +42,13 @@ view systemonly included .1.3.6.1.2.1.1 view systemonly included .1.3.6.1.2.1.25.1 # Default access to basic system info +{% if snmp_rocommunity is string %} rocommunity {{ snmp_rocommunity }} +{% elif snmp_rocommunity is iterable %} +{% for community in snmp_rocommunity %} +rocommunity {{ community }} +{% endfor %} +{% endif %} ###############################################################################