From 5c1aa0ebe7ef77ce40d95c0bd41ce233ebf511a8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 5 Jan 2015 15:54:12 +0100 Subject: [PATCH] Cloudera mirrors support. --- manifests/cloudera.pp | 6 ++++-- manifests/init.pp | 4 +++- manifests/params.pp | 6 ++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/manifests/cloudera.pp b/manifests/cloudera.pp index 8ac32f7..3d4f459 100644 --- a/manifests/cloudera.pp +++ b/manifests/cloudera.pp @@ -1,14 +1,16 @@ class site_hadoop::cloudera { if $::osfamily == 'Debian' { + $url = $site_hadoop::mirrors[$site_hadoop::mirror] + # cloudera repo exec { 'key-cloudera': - command => 'apt-key adv --fetch-key http://archive.cloudera.com/cdh5/debian/wheezy/amd64/cdh/archive.key', + command => "apt-key adv --fetch-key $url/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 && sed -i /etc/apt/sources.list.d/cloudera.list -e "s/\\(deb\\|deb-src\\) http/\\1 [arch=amd64] http/"', + command => "wget -P /etc/apt/sources.list.d/ $url/cloudera.list && sed -i /etc/apt/sources.list.d/cloudera.list -e \"s/\\\\(deb\\\\|deb-src\\\\) http/\\\\1 [arch=amd64] http/\"", path => $site_hadoop::path, creates => '/etc/apt/sources.list.d/cloudera.list', } diff --git a/manifests/init.pp b/manifests/init.pp index 6864633..12f2c31 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -2,7 +2,9 @@ # # Basic system configurations for Hadoop cluster on Meta. # -class site_hadoop inherits site_hadoop::params { +class site_hadoop ( + $mirror = $site_hadoop::params::mirror, +) inherits site_hadoop::params { include 'site_hadoop::install' include 'site_hadoop::config' include 'site_hadoop::cloudera' diff --git a/manifests/params.pp b/manifests/params.pp index f380c38..3b1c27b 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -31,4 +31,10 @@ class site_hadoop::params { $time_autoupdate = '0 5 * * *' $path = '/sbin:/usr/sbin:/bin:/usr/bin' + + $mirror = 'cloudera' + $mirrors = { + 'cloudera' => 'http://archive.cloudera.com/cdh5/debian/wheezy/amd64/cdh', + 'scientific' => 'http://scientific.zcu.cz/repos/hadoop', + } } -- 1.8.2.3