Ottomata has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/151657

Change subject: Create analytics-privatedata-users group
......................................................................

Create analytics-privatedata-users group

This group should be used to grant access to the Analytics (Hadoop)
cluster and to any private data within.  Private data in HDFS
will be 640 hdfs:analytics-privatedata-users.

Change-Id: Iac08bcebbbdd7423eb2b3096eb6e0f4830343dea
---
M manifests/role/analytics.pp
M manifests/role/analytics/refinery.pp
M manifests/site.pp
M modules/admin/data/data.yaml
4 files changed, 27 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/57/151657/1

diff --git a/manifests/role/analytics.pp b/manifests/role/analytics.pp
index cd59d82..4a78582 100644
--- a/manifests/role/analytics.pp
+++ b/manifests/role/analytics.pp
@@ -39,39 +39,3 @@
     }
 }
 
-# == Class role::analytics::users
-# Users that should be on analytics nodes.
-# This class is not included on *all* analytics
-# nodes, just ones where it is useful for users to
-# have accounts.  I.e. hadoop related nodes.
-# Users do not need accounts on Kafka or Zookeeper nodes.
-class role::analytics::users {
-
-    # Analytics user accounts will be added to the
-    # 'stats' group which gets created by this class.
-    require misc::statistics::user
-
-    # NOTE:  If you are filling an RT request for Hadoop access,
-    # you will need to add the user to the list of accounts above,
-    # as well as manually create the user's HDFS home directory.
-    # Once the user's posix account is created on analytics1010
-    # (the Hadoop NameNode), run these commands:
-    #
-    #   sudo -u hdfs hadoop fs -mkdir /user/<username>
-    #   sudo -u hdfs hadoop fs -chown <username>:stats /user/<username>
-    #
-
-    # If hdfs user exists, then add it to the stats group.
-    # I don't want to use puppet types to manage the hdfs
-    # user, since it is installed by the cdh packages.
-    exec { 'hdfs_user_in_stats_group':
-        command => 'usermod hdfs -a -G stats',
-        # only run this command if the hdfs user exists
-        # and it is not already in the stats group
-        # This command returns true if hdfs user does not exist,
-        # or if hdfs user does exist and is in the stats group.
-        unless  => 'getent passwd hdfs > /dev/null; if [ $? != 0 ]; then true; 
else groups hdfs | grep -q stats; fi',
-        path    => '/usr/sbin:/usr/bin:/bin',
-        require => Group['stats'],
-    }
-}
diff --git a/manifests/role/analytics/refinery.pp 
b/manifests/role/analytics/refinery.pp
index d347915..0fe5882 100644
--- a/manifests/role/analytics/refinery.pp
+++ b/manifests/role/analytics/refinery.pp
@@ -3,9 +3,6 @@
 # and using the analytics/refinery repository.
 #
 class role::analytics::refinery {
-    # Require analytics users so we hdfs can write log files as stats user.
-    require role::analytics::users
-
     # Many Kraken python scripts use docopt for CLI parsing.
     if !defined(Package['python-docopt']) {
         package { 'python-docopt':
@@ -36,6 +33,8 @@
     file { $log_dir:
         ensure => 'directory',
         owner  => 'root',
+        # TODO: Change this to analytics-admins group after
+        # https://gerrit.wikimedia.org/r/#/c/150560 is merged.
         group  => 'stats',
         # setgid bit here to make kraken log files writeable
         # by users in the stats group.
diff --git a/manifests/site.pp b/manifests/site.pp
index fbb2905..bac0bfc 100644
--- a/manifests/site.pp
+++ b/manifests/site.pp
@@ -141,7 +141,12 @@
     # ganglia cluster name.
     $cluster = 'analytics'
 
-    class { 'admin': groups => ['analytics-users'] }
+    class { 'admin':
+        groups => [
+            'analytics-users',
+            'analytics-privatedata-users',
+        ],
+    }
     include standard
 
     include role::analytics::hadoop::standby
@@ -156,7 +161,12 @@
     # analytics1010 is analytics Ganglia aggregator for Row B
     $ganglia_aggregator = true
 
-    class { 'admin': groups => ['analytics-users'] }
+    class { 'admin':
+        groups => [
+            'analytics-users'
+            'analytics-privatedata-users',
+        ]
+    }
     include standard
 
     include role::analytics::hadoop::master
@@ -2465,8 +2475,13 @@
     # Users should not use it for app development.
     # Data processing on this machine is fine.
 
-    class { 'admin': groups => ['statistics-privatedata-users',
-                                'statistics-admins'] }
+    class { 'admin':
+        groups => [
+            'statistics-privatedata-users',
+            'statistics-admins',
+            'analytics-privatedata-users',
+        ],
+    }
 
     # include classes needed for storing and crunching
     # private data on stat1002.
diff --git a/modules/admin/data/data.yaml b/modules/admin/data/data.yaml
index d98fb55..5be7daf 100644
--- a/modules/admin/data/data.yaml
+++ b/modules/admin/data/data.yaml
@@ -126,12 +126,15 @@
     members: [hashar]
     privs: ['ALL = NOPASSWD: ALL']
   analytics-users:
-    posix_name: stats
     gid: 7080
-    description: XXX:TEMP -- should not need to use posix_name attribute
+    description: Gives generic access to the Analytics (Hadoop) clsuter.
+    members: []
+  analytics-privatedata-users:
+    gid: 7080
+    description: Gives access to the Analytics (Hadoop) cluster as well as 
prviate data within.
     members: [dartar, erik, milimetric, yurik, maryana,
               halfak, dr0ptp4kt, qchris, tnegrin, ironholds, yuvipanda,
-              kleduc, nuria, haithams]
+              kleduc, nuria, haithams, otto]
   ocg-render-admins:
     gid: 721
     description: admins for pdf render (rt 6468)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac08bcebbbdd7423eb2b3096eb6e0f4830343dea
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ottomata <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to