aboutsummaryrefslogtreecommitdiffstats
path: root/manifests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-10-07 03:37:16 +0000
committerGerrit Code Review <review@openstack.org>2017-10-07 03:37:16 +0000
commit195db7cd8cf8643d2f562bd7c34823033cf479f4 (patch)
tree7d6f6b00a11de9057ba035cedbec46cb7f820c42 /manifests
parentfb0f290777c2f17ebd1d558805be06fe65f1c331 (diff)
parent7f1a21a378341fe3908e5efb17ca080360b6b606 (diff)
Merge "Allow to configure snmpd_config" into stable/pike
Diffstat (limited to 'manifests')
-rw-r--r--manifests/profile/base/snmp.pp44
1 files changed, 33 insertions, 11 deletions
diff --git a/manifests/profile/base/snmp.pp b/manifests/profile/base/snmp.pp
index ecef5ae..6c26e1c 100644
--- a/manifests/profile/base/snmp.pp
+++ b/manifests/profile/base/snmp.pp
@@ -18,6 +18,20 @@
#
# === Parameters
#
+# [*snmpd_config*]
+# An array of snmp config.
+# Example:
+# snmpd_config:
+# - 'createUser ro_snmp_user MD5 "secrete"',
+# - 'rouser ro_snmp_user'
+# - 'proc neutron-server'
+# - 'proc nova-api'
+# Note: since we give total freedom to configure snmpd_config and don't
+# verify the content, the user will have to ensure that the parameters
+# related to user / password in the array, are the same given to
+# THT via SnmpdReadonlyUserName and SnmpdReadonlyUserPassword.
+# Defaults to undef.
+#
# [*snmpd_password*]
# The SNMP password
# Defaults to hiera('snmpd_readonly_user_password')
@@ -32,6 +46,7 @@
# Defaults to hiera('step')
#
class tripleo::profile::base::snmp (
+ $snmpd_config = undef,
$snmpd_password = hiera('snmpd_readonly_user_password'),
$snmpd_user = hiera('snmpd_readonly_user_name'),
$step = Integer(hiera('step')),
@@ -41,17 +56,24 @@ class tripleo::profile::base::snmp (
authtype => 'MD5',
authpass => $snmpd_password,
}
- class { '::snmp':
- snmpd_config => [ join(['createUser ', $snmpd_user, ' MD5 "', $snmpd_password, '"']),
- join(['rouser ', $snmpd_user]),
- 'proc cron',
- 'includeAllDisks 10%',
- 'master agentx',
- 'trapsink localhost public',
- 'iquerySecName internalUser',
- 'rouser internalUser',
- 'defaultMonitors yes',
- 'linkUpDownNotifications yes' ],
+ if $snmpd_config {
+ validate_array($snmpd_config)
+ class { '::snmp':
+ snmpd_config => $snmpd_config,
+ }
+ } else {
+ class { '::snmp':
+ snmpd_config => [ join(['createUser ', $snmpd_user, ' MD5 "', $snmpd_password, '"']),
+ join(['rouser ', $snmpd_user]),
+ 'proc cron',
+ 'includeAllDisks 10%',
+ 'master agentx',
+ 'trapsink localhost public',
+ 'iquerySecName internalUser',
+ 'rouser internalUser',
+ 'defaultMonitors yes',
+ 'linkUpDownNotifications yes' ],
+ }
}
}
}