Class for hwraid repository and megacli, separate class for cloudera.
authorFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 18 Dec 2014 18:32:00 +0000 (19:32 +0100)
committerFrantišek Dvořák <valtri@civ.zcu.cz>
Thu, 18 Dec 2014 18:32:00 +0000 (19:32 +0100)
files/hwraid.list [new file with mode: 0644]
manifests/cloudera.pp [new file with mode: 0644]
manifests/hwraid.pp [new file with mode: 0644]
manifests/init.pp

diff --git a/files/hwraid.list b/files/hwraid.list
new file mode 100644 (file)
index 0000000..47fab79
--- /dev/null
@@ -0,0 +1,2 @@
+# pro HW RAID
+deb http://hwraid.le-vert.net/debian wheezy main
diff --git a/manifests/cloudera.pp b/manifests/cloudera.pp
new file mode 100644 (file)
index 0000000..493d4c6
--- /dev/null
@@ -0,0 +1,22 @@
+class site_hadoop::cloudera {
+  if $::osfamily == 'Debian' {
+    # cloudera repo
+    exec { 'key-cloudera':
+      command => 'apt-key adv --fetch-key http://archive.cloudera.com/cdh5/debian/wheezy/amd64/cdh/archive.key',
+      path    => $site_hadoop::path,
+      creates => '/etc/apt/sources.list.d/cloudera.list',
+    }
+    ->
+    exec { 'wget-cloudera':
+      command => 'wget -P /etc/apt/sources.list.d/ http://archive.cloudera.com/cdh5/debian/wheezy/amd64/cdh/cloudera.list',
+      path    => $site_hadoop::path,
+      creates => '/etc/apt/sources.list.d/cloudera.list',
+    }
+    ~>
+    exec { 'apt-get-update':
+      command     => 'apt-get update',
+      refreshonly => true,
+      path        => $site_hadoop::path,
+    }
+  }
+}
diff --git a/manifests/hwraid.pp b/manifests/hwraid.pp
new file mode 100644 (file)
index 0000000..681d169
--- /dev/null
@@ -0,0 +1,21 @@
+class site_hadoop::hwraid {
+  $path='/sbin:/usr/sbin:/bin:/usr/bin'
+
+  exec { 'key-hwraid':
+    command => 'apt-key adv --fetch-key http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key',
+    path    => $path,
+    creates => '/etc/apt/sources.list.d/hwraid.list',
+  }
+  ->
+  file { '/etc/apt/sources.list.d/hwraid.list':
+    source => 'puppet:///modules/site_hadoop/hwraid.list',
+  }
+  ~>
+  exec { 'apt-get-update':
+    command     => 'apt-get update',
+    refreshonly => true,
+    path    => $path,
+  }
+  ->
+  package { 'megacli': }
+}
index 90e3510..b7bac97 100644 (file)
@@ -5,7 +5,9 @@
 class site_hadoop inherits site_hadoop::params {
   include 'site_hadoop::install'
   include 'site_hadoop::config'
+  include 'site_hadoop::cloudera'
 
+  Class['site_hadoop::cloudera'] ->
   Class['site_hadoop::install'] ->
   Class['site_hadoop::config'] ->
   Class['site_hadoop']