Ottomata has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/373689 )

Change subject: Include discovery-stats user in analytics_cluster::users
......................................................................

Include discovery-stats user in analytics_cluster::users

This will allow discovery-stats to use Hadoop.

Change-Id: Iba7f79f11240af8781a8c4c9b0aeab2dae0d6373
---
M modules/role/manifests/analytics_cluster/users.pp
M modules/statistics/manifests/discovery.pp
2 files changed, 15 insertions(+), 16 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/89/373689/1

diff --git a/modules/role/manifests/analytics_cluster/users.pp 
b/modules/role/manifests/analytics_cluster/users.pp
index 44c9aaf..6b32e56 100644
--- a/modules/role/manifests/analytics_cluster/users.pp
+++ b/modules/role/manifests/analytics_cluster/users.pp
@@ -23,4 +23,7 @@
         gid    => 'analytics-search',
         system => true,
     }
+
+    # Include the discovery-stats user so that automated Hive queries can be 
made.
+    include ::statistics::discovery::user
 }
diff --git a/modules/statistics/manifests/discovery.pp 
b/modules/statistics/manifests/discovery.pp
index 491ed11..cad37e1 100644
--- a/modules/statistics/manifests/discovery.pp
+++ b/modules/statistics/manifests/discovery.pp
@@ -1,8 +1,15 @@
 # = Class: statistics::discovery
+#
+# NOTE:  This class includes the statistics::discovery::user class, which 
ensures that
+# the discovery-stats user is in the analytics-privatedata-users group.  This 
means
+# that you CANNOT include statistics::discovery somewhere that does not have 
the
+# analytics-privatedata-users present.
+#
 class statistics::discovery {
     Class['::statistics'] -> Class['::statistics::discovery']
 
     include ::passwords::mysql::research
+    include ::statistics::discovery::user
 
     $working_path = $::statistics::working_path
     # Homedir for everything Wikimedia Discovery Analytics related
@@ -12,24 +19,13 @@
     # Path in which the R library will reside
     $rlib_dir = "${dir}/r-library"
 
-    $user = 'discovery-stats'
-    # Setting group to 'analytics-privatedata-users' so that Discovery's 
Analysts
-    # (as members of analytics-privatedata-users) have some privileges, and so
-    # the discovery-stats user can access private data in Hive.
-    $group ='analytics-privatedata-users'
 
-    user { $user:
-        ensure     => present,
-        home       => $dir,
-        shell      => '/bin/bash',
-        managehome => false,
-        system     => true,
-        gid        => $group,
-    }
+    $user = $::statistics::discovery::user::user
+    $group = $::statistics::discovery::user::group
 
     # This file will render at
     # /etc/mysql/conf.d/discovery-stats-client.cnf.
-    ::mysql::config::client { 'discovery-stats':
+    ::mysql::config::client { $user:
         user  => $::passwords::mysql::research::user,
         pass  => $::passwords::mysql::research::pass,
         group => $group,
@@ -46,7 +42,7 @@
         ensure => 'directory',
         owner  => $user,
         group  => $group,
-        mode   => '0775', # so Discovery's Analysts (as members of wikidev 
group) can read, write, execute
+        mode   => '0775', # so Discovery's Analysts (as members of 
analytics-privatedata-users group) can read, write, execute
     }
 
     git::clone { 'wikimedia/discovery/golden':
@@ -76,7 +72,7 @@
         require => [
             Class['::statistics::compute'],
             Git::Clone['wikimedia/discovery/golden'],
-            Mysql::Config::Client['discovery-stats']
+            Mysql::Config::Client[$user]
         ],
         user    => $user,
     }

-- 
To view, visit https://gerrit.wikimedia.org/r/373689
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba7f79f11240af8781a8c4c9b0aeab2dae0d6373
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <ao...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to