-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing SNMP server community #393
Conversation
Hi @xaviramon Thanks for the PR. After looking at this first commit, we should update data model like this: snmp_server:
communities:
< community_name_1 >:
access: < ro | rw >
access_list_ipv4:
name: < acl_ipv4_name >
access_list_ipv6:
name: < acl_ipv6_name >
view: <view_name >
< community_name_2 >:
access: < ro | rw >
access_list_ipv4:
name: < acl_ipv4_name >
access_list_ipv6:
name: < acl_ipv6_name >
view: <view_name > Then, in template, you might change the following:
A potential fix is diff --git a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/snmp-settings.j2 b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/snmp-settings.j2
index 9f9c44a4..5e6832df 100644
--- a/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/snmp-settings.j2
+++ b/ansible_collections/arista/avd/roles/eos_cli_config_gen/templates/eos/snmp-settings.j2
@@ -19,8 +19,8 @@ snmp-server view {{ view['name'] }} {{ view['MIB_family_name'] }} {% if view['in
{% endfor %}
{% endif %}
{% if snmp_server.communities is defined and snmp_server.communities is not none %}
-{% for community in communities | arista.avd.natural_sort %}
-snmp-server community {{ community }} {% if snmp_server.communities[community].view is not none %}view {{ snmp_server.communities[community].view }} {% endif %}{% if snmp_server.communities[community].access is defined %} {{ snmp_server.communities[community].access }} {% else %} ro {% endif %} {% if snmp_server.communities[community].access_list_ipv6.name is not none %} ipv6 {{ snmp_server.communities[community].access_list_ipv6.name }} {% endif %}{% if snmp_server.communities[community].access_list_ipv4.name is not none %}{{ snmp_server.communities[community].access_list_ipv4.name }} {% endif %}
+{% for community in snmp_server.communities | arista.avd.natural_sort %}
+snmp-server community {{ community }} {% if snmp_server.communities[community].view is defined %}view {{ snmp_server.communities[community].view }} {% endif %}{% if snmp_server.communities[community].access is defined %} {{ snmp_server.communities[community].access }} {% else %} ro {% endif %} {% if snmp_server.communities[community].access_list_ipv6.name is defined %} ipv6 {{ snmp_server.communities[community].access_list_ipv6.name }} {% endif %}{% if snmp_server.communities[community].access_list_ipv4.name is defined %}{{ snmp_server.communities[community].access_list_ipv4.name }} {% endif %}
{% endfor %}
{% endif %}
{% if snmp_server.groups is defined and snmp_server.groups is not none %} |
Is it possible to add access-list for snmp-server as well additionally to per community? snmp-server ipv4 access-list ACL-SNMP vrf default |
@titom73 Changes implemented and pushed. |
Need to be investigated with #447 as both are covering more or less the same perimeter. |
Please review it with @aphillipps and include the documentation of my change in #377 Thanks |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Is this PR abandoned or are there any other issues as to why it's not merged? |
Closing as PR is stale, and data model changed for snmp. |
Change Summary
Types of changes
Related Issue(s)
Fixes #201
Component(s) name
Proposed changes
How to test
Checklist:
pre-commit
,make linting
andmake sanity-lint
).