aboutsummaryrefslogtreecommitdiffstats
path: root/manifests/profile/base
diff options
context:
space:
mode:
authorEmilien Macchi <emilien@redhat.com>2017-10-02 13:47:10 -0700
committerEmilien Macchi <emilien@redhat.com>2017-10-06 19:01:36 +0000
commit7f1a21a378341fe3908e5efb17ca080360b6b606 (patch)
treef4da2261a8b05343dfe3d7037699cb4bb41cfc68 /manifests/profile/base
parent67e1e603a6b81e7532eb2cac2e27eec1ea413d32 (diff)
Allow to configure snmpd_config
Expose a new Puppet parameter to snmp profile, ``snmpd_config`` which is an array definded to undef by default. It can be used to override all snmpd configuration for advanced deployments. If used, all parameters have to be configured included users and passwords, which should be the same as given to snmpd_password and snmpd_user. There is no logic that will verify the content of ``snmpd_config``. Example of hieradata which configures snmpd_config: snmpd_config: - 'createUser ro_snmp_user MD5 "secrete"', - 'rouser ro_snmp_user' - 'proc neutron-server' - 'proc nova-api' Change-Id: Ief2518d5e47137215a34e9ae3b35c27c87fa6e08 Closes-Bug: #1720868 (cherry picked from commit c211ba78cabde54be2e3a6672f6e1d33d1d580f0)
Diffstat (limited to 'manifests/profile/base')
-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' ],
+ }
}
}
}