BIGTOP-2815. Puppet should be able to generate multiple repo files Signed-off-by: Evans Ye <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/9088edd9 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/9088edd9 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/9088edd9 Branch: refs/heads/branch-1.2 Commit: 9088edd944258e6509fae47eb23e53282091aa3b Parents: 0518635 Author: Konstantin Boudnik <[email protected]> Authored: Fri Jun 16 17:28:21 2017 -0700 Committer: Evans Ye <[email protected]> Committed: Sat Jul 1 12:52:59 2017 +0000 ---------------------------------------------------------------------- bigtop-deploy/puppet/hieradata/site.yaml | 6 ++- bigtop-deploy/puppet/manifests/bigtop_repo.pp | 46 ++++++++++++++-------- 2 files changed, 34 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/9088edd9/bigtop-deploy/puppet/hieradata/site.yaml ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/hieradata/site.yaml b/bigtop-deploy/puppet/hieradata/site.yaml index b0036c3..d1e74a9 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/" http://git-wip-us.apache.org/repos/asf/bigtop/blob/9088edd9/bigtop-deploy/puppet/manifests/bigtop_repo.pp ---------------------------------------------------------------------- diff --git a/bigtop-deploy/puppet/manifests/bigtop_repo.pp b/bigtop-deploy/puppet/manifests/bigtop_repo.pp index 51971b9..ed22f81 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' }
