This repository has been archived by the owner on Mar 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #104 from mirceaulinic/JINJA-TPL
Jinja SNMP template
- Loading branch information
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{% if (location is defined) and location %} | ||
no snmp-server location "{{location}}" | ||
{% endif %} | ||
{% if (contact is defined) and contact %} | ||
no snmp-server contact "{{contact}}" | ||
{% endif %} | ||
{% if (chassis_id is defined) and chassis_id %} | ||
no snmp-server chassis-id "{{chassis_id}}" | ||
{% endif %} | ||
{% if (community is defined) and community %} | ||
{% for comm_name, comm_details in community.iteritems() %} | ||
no community {{comm_name}} | ||
{% endfor %} | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% if (location is defined) and location %} | ||
snmp-server location "{{location}}" | ||
{% endif %} | ||
{% if (contact is defined) and contact %} | ||
snmp-server contact "{{contact}}" | ||
{% endif %} | ||
{% if (chassis_id is defined) and chassis_id %} | ||
snmp-server chassis-id "{{chassis_id}}" | ||
{% endif %} | ||
{% if (community is defined) and community %} | ||
{% for comm_name, comm_details in community.iteritems() %} | ||
{% if (comm_details is defined) and comm_details %} | ||
{% if (comm_details.get('mode') is defined) and comm_details.get('mode') == 'rw' %} | ||
community {{comm_name}} rw | ||
{% else %} | ||
community {{comm_name}} ro | ||
{% endif %} | ||
{% else %} | ||
community {{comm_name}} ro | ||
{% endif %} | ||
{% endfor %} | ||
{% endif %} |