From e26e4acf516af87e6bccdda2c4f3d809bca084a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Sat, 17 Jan 2015 13:43:05 +0100 Subject: [PATCH] Move email parameter to main class. Moar doc. --- manifests/accounting.pp | 18 +++++++++++++----- manifests/autoupdate.pp | 8 +++++--- manifests/init.pp | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 8 deletions(-) diff --git a/manifests/accounting.pp b/manifests/accounting.pp index 0b4341c..0b9d897 100644 --- a/manifests/accounting.pp +++ b/manifests/accounting.pp @@ -6,6 +6,18 @@ # # For example using puppetlabs-mysql and cesnet-hadoop: # +# include stdlib +# +# class{'site_hadoop': +# db_password => 'accpass', +# email => 'mail@example.com', +# stage => 'setup', +# } +# +# class{'site_hadoop::accountig': +# hdfs => '0,30 * * *', +# } +# # mysql::db { 'accounting': # user => 'accounting', # password => 'accpass', @@ -19,16 +31,11 @@ # # === Parameters # -# [*email*] undef -# -# Email to send errors from cron. -# # [*hdfs*] undef # # Enable storing global HDFS disk and data statistics. The value is time in the cron format. See *man 5 crontab*. # class site_hadoop::accounting( - $email = undef, $hdfs = undef, ) { file {'/usr/local/bin/accounting-hdfs': @@ -75,6 +82,7 @@ class site_hadoop::accounting( } } + $email = $site_hadoop::email if $hdfs { file{'/etc/cron.d/accounting-hdfs': owner => 'root', diff --git a/manifests/autoupdate.pp b/manifests/autoupdate.pp index 14ad164..447bd34 100644 --- a/manifests/autoupdate.pp +++ b/manifests/autoupdate.pp @@ -4,17 +4,19 @@ # # === Parameters # -# [*email*] undef -# If specified, sent email on upgrade. +# ####`time` +# = ''0 5 * * *' +# +# Time to upgrade in cron format (see *man 5 crontab*). # class site_hadoop::autoupdate( - $email = undef, $time = $site_hadoop::params::time_autoupdate, ) inherits site_hadoop::params { include stdlib ensure_packages($site_hadoop::params::packages_autoupdate) + $email = $site_hadoop::email if $::osfamily == 'Debian' { file { '/etc/cron-apt/config': content => template('site_hadoop/cron-apt.conf.erb'), diff --git a/manifests/init.pp b/manifests/init.pp index 49be157..41b9cea 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -2,10 +2,42 @@ # # Basic system configurations for Hadoop cluster on Meta. # +# ##Parameters +# +# ####`db_name` +# = undef (system default is *accounting*) +# +# Database name for statistics. +# +# ####`db_user` +# = undef (system default is *accounting*) +# +# Database user for statistics. +# +# ####`db_password` +# = undef +# +# Database password for statistics. +# +# ####`email` = undef +# = undef +# +# Email address to send errors from cron. +# +# ####`mirror` +# = 'cloudera' +# +# Cloudera mirror to use. +# +# Values: +# * **cloudera** +# * **scientific** +# class site_hadoop ( $db_name = undef, $db_user = undef, $db_password = undef, + $email = undef, $mirror = $site_hadoop::params::mirror, ) inherits site_hadoop::params { include 'site_hadoop::install' -- 1.8.2.3