Move email parameter to main class. Moar doc.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Sat, 17 Jan 2015 12:43:05 +0000 (13:43 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Sat, 17 Jan 2015 12:43:05 +0000 (13:43 +0100)
manifests/accounting.pp
manifests/autoupdate.pp
manifests/init.pp

index 0b4341c..0b9d897 100644 (file)
@@ -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',
 #
 # === 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',
index 14ad164..447bd34 100644 (file)
@@ -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'),
index 49be157..41b9cea 100644 (file)
@@ -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'