incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1490370 - in /incubator/ambari/trunk/ambari-agent/src/main/puppet/modules: hdp-hbase/manifests/ hdp-hcat/manifests/ hdp-hive/manifests/ hdp-nagios/manifests/ hdp-oozie/manifests/ hdp-templeton/manifests/ hdp/manifests/
Date Thu, 06 Jun 2013 17:34:20 GMT
Author: mahadev
Date: Thu Jun  6 17:34:20 2013
New Revision: 1490370

URL: http://svn.apache.org/r1490370
Log:
AMBARI-2302. Create all users for all presented services in cluster on each node (Oleksandr
Diachenko via mahadev)

Modified:
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/init.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/init.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hive/manifests/init.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/init.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/init.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp
    incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/init.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/init.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hbase/manifests/init.pp
Thu Jun  6 17:34:20 2013
@@ -82,10 +82,6 @@ class hdp-hbase(
   } else {  
     hdp::package { 'hbase': }
   
-    hdp::user{ $hbase_user:
-      groups => [$hdp::params::user_group]
-    }
- 
     hdp::directory { $config_dir: 
       service_state => $service_state,
       force => true,
@@ -110,7 +106,7 @@ class hdp-hbase(
       }
     }
 
-    Anchor['hdp-hbase::begin'] -> Hdp::Package['hbase'] -> Hdp::User[$hbase_user] ->
Hdp::Directory[$config_dir] -> 
+    Anchor['hdp-hbase::begin'] -> Hdp::Package['hbase'] -> Hdp::Directory[$config_dir]
-> 
     Hdp-hbase::Configfile<||> ->  Anchor['hdp-hbase::end']
   }
 }

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/init.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/init.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hcat/manifests/init.pp
Thu Jun  6 17:34:20 2013
@@ -69,15 +69,9 @@ class hdp-hcat(
       force => true
     }
 
-    hdp::user{ $webhcat_user:}
-
-    if ($webhcat_user != $hcat_user) {
-      hdp::user { $hcat_user:}
-    }
-
     hdp-hcat::configfile { 'hcat-env.sh':}
   
-    Hdp::Package['hcat'] -> Hdp::User<|title == $webhcat_user or title == $hcat_user|>
 -> Hdp::Directory[$hcat_config_dir] -> Hdp::Directory_recursive_create[$hcat_pid_dir]
-> Hdp-hcat::Configfile<||> 
+    Hdp::Package['hcat'] -> Hdp::Directory[$hcat_config_dir] -> Hdp::Directory_recursive_create[$hcat_pid_dir]
-> Hdp-hcat::Configfile<||> 
 
  } else {
     hdp_fail("TODO not implemented yet: service_state = ${service_state}")

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hive/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hive/manifests/init.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hive/manifests/init.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-hive/manifests/init.pp
Thu Jun  6 17:34:20 2013
@@ -74,9 +74,7 @@ class hdp-hive(
     if ($server == true ) {
       class { 'hdp-hive::jdbc-connector': }
     }
-  
-    hdp::user{ $hive_user:}
-  
+
     hdp::directory_recursive_create { $hive_config_dir:
       service_state => $service_state,
       force => true,
@@ -90,11 +88,11 @@ class hdp-hive(
 
     hdp-hive::ownership { 'ownership': config_dir => $hive_config_dir }
   
-    Anchor['hdp-hive::begin'] -> Hdp::Package['hive'] -> Hdp::User[$hive_user] ->
 
+    Anchor['hdp-hive::begin'] -> Hdp::Package['hive'] -> 
      Hdp::Directory_recursive_create[$hive_config_dir] -> Hdp-hive::Configfile<||>
-> Hdp-hive::Ownership['ownership'] -> Anchor['hdp-hive::end']
 
      if ($server == true ) {
-       Hdp::Package['hive'] -> Hdp::User[$hive_user] -> Class['hdp-hive::jdbc-connector']
-> Anchor['hdp-hive::end']
+       Hdp::Package['hive'] -> Class['hdp-hive::jdbc-connector'] -> Anchor['hdp-hive::end']
     }
   }
 }

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/params.pp
Thu Jun  6 17:34:20 2013
@@ -20,11 +20,6 @@
 #
 class hdp-nagios::params() inherits hdp::params
 {   
-  $nagios_default_user = "nagios"
-  $nagios_default_group = "nagios"
-  $nagios_user = hdp_default("nagios_user", $nagios_default_user)
-  $nagios_group = hdp_default("nagios_group",$nagios_default_group)
-  
   $conf_dir = hdp_default("nagios_conf_dir","/etc/nagios")
 
   if hdp_is_empty($hdp::params::services_names[httpd]) {

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-nagios/manifests/server.pp
Thu Jun  6 17:34:20 2013
@@ -101,14 +101,6 @@ class hdp-nagios::server(
   } elsif ($service_state in ['running','stopped','installed_and_configured']) {
     class { 'hdp-nagios::server::packages' : service_state => $service_state}
   
-    group { $nagios_group:
-      ensure => present
-    }
-  
-    hdp::user { $nagios_user:
-      gid => $nagios_group
-    }
-
     file{ $nagios_httpd_config_file :
       ensure => present,
       owner => $nagios_user,
@@ -134,7 +126,7 @@ class hdp-nagios::server(
       force => true
     }
 
-	hdp::directory_recursive_create { $nagios_pid_dir:
+    hdp::directory_recursive_create { $nagios_pid_dir:
       service_state => $service_state,
       owner => $nagios_user,
       group => $nagios_group,
@@ -182,7 +174,7 @@ class hdp-nagios::server(
       mode => '0755',
       override_owner => true
     }
-	
+
     if ($service_state == 'installed_and_configured') {
       $webserver_state = 'restart'
     } elsif ($service_state == 'running') {
@@ -204,20 +196,22 @@ class hdp-nagios::server(
     class { 'hdp-nagios::server::web_permisssions': }
 
     file { "$nagios_config_dir/command.cfg" :
-      owner => $hdp-nagios::params::nagios_user,
-      group => $hdp-nagios::params::nagios_group
+      owner => $nagios_user,
+      group => $nagios_group
     }
 
     class { 'hdp-nagios::server::services': ensure => $service_state}
 
-    Class['hdp-nagios::server::packages'] -> Class['hdp-nagios::server::enable_snmp']->
-    Group[$nagios_group] -> Hdp::User[$nagios_user] ->
+    anchor{'hdp-nagios::server::begin':}
+    anchor{'hdp-nagios::server::end':}
+
+    Anchor['hdp-nagios::server::begin'] -> Class['hdp-nagios::server::packages'] ->
file[$nagios_httpd_config_file] -> Class['hdp-nagios::server::enable_snmp']->
     Hdp::Directory[$nagios_config_dir] -> Hdp::Directory[$plugins_dir] -> Hdp::Directory_recursive_create[$nagios_pid_dir]
->
     Hdp::Directory[$nagios_obj_dir] -> Hdp::Directory_Recursive_Create[$nagios_var_dir]
->
     Hdp::Directory_Recursive_Create[$check_result_path] -> Hdp::Directory_Recursive_Create[$nagios_rw_dir]
->
     Hdp::Directory[$nagios_log_dir] -> Hdp::Directory[$nagios_log_archives_dir] ->
     Class['hdp-nagios::server::config'] -> Class['hdp-nagios::server::web_permisssions']
->
-    File["$nagios_config_dir/command.cfg"] -> Class['hdp-nagios::server::services'] ->
Class['hdp-monitor-webserver']
+    File["$nagios_config_dir/command.cfg"] -> Class['hdp-nagios::server::services'] ->
Class['hdp-monitor-webserver'] -> Anchor['hdp-nagios::server::end']
 
   } else {
     hdp_fail("TODO not implemented yet: service_state = ${service_state}")

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/init.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/init.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-oozie/manifests/init.pp
Thu Jun  6 17:34:20 2013
@@ -75,7 +75,7 @@ class hdp-oozie(
       class { 'hdp-oozie::download-ext-zip': }
     }
 
-     hdp::user{ $oozie_user:}
+     
 
      hdp::directory { $oozie_config_dir: 
        service_state => $service_state,
@@ -89,10 +89,10 @@ class hdp-oozie(
 
      hdp-oozie::ownership { 'ownership': }
 
-    anchor { 'hdp-oozie::begin': } -> Hdp::Package['oozie-client'] -> Hdp::User[$oozie_user]
-> Hdp::Directory[$oozie_config_dir] -> Hdp-oozie::Configfile<||> -> Hdp-oozie::Ownership['ownership']
-> anchor { 'hdp-oozie::end': }
+    anchor { 'hdp-oozie::begin': } -> Hdp::Package['oozie-client'] -> Hdp::Directory[$oozie_config_dir]
-> Hdp-oozie::Configfile<||> -> Hdp-oozie::Ownership['ownership'] -> anchor
{ 'hdp-oozie::end': }
 
      if ($server == true ) { 
-       Hdp::Package['oozie-server'] -> Hdp::Package['oozie-client'] -> Hdp::User[$oozie_user]
->   Class['hdp-oozie::download-ext-zip'] ->  Anchor['hdp-oozie::end']
+       Hdp::Package['oozie-server'] -> Hdp::Package['oozie-client'] -> Class['hdp-oozie::download-ext-zip']
->  Anchor['hdp-oozie::end']
      }
  }
 }

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/init.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/init.pp
(original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp-templeton/manifests/init.pp
Thu Jun  6 17:34:20 2013
@@ -71,8 +71,6 @@ class hdp-templeton(
     class { hdp-templeton::download-hive-tar: }
     class { hdp-templeton::download-pig-tar: }
 
-    hdp::user{ $webhcat_user:}
-
     hdp::directory { $templeton_config_dir: 
       service_state => $service_state,
       force => true,
@@ -83,10 +81,10 @@ class hdp-templeton(
 
     hdp-templeton::configfile { ['webhcat-env.sh']: }
 
-    anchor { 'hdp-templeton::begin': } -> Hdp::Package['webhcat'] -> Hdp::User[$webhcat_user]
-> Hdp::Directory[$templeton_config_dir] -> Hdp-templeton::Configfile<||> ->
 anchor { 'hdp-templeton::end': }
+    anchor { 'hdp-templeton::begin': } -> Hdp::Package['webhcat'] -> Hdp::Directory[$templeton_config_dir]
-> Hdp-templeton::Configfile<||> ->  anchor { 'hdp-templeton::end': }
 
      if ($server == true ) { 
-      Hdp::Package['webhcat'] -> Hdp::User[$webhcat_user] ->   Class['hdp-templeton::download-hive-tar']
-> Class['hdp-templeton::download-pig-tar'] -> Anchor['hdp-templeton::end']
+      Hdp::Package['webhcat'] -> Class['hdp-templeton::download-hive-tar'] -> Class['hdp-templeton::download-pig-tar']
-> Anchor['hdp-templeton::end']
      }
   }
 }

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/init.pp Thu
Jun  6 17:34:20 2013
@@ -121,6 +121,52 @@ class hdp(
     lzo_needed   => false
   }
 
+    anchor{'hdp::begin':}
+    anchor{'hdp::end':}
+
+    ##Create all users for all components presents in cluster
+    if ($hdp::params::hbase_master_hosts != "") {
+      hdp::user{ $hdp::params::hbase_user:
+        groups => [$hdp::params::user_group]
+      }
+
+      Anchor['hdp::begin'] -> Group[$hdp::params::user_group] -> Hdp::User[$hdp::params::hbase_user]
-> Anchor['hdp::end']       
+    }
+    
+    if ($hdp::params::nagios_server_host != "") {
+      group {$hdp::params::nagios_group:
+        ensure => present
+      }
+
+      hdp::user{ $hdp::params::nagios_user:
+        gid => $hdp::params::nagios_group
+      }
+
+      Anchor['hdp::begin'] -> Group[$hdp::params::nagios_group] -> Hdp::User[$hdp::params::nagios_user]
-> Anchor['hdp::end']
+    }
+
+    if ($hdp::params::oozie_server != "") {
+      hdp::user{ $hdp::params::oozie_user:}
+
+      Anchor['hdp::begin'] -> Group[$hdp::params::user_group] -> Hdp::User[$hdp::params::oozie_user]
-> Anchor['hdp::end']  
+    }
+
+    if ($hdp::params::hcat_server_host != "") {
+      hdp::user{ $hdp::params::webhcat_user:}
+
+      if ($hdp::params::webhcat_user != $hdp::params::hcat_user) {
+        hdp::user { $hdp::params::hcat_user:}
+      }
+
+      Anchor['hdp::begin'] -> Group[$hdp::params::user_group] -> Hdp::User<|title
== $webhcat_user or title == $hcat_user|> -> Anchor['hdp::end'] 
+    }
+
+    if ($hdp::params::hive_server_host != "") {
+      hdp::user{ $hdp::params::hive_user:}
+
+      Anchor['hdp::begin'] -> Group[$hdp::params::user_group] -> Hdp::User[$hdp::params::hive_user]
-> Anchor['hdp::end']  
+    }
+
 }
 
 class hdp::pre_install_pkgs

Modified: incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp?rev=1490370&r1=1490369&r2=1490370&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp (original)
+++ incubator/ambari/trunk/ambari-agent/src/main/puppet/modules/hdp/manifests/params.pp Thu
Jun  6 17:34:20 2013
@@ -164,6 +164,11 @@ class hdp::params()
   ############ users
   $user_info = hdp_default("user_info",{})
 
+  $nagios_default_user = "nagios"
+  $nagios_default_group = "nagios"
+  $nagios_user = hdp_default("nagios_user", $nagios_default_user)
+  $nagios_group = hdp_default("nagios_group",$nagios_default_group)
+
   $hdfs_user = hdp_default("hdfs_user","hdfs")
   $mapred_user = hdp_default("mapred_user","mapred")
   $yarn_user = hdp_default("yarn_user","yarn")



Mime
View raw message