From b2cabd6ac952068881a62ebac6b0c009eede2680 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Thu, 18 Dec 2014 19:32:00 +0100 Subject: [PATCH] Class for hwraid repository and megacli, separate class for cloudera. --- files/hwraid.list | 2 ++ manifests/cloudera.pp | 22 ++++++++++++++++++++++ manifests/hwraid.pp | 21 +++++++++++++++++++++ manifests/init.pp | 2 ++ 4 files changed, 47 insertions(+) create mode 100644 files/hwraid.list create mode 100644 manifests/cloudera.pp create mode 100644 manifests/hwraid.pp diff --git a/files/hwraid.list b/files/hwraid.list new file mode 100644 index 0000000..47fab79 --- /dev/null +++ b/files/hwraid.list @@ -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 index 0000000..493d4c6 --- /dev/null +++ b/manifests/cloudera.pp @@ -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 index 0000000..681d169 --- /dev/null +++ b/manifests/hwraid.pp @@ -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': } +} diff --git a/manifests/init.pp b/manifests/init.pp index 90e3510..b7bac97 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -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'] -- 1.8.2.3