-
-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix puppet-lint warnings / switch to facts hash / drop legacy gluster versions 4.0 and older #203
Open
bastelfreak
wants to merge
11
commits into
voxpupuli:master
Choose a base branch
from
bastelfreak:bugfix
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ce5c38c
fix puppet-lint warnings / switch to facts hash
bastelfreak 479c937
remove uneeded param for apt resource
bastelfreak 9f2fb97
configure GPG keys for gluster 6/7 deb repos
bastelfreak abdc090
use parameters from main class
bastelfreak 631ce59
enforce release param as string
bastelfreak e548bff
set default gluterfs version 3.12->6
bastelfreak be29114
drop legacy glusterfs code
bastelfreak 3c00b16
enhance datatype handling
bastelfreak 55f593d
fix datatype in volume::options
bastelfreak 20decb5
refactor parameter handling
bastelfreak cc72b2c
generate REFERENCE.md
bastelfreak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,8 @@ | |
# The name of the client package to install. | ||
# @param version | ||
# The version of the client tools to install. | ||
# @param repo_key_source | ||
# HTTP Link or absolute path to the GPG key for the repository. | ||
# | ||
# @example | ||
# class { gluster::client: | ||
|
@@ -21,17 +23,27 @@ | |
# @author Scott Merrill <[email protected]> | ||
# @note Copyright 2014 CoverMyMeds, unless otherwise noted | ||
# | ||
# | ||
class gluster::client ( | ||
Boolean $repo = $gluster::params::repo, | ||
String $client_package = $gluster::params::client_package, | ||
String $version = $gluster::params::version, | ||
Boolean $repo = $gluster::params::repo, | ||
String $client_package = $gluster::params::client_package, | ||
String $version = $gluster::params::version, | ||
String $release = $gluster::params::release, | ||
Optional $repo_key_source = $gluster::params::repo_key_source, | ||
) inherits gluster::params { | ||
|
||
# if we manage the repository, we also need a GPG key | ||
if $repo { | ||
assert_type(Variant[Stdlib::Absolutepath, Stdlib::HTTPSUrl], $repo_key_source) | ||
} | ||
|
||
class { 'gluster::install': | ||
server => false, | ||
client => true, | ||
repo => $repo, | ||
version => $version, | ||
client_package => $client_package, | ||
server => false, | ||
client => true, | ||
repo => $repo, | ||
version => $version, | ||
client_package => $client_package, | ||
release => $release, | ||
repo_key_source => $repo_key_source, | ||
} | ||
} |
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
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 | ||||
---|---|---|---|---|---|---|
|
@@ -3,7 +3,10 @@ | |||||
# | ||||||
# @param version The version to use when building the repo URL | ||||||
# @param release The release to use when building the repo URL | ||||||
# @param priority Apt pin priority to set for the Gluster repo | ||||||
# @param priority | ||||||
# The priority for the apt/yum repository. Useful to overwrite other repositories like EPEL | ||||||
# @param repo_key_source | ||||||
# HTTP Link or absolute path to the GPG key for the repository. | ||||||
# | ||||||
# Currently only released versions are supported. If you want to use | ||||||
# QA releases or pre-releases, you'll need to edit line 54 below | ||||||
|
@@ -24,25 +27,24 @@ | |||||
# @note Copyright 2015 RL Solutions, unless otherwise noted | ||||||
# | ||||||
class gluster::repo::apt ( | ||||||
$version = $gluster::params::version, | ||||||
$release = $gluster::params::release, | ||||||
$priority = $gluster::params::repo_priority, | ||||||
$version, | ||||||
String[1] $release, | ||||||
$priority, | ||||||
Variant[Stdlib::Absolutepath,Stdlib::HTTPSUrl] $repo_key_source, | ||||||
) { | ||||||
|
||||||
assert_private() | ||||||
|
||||||
include 'apt' | ||||||
|
||||||
$repo_key_name = $release ? { | ||||||
'3.10' => 'C784DD0FD61E38B8B1F65E10DAD761554A72C1DF', | ||||||
'3.11' => 'DE82F0BACC4DB70DBEF95CA65EC2255642304A6E', | ||||||
'3.12' => '8B7C364430B66F0B084C0B0C55339A4C6A7BD8D4', | ||||||
'3.13' => '9B5AE8E6FD2581F293104ACC38675E5F30F779AF', | ||||||
'4.0' => '55F839E173AC06F364120D46FA86EEACB306CEE1', | ||||||
'4.1' => 'EED3351AFD72E5437C050F0388F6CDEE78FA6D97', | ||||||
'^5\.(\d)+$' => 'F9C958A3AEE0D2184FAD1CBD43607F0DC2F8238C', | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
/^6/ => 'F9C958A3AEE0D2184FAD1CBD43607F0DC2F8238C', | ||||||
/^7/ => 'F9C958A3AEE0D2184FAD1CBD43607F0DC2F8238C', | ||||||
default => '849512C2CA648EF425048F55C883F50CB2289A17', | ||||||
} | ||||||
|
||||||
$repo_key_source = "https://download.gluster.org/pub/gluster/glusterfs/${release}/rsa.pub" | ||||||
|
||||||
# basic sanity check | ||||||
if $version == 'LATEST' { | ||||||
$repo_ver = $version | ||||||
|
@@ -55,36 +57,27 @@ | |||||
} | ||||||
|
||||||
# the Gluster repo only supports x86_64 (amd64) and arm64. The Ubuntu PPA also supports armhf and arm64. | ||||||
case $::operatingsystem { | ||||||
case $facts['os']['name'] { | ||||||
'Debian': { | ||||||
case $::lsbdistcodename { | ||||||
'jessie', 'stretch': { | ||||||
$arch = $::architecture ? { | ||||||
'amd64' => 'amd64', | ||||||
'arm64' => 'arm64', | ||||||
default => false, | ||||||
} | ||||||
if versioncmp($release, '3.12') < 0 { | ||||||
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/apt/" | ||||||
} else { | ||||||
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/${arch}/apt/" | ||||||
} | ||||||
} | ||||||
$arch = $facts['architecture'] ? { | ||||||
'amd64' => 'amd64', | ||||||
'arm64' => 'arm64', | ||||||
default => false, | ||||||
} | ||||||
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${facts['lsbdistcodename']}/${arch}/apt/" | ||||||
} | ||||||
default: { | ||||||
fail('gluster::repo::apt currently only works on Debian') | ||||||
} | ||||||
} | ||||||
if ! $arch { | ||||||
fail("Architecture ${::architecture} not yet supported for ${::operatingsystem}.") | ||||||
fail("Architecture ${facts['architecture']} not yet supported for ${facts['operatingsystem']}.") | ||||||
} | ||||||
|
||||||
$repo = { | ||||||
bastelfreak marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
"glusterfs-${version}" => { | ||||||
ensure => present, | ||||||
location => $repo_url, | ||||||
release => $::lsbdistcodename, | ||||||
repos => 'main', | ||||||
key => { | ||||||
id => $repo_key_name, | ||||||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering about this pattern. It's hard to discover from reading the reference. Should the parameter be
Optional[Variant[Stdlib::Absolutepath, Stdlib::HTTPSUrl]]
? In that case maybe this could be simplified toassert_type(NotUndef, $repo_key_source)
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about the resource ordering, but I think this is redundant code. The value of
$repo
and$repo_key_source
is already defined atmanifests/params.pp
and we check the type atmanifests/repo.pp
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that it's redundant because
manifests/repo.pp
already checks it. That's a better approach than duplicating it here.