forked from voxpupuli/puppet-gluster
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switched YUM repo to use the new CentOS Storage group repository (issue
voxpupuli#63 and voxpupuli#68)
- Loading branch information
Benjamin Merot
committed
Sep 6, 2016
1 parent
895bc3b
commit 16213b8
Showing
5 changed files
with
42 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,24 +5,15 @@ | |
# | ||
# === Parameters | ||
# | ||
# version: the version to use when building the repo URL | ||
# release: GlusterFS release, such as 3.6, 3.7 or 3.8 (specific package defined with 'gluster::version') | ||
# repo_key_name: the filename of this repo's GPG key | ||
# repo_key_path: the path to this repo's GPG key on the target system | ||
# repo_key_source: where to find this repo's GPG key | ||
# priority: YUM priority to set for the Gluster repo | ||
# | ||
# Currently only released versions are supported. If you want to use | ||
# QA releases or pre-releases, you'll need to edit line 54 below | ||
# QA releases or pre-releases, you'll need to edit line 47 | ||
|
||
# === Examples | ||
# | ||
# Enable the Yum repo, and use the public key stored in a local module | ||
# called "secure": | ||
# | ||
# class { gluster::repo::yum: | ||
# repo_key_source => 'puppet:///modules/secure/gluster-repo-rpm-key', | ||
# } | ||
# | ||
# === Authors | ||
# | ||
# Scott Merrill <[email protected]> | ||
|
@@ -32,49 +23,14 @@ | |
# Copyright 2014 CoverMyMeds, unless otherwise noted | ||
# | ||
class gluster::repo::yum ( | ||
$version = $::gluster::params::version, | ||
$repo_key_name = $::gluster::params::repo_gpg_key_name, | ||
$repo_key_path = $::gluster::params::repo_gpg_key_path, | ||
$release = $::gluster::params::release, | ||
$repo_key_source = $::gluster::params::repo_gpg_key_source, | ||
$priority = $::gluster::params::repo_priority, | ||
) inherits ::gluster::params { | ||
|
||
# basic sanity check | ||
if ! $version { | ||
fail ('Version not specified: unable to define repo!') | ||
} | ||
|
||
$repo_base = 'https://download.gluster.org/pub/gluster/glusterfs' | ||
if $version == 'LATEST' { | ||
$repo_ver = $version | ||
} else { | ||
if $version =~ /^\d\.\d$/ { | ||
$repo_ver = "${version}/LATEST" | ||
} elsif $version =~ /^(\d)\.(\d)\.(\d).*$/ { | ||
$repo_ver = "${1}.${2}/${1}.${2}.${3}" | ||
} else { | ||
fail("${version} doesn't make sense!") | ||
} | ||
} | ||
|
||
# the Gluster repo only supports x86_64 and i386 | ||
$arch = $::architecture ? { | ||
'x86_64' => 'x86_64', | ||
/i\d86/ => 'i386', | ||
default => false, | ||
} | ||
if ! $arch { | ||
fail("Architecture ${::architecture} not yet supported.") | ||
} | ||
|
||
$repo_url = "${repo_base}/${repo_ver}/EPEL.repo/epel-${::operatingsystemmajrelease}/${arch}/" | ||
$repo_key = "${repo_key_path}${repo_key_name}" | ||
if $repo_key_source { | ||
file { $repo_key: | ||
ensure => file, | ||
source => $repo_key_source, | ||
before => Yumrepo["glusterfs-${arch}"], | ||
} | ||
# CentOS Gluster repo only supports x86_64 | ||
if $::architecture != 'x86_64' { | ||
fail("Architecture ${::architecture} not supported.") | ||
} | ||
|
||
if $priority { | ||
|
@@ -86,12 +42,12 @@ | |
} | ||
} | ||
|
||
yumrepo { "glusterfs-${arch}": | ||
yumrepo { "glusterfs-${::architecture}": | ||
enabled => 1, | ||
baseurl => $repo_url, | ||
descr => "GlusterFS ${arch}", | ||
baseurl => "http://mirror.centos.org/centos/${::operatingsystemmajrelease}/storage/${::architecture}/gluster-${release}/", | ||
descr => "CentOS-${::operatingsystemmajrelease} - Gluster ${release}", | ||
gpgcheck => 1, | ||
gpgkey => "file://${repo_key}", | ||
gpgkey => $repo_key_source, | ||
priority => $priority, | ||
} | ||
|
||
|