bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From evan...@apache.org
Subject [1/2] bigtop git commit: BIGTOP-2143. [Puppet] Automatically generate default repo
Date Mon, 16 Nov 2015 18:19:28 GMT
Repository: bigtop
Updated Branches:
  refs/heads/master 1156139d9 -> c26bc08ea


BIGTOP-2143. [Puppet] Automatically generate default repo


Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo
Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/2887b1b2
Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/2887b1b2
Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/2887b1b2

Branch: refs/heads/master
Commit: 2887b1b2d6baed93893d65dedd222a53ee9b4dfd
Parents: 1156139
Author: Evans Ye <evansye@apache.org>
Authored: Sat Nov 14 06:02:56 2015 +0000
Committer: Evans Ye <evansye@apache.org>
Committed: Tue Nov 17 02:18:35 2015 +0800

----------------------------------------------------------------------
 bigtop-deploy/puppet/manifests/site.pp | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/bigtop/blob/2887b1b2/bigtop-deploy/puppet/manifests/site.pp
----------------------------------------------------------------------
diff --git a/bigtop-deploy/puppet/manifests/site.pp b/bigtop-deploy/puppet/manifests/site.pp
index 728b310..0619964 100644
--- a/bigtop-deploy/puppet/manifests/site.pp
+++ b/bigtop-deploy/puppet/manifests/site.pp
@@ -13,8 +13,21 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-$default_yumrepo = "http://bigtop-repos.s3.amazonaws.com/releases/1.0.0/centos/7/x86_64"
-$default_debrepo = "http://bigtop-repos.s3.amazonaws.com/releases/1.0.0/ubuntu/trusty/x86_64"
+# Prepare default repo by detecting the environment automatically
+case $operatingsystem {
+    # Use CentOS 7 repo for other CentOS compatible OSs
+    /(OracleLinux|Amazon|RedHat)/: {
+      $default_repo = "http://bigtop-repos.s3.amazonaws.com/releases/1.0.0/centos/7/x86_64"
+    }
+    # Detect env to pick up default repo for other Bigtop supported OSs
+    default: {
+      $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"
+    }
+}
+
 $jdk_package_name = hiera("bigtop::jdk_package_name", "jdk")
 
 stage {"pre": before => Stage["main"]}
@@ -22,7 +35,7 @@ stage {"pre": before => Stage["main"]}
 case $operatingsystem {
     /(OracleLinux|Amazon|CentOS|Fedora|RedHat)/: {
        yumrepo { "Bigtop":
-          baseurl => hiera("bigtop::bigtop_repo_uri", $default_yumrepo),
+          baseurl => hiera("bigtop::bigtop_repo_uri", $default_repo),
           descr => "Bigtop packages",
           enabled => 1,
           gpgcheck => 0,
@@ -36,7 +49,7 @@ case $operatingsystem {
 	  ensure => present
        }
        apt::source { "Bigtop":
-          location => hiera("bigtop::bigtop_repo_uri", $default_debrepo),
+          location => hiera("bigtop::bigtop_repo_uri", $default_repo),
           release => "bigtop",
           repos => "contrib",
           ensure => present,


Mime
View raw message