Skip to content

Commit

Permalink
Added puppet-string documentation for params in snmp_agent.pp, Added …
Browse files Browse the repository at this point in the history
…# THIS FILE IS MANAGED BY PUPPET to snmp_agent template.
  • Loading branch information
michal rebisz committed Feb 18, 2020
1 parent c312bd0 commit dc2eaad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
10 changes: 9 additions & 1 deletion manifests/plugin/snmp_agent.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# https://wiki.opnfv.org/display/fastpath/SNMP+Agent+HLD
# Class: collectd::plugin::snmp_agent
#
# @see https://wiki.opnfv.org/display/fastpath/SNMP+Agent+HLD
#
# Configues snmp agent plugin.
#
# @param ensure String Passed to package and collectd::plugin resources (both). Default: present
# @param data Optional[Hash[String[1],Collectd::SNMP_AGENT::Data]] Defines scalar field, must be put outside Table block.
# @param table Hash[String[1], Collectd::SNMP_AGENT::Table] Defines a table consisting of several Data blocks being its columns
class collectd::plugin::snmp_agent(
Enum['present', 'absent'] $ensure = 'present',
Optional[Hash[String[1],Collectd::SNMP_AGENT::Data]] $data = {
Expand Down
1 change: 1 addition & 0 deletions templates/plugin/snmp_agent.conf.epp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<%- | Optional $data = undef,
Optional $table = undef,
| -%>
# THIS FILE IS MANAGED BY PUPPET
<Plugin snmp_agent>
<% if $data { -%>
<% $data.keys.sort.each |$key| { -%>
Expand Down
30 changes: 0 additions & 30 deletions types/snmp_agent/data.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,3 @@
Optional['indexkey'] => Collectd::SNMP_AGENT::IndexKey,
Optional['plugininstance'] => String,
}]
# define collectd::plugin::snmp_agent::data (
# String $ensure = 'present',
# $plugin = 'plugin',
# String $oids = undef,
# Optional[String] $type = undef,
# Optional[String] $typeinstance = undef,
# Optional[String] $scale = undef,
# Optional[String] $shift = undef,
# Optional[] $indexkey = {},
# Optional[String] $plugininstance = undef
# ) {
# include collectd
# include collectd::plugin::snmp_agent

# concat::fragment{ "collectd_plugin_snmp_agent_conf_data_${name}":
# order => '50',
# content => epp('collectd/plugin/snmp_agent/data.conf.epp', {
# 'name' => $name,
# 'plugin' => $plugin,
# 'type' => $type,
# 'typeinstance' => $typeinstance,
# 'oids' => $oids,
# 'scale' => $scale,
# 'shift' => $shift,
# 'indexkey' => $indexkey,
# 'plugininstance' => $plugininstance
# }),
# target => "${collectd::plugin_conf_dir}/snmp_agent-config.conf",
# }
# }

0 comments on commit dc2eaad

Please sign in to comment.