Ottomata has uploaded a new change for review.

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


Change subject: Installing OpenJDK Java 7 instead of Sun/Oracle Java 6 on newly 
reinstalled analytics nodes.
......................................................................

Installing OpenJDK Java 7 instead of Sun/Oracle Java 6 on newly reinstalled 
analytics nodes.

Also tabs -> 4 spaces.

Change-Id: Ie052ba254d47368c813f4957095c1d1ad5f772cc
---
M manifests/role/analytics.pp
1 file changed, 91 insertions(+), 55 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/32/67832/1

diff --git a/manifests/role/analytics.pp b/manifests/role/analytics.pp
index 2b98019..7510c98 100644
--- a/manifests/role/analytics.pp
+++ b/manifests/role/analytics.pp
@@ -3,77 +3,113 @@
 @monitor_group { "analytics-eqiad": description => "analytics servers in 
eqiad" }
 
 class role::analytics {
-       system_role { "role::analytics": description => "analytics server" }
-       $nagios_group = "analytics-eqiad"
-       # ganglia cluster name.
-       $cluster = "analytics"
+    system_role { "role::analytics": description => "analytics server" }
+    $nagios_group = "analytics-eqiad"
+    # ganglia cluster name.
+    $cluster = "analytics"
 
-       include standard
-       include admins::roots
+    include standard
+    include admins::roots
 
-       # Include stats system user to
-       # run automated jobs and for file
-       # ownership.
-       include misc::statistics::user
+    # Include stats system user to
+    # run automated jobs and for file
+    # ownership.
+    include misc::statistics::user
 
-       # include analytics user accounts
-       include role::analytics::users
+    # include analytics user accounts
+    include role::analytics::users
 
-       # Install Sun/Oracle Java JDK on analytics cluster
-       java { "java-6-oracle":
-               distribution => 'oracle',
-               version      => 6,
-       }
+    # all analytics nodes need java installed
+    include role::analytics::java
 
-       # We want to be able to geolocate IP addresses
-       include geoip
+    # We want to be able to geolocate IP addresses
+    include geoip
 
-       # udp-filter is a useful thing!
-       include misc::udp2log::udp_filter
+    # udp-filter is a useful thing!
+    include misc::udp2log::udp_filter
+}
+
+# Contains list of reinstalled analytics nodes.
+# Once all analytics nodes are reinstalled, this
+# class will be removed.
+class role::analytics::reinstalled {
+    $nodes = [
+        'analytics1001',
+        'analytics1020',
+    ]
+}
+
+class role::analytics::java {
+    # Most analytics nodes currently are running
+    # Sun/Oracle Java 6.  As we reinstall these nodes,
+    # we want to switch over to Java 7.
+    # The following conditional will be removed once
+    # all nodes have been reinstalled.
+    include role::analytics::reinstalled
+
+    if (member($role::analytics::reinstalled::nodes, $hostname)) {
+        java { "java-7-openjdk":
+            distribution => 'openjdk',
+            version      => 7,
+        }
+        # Install Sun/Oracle Java JDK on analytics cluster
+        java { "java-6-oracle":
+            distribution => 'oracle',
+            version      => 6,
+            ensure       => 'absent'
+        }
+    }
+    else {
+    # Install Sun/Oracle Java JDK on analytics cluster
+        java { "java-6-oracle":
+            distribution => 'oracle',
+            version      => 6,
+        }
+    }
 }
 
 class role::analytics::users {
-       # Analytics user accounts will be added to the
-       # 'stats' group which gets created by this class.
-       require misc::statistics::user
+    # Analytics user accounts will be added to the
+    # 'stats' group which gets created by this class.
+    require misc::statistics::user
 
-       include accounts::diederik,
-               accounts::dsc,
-               accounts::otto,
-               accounts::dartar,
-               accounts::erosen,
-               accounts::olivneh,
-               accounts::erik,
-               accounts::milimetric,
-               accounts::yurik,   # RT 5158
-               accounts::spetrea, # RT 4402
-               accounts::ram      # RT 5059
+    include accounts::diederik,
+        accounts::dsc,
+        accounts::otto,
+        accounts::dartar,
+        accounts::erosen,
+        accounts::olivneh,
+        accounts::erik,
+        accounts::milimetric,
+        accounts::yurik,   # RT 5158
+        accounts::spetrea, # RT 4402
+        accounts::ram      # RT 5059
 
-       # add Analytics team members to the stats group so they can
-       # access data group owned by 'stats'.
-       User<|title == milimetric|>  { groups +> [ "stats" ] }
-       User<|title == yurik|>       { groups +> [ "stats" ] }
-       User<|title == dartar|>      { groups +> [ "stats" ] }
-       User<|title == dsc|>         { groups +> [ "stats" ] }
-       User<|title == diederik|>    { groups +> [ "stats" ] }
-       User<|title == erik|>        { groups +> [ "stats" ] }
-       User<|title == erosen|>      { groups +> [ "stats" ] }
-       User<|title == olivneh|>     { groups +> [ "stats" ] }
-       User<|title == otto|>        { groups +> [ "stats" ] }
-       User<|title == spetrea|>     { groups +> [ "stats" ] }
+    # add Analytics team members to the stats group so they can
+    # access data group owned by 'stats'.
+    User<|title == milimetric|>  { groups +> [ "stats" ] }
+    User<|title == yurik|>       { groups +> [ "stats" ] }
+    User<|title == dartar|>      { groups +> [ "stats" ] }
+    User<|title == dsc|>         { groups +> [ "stats" ] }
+    User<|title == diederik|>    { groups +> [ "stats" ] }
+    User<|title == erik|>        { groups +> [ "stats" ] }
+    User<|title == erosen|>      { groups +> [ "stats" ] }
+    User<|title == olivneh|>     { groups +> [ "stats" ] }
+    User<|title == otto|>        { groups +> [ "stats" ] }
+    User<|title == spetrea|>     { groups +> [ "stats" ] }
 
-       # Diederik, David and Otto have sudo privileges on Analytics nodes.
-       sudo_user { [ "diederik", "dsc", "otto" ]: privileges => ['ALL = (ALL) 
NOPASSWD: ALL'] }
+    # Diederik, David and Otto have sudo privileges on Analytics nodes.
+    sudo_user { [ "diederik", "dsc", "otto" ]: privileges => ['ALL = (ALL) 
NOPASSWD: ALL'] }
 }
 
 # front end interfaces for Kraken and Hadoop
 class role::analytics::frontend inherits role::analytics {
-       # include a mysql database for Sqoop and Oozie
-       # with the datadir at /a/mysql
-       class { "generic::mysql::server":
-               datadir => "/a/mysql",
-               version => "5.5",
-       }
+    # include a mysql database for Sqoop and Oozie
+    # with the datadir at /a/mysql
+    class { "generic::mysql::server":
+        datadir => "/a/mysql",
+        version => "5.5",
+    }
 }
 
 # Monitoring for kafka brokers.

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie052ba254d47368c813f4957095c1d1ad5f772cc
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