diff options
author | Konstantin Boudnik <konstantin_boudnik@epam.com> | 2017-06-16 17:28:21 -0700 |
---|---|---|
committer | Evans Ye <evansye@apache.org> | 2017-07-01 12:52:59 +0000 |
commit | 9088edd944258e6509fae47eb23e53282091aa3b (patch) | |
tree | abc45de97e5ddfdefd084514f202c72eb93dc08d | |
parent | 05186351f07e777a1116ad70d7badaaf9368dbaa (diff) |
BIGTOP-2815. Puppet should be able to generate multiple repo files
Signed-off-by: Evans Ye <evansye@apache.org>
-rw-r--r-- | bigtop-deploy/puppet/hieradata/site.yaml | 6 | ||||
-rw-r--r-- | bigtop-deploy/puppet/manifests/bigtop_repo.pp | 46 |
2 files changed, 34 insertions, 18 deletions
diff --git a/bigtop-deploy/puppet/hieradata/site.yaml b/bigtop-deploy/puppet/hieradata/site.yaml index b0036c39..d1e74a98 100644 --- a/bigtop-deploy/puppet/hieradata/site.yaml +++ b/bigtop-deploy/puppet/hieradata/site.yaml @@ -43,4 +43,8 @@ hadoop::hadoop_storage_dirs: #bigtop::roles_enabled: false -#bigtop::bigtop_repo_uri: "http://mirror.example.com/path/to/mirror/" +## You can specify one (or more) repositories. It is convenient if +## you provide hotfix repo separately from the stable release, etc. +#bigtop::bigtop_repo_uri: +# - "http://mirror1.example.com/path/to/mirror/" +# - "http://mirror2.example.com/path/to/mirror/" diff --git a/bigtop-deploy/puppet/manifests/bigtop_repo.pp b/bigtop-deploy/puppet/manifests/bigtop_repo.pp index 51971b9f..ed22f819 100644 --- a/bigtop-deploy/puppet/manifests/bigtop_repo.pp +++ b/bigtop-deploy/puppet/manifests/bigtop_repo.pp @@ -16,15 +16,19 @@ class bigtop_repo { case $::operatingsystem { /(OracleLinux|Amazon|CentOS|Fedora|RedHat)/: { - $default_repo = "http://bigtop-repos.s3.amazonaws.com/releases/1.0.0/centos/7/x86_64" - yumrepo { "Bigtop": - baseurl => hiera("bigtop::bigtop_repo_uri", $default_repo), - descr => "Bigtop packages", - enabled => 1, + $default_repo = "http://bigtop-repos.s3.amazonaws.com/releases/1.2.0/centos/7/x86_64" + $baseurls_array = any2array(hiera("bigtop::bigtop_repo_uri", $default_repo)) + each ($baseurls_array) |$count, $baseurl| { + yumrepo { "Bigtop_$count": + baseurl => $baseurl, + descr => "Bigtop packages", + enabled => 1, gpgcheck => 0, - } - Yumrepo<||> -> Package<||> + } + Yumrepo<||> -> Package<||> + } } + /(Ubuntu|Debian)/: { include stdlib include apt @@ -32,20 +36,28 @@ class bigtop_repo { $lower_os = downcase($operatingsystem) # We use code name such as trusty for Ubuntu instead of release version in bigtop's binary convenience repos if ($operatingsystem == "Ubuntu") { $release = $lsbdistcodename } else { $release = $operatingsystemmajrelease } - $default_repo = "http://bigtop-repos.s3.amazonaws.com/releases/1.0.0/${lower_os}/${release}/x86_64" + $default_repo = "http://bigtop-repos.s3.amazonaws.com/releases/1.2.0/${lower_os}/${release}/x86_64" + $baseurls_array = any2array(hiera("bigtop::bigtop_repo_uri", $default_repo)) + # I couldn't enforce the sequence -> anymore because of this + # https://twitter.com/c0sin/status/875869783979196416 apt::conf { "disable_keys": content => "APT::Get::AllowUnauthenticated 1;", ensure => present - } -> - apt::source { "Bigtop": - location => hiera("bigtop::bigtop_repo_uri", $default_repo), - release => "bigtop", - repos => "contrib", - # BIGTOP-2796. Give Bigtop repo higher priority to solve zookeeper package conflict probem on Ubuntu - pin => "900", - ensure => present, - } -> + } + each ($baseurls_array) |$count, $baseurl| { + notify {"Baseurl: $baseurl" :} + apt::source { "Bigtop_$count": + location => $baseurl, + release => "bigtop", + repos => "contrib", + # BIGTOP-2796. Give Bigtop repo higher priority to solve zookeeper package conflict probem on Ubuntu + pin => "900", + ensure => present, + } + } + # It seems that calling update explicitely isn't needed because as far I can see + # it is getting called automatically. Perhaps this was needed for older versions? exec {'bigtop-apt-update': command => '/usr/bin/apt-get update' } |