Skip to content

Commit 3f85bd1

Browse files
authored
Merge pull request #212 from runejuhl/fix-tests
Fix failing CI tests / switch default glusterfs version from 3.12 -> 7.3
2 parents 85cb37e + b77b761 commit 3f85bd1

File tree

6 files changed

+57
-31
lines changed

6 files changed

+57
-31
lines changed

manifests/params.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# parameters dealing with installation
99
$install_server = true
1010
$install_client = true
11-
$release = '3.12'
11+
$release = '7.3'
1212
$version = 'LATEST'
1313

1414
# we explicitly do NOT set a priority here. The user must define

manifests/repo/apt.pp

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@
3131
include 'apt'
3232

3333
$repo_key_name = $release ? {
34-
'3.10' => 'C784DD0FD61E38B8B1F65E10DAD761554A72C1DF',
35-
'3.11' => 'DE82F0BACC4DB70DBEF95CA65EC2255642304A6E',
36-
'3.12' => '8B7C364430B66F0B084C0B0C55339A4C6A7BD8D4',
37-
'3.13' => '9B5AE8E6FD2581F293104ACC38675E5F30F779AF',
38-
'4.0' => '55F839E173AC06F364120D46FA86EEACB306CEE1',
39-
'4.1' => 'EED3351AFD72E5437C050F0388F6CDEE78FA6D97',
40-
'^5\.(\d)+$' => 'F9C958A3AEE0D2184FAD1CBD43607F0DC2F8238C',
41-
default => '849512C2CA648EF425048F55C883F50CB2289A17',
34+
'3.9' => '849512C2CA648EF425048F55C883F50CB2289A17',
35+
'3.10' => 'C784DD0FD61E38B8B1F65E10DAD761554A72C1DF',
36+
'3.11' => 'DE82F0BACC4DB70DBEF95CA65EC2255642304A6E',
37+
'3.12' => '8B7C364430B66F0B084C0B0C55339A4C6A7BD8D4',
38+
'3.13' => '9B5AE8E6FD2581F293104ACC38675E5F30F779AF',
39+
'4.0' => '55F839E173AC06F364120D46FA86EEACB306CEE1',
40+
'4.1' => 'EED3351AFD72E5437C050F0388F6CDEE78FA6D97',
41+
default => 'F9C958A3AEE0D2184FAD1CBD43607F0DC2F8238C',
4242
}
4343

4444
$repo_key_source = "https://download.gluster.org/pub/gluster/glusterfs/${release}/rsa.pub"
@@ -64,19 +64,30 @@
6464
'arm64' => 'arm64',
6565
default => false,
6666
}
67-
if versioncmp($release, '3.12') < 0 {
68-
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/apt/"
67+
68+
$_repo_base = 'https://download.gluster.org/pub/gluster/glusterfs'
69+
$repo_url = if versioncmp($release, '4.1') < 0 {
70+
"${_repo_base}/01.old-releases/${release}/LATEST/Debian/${::lsbdistcodename}/${arch}/apt/"
6971
} else {
70-
$repo_url = "https://download.gluster.org/pub/gluster/glusterfs/${release}/LATEST/Debian/${::lsbdistcodename}/${arch}/apt/"
72+
$_release = if $release == '4.1' {
73+
$release
74+
} else {
75+
$release[0]
76+
}
77+
"${_repo_base}/${_release}/LATEST/Debian/${::lsbdistcodename}/${arch}/apt/"
7178
}
7279
}
80+
default: {
81+
fail('unsupported distribution codename')
82+
}
7383
}
7484
}
7585
default: {
7686
fail('gluster::repo::apt currently only works on Debian')
7787
}
7888
}
79-
if ! $arch {
89+
90+
unless $arch {
8091
fail("Architecture ${::architecture} not yet supported for ${::operatingsystem}.")
8192
}
8293

manifests/repo/yum.pp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@
3434
}
3535
}
3636

37+
$_release = if versioncmp($release, '4.1') <= 0 {
38+
$release
39+
} else {
40+
$release[0]
41+
}
42+
3743
yumrepo { "glusterfs-${::architecture}":
3844
enabled => 1,
39-
baseurl => "http://mirror.centos.org/centos/${::operatingsystemmajrelease}/storage/${::architecture}/gluster-${release}/",
40-
descr => "CentOS-${::operatingsystemmajrelease} - Gluster ${release}",
45+
baseurl => "http://mirror.centos.org/centos/${::operatingsystemmajrelease}/storage/${::architecture}/gluster-${_release}/",
46+
descr => "CentOS-${::operatingsystemmajrelease} - Gluster ${_release}",
4147
gpgcheck => 1,
4248
gpgkey => $repo_key_source,
4349
priority => $priority,

manifests/volume.pp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
Optional[Integer] $arbiter = undef,
5555
) {
5656

57-
if $force {
58-
$_force = 'force'
57+
$_force = if $force {
58+
'force'
5959
} else {
60-
$_force = ''
60+
''
6161
}
6262

6363
if $stripe {
@@ -66,10 +66,10 @@
6666
$_stripe = ''
6767
}
6868

69-
if $replica {
70-
$_replica = "replica ${replica}"
69+
$_replica = if $replica {
70+
"replica ${replica}"
7171
} else {
72-
$_replica = ''
72+
''
7373
}
7474

7575
$_transport = "transport ${transport}"

manifests/volume/option.pp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
# @note Copyright 2014 CoverMyMeds, unless otherwise noted
2727
#
2828
define gluster::volume::option (
29-
Optional[String] $value = undef,
30-
Enum['present', 'absent'] $ensure = 'present',
29+
Optional[Variant[Boolean, String, Numeric]] $value = undef,
30+
Enum['present', 'absent'] $ensure = 'present',
3131
) {
3232

3333
$arr = split( $title, ':' )
@@ -39,13 +39,22 @@
3939
$vol = $arr[0]
4040
$opt = $arr[1]
4141

42-
if $ensure == 'absent' {
43-
$cmd = "reset ${vol} ${opt}"
42+
$cmd = if $ensure == 'absent' {
43+
"reset ${vol} ${opt}"
4444
} else {
45-
$cmd = "set ${vol} ${opt} ${value}"
45+
"set ${vol} ${opt} ${value}"
4646
}
4747

48-
exec { "gluster option ${vol} ${opt} ${value}":
49-
command => "${::gluster_binary} volume ${cmd}",
48+
$_value = $value ? {
49+
Boolean => if $value {
50+
'on'
51+
} else {
52+
'off'
53+
},
54+
default => $value,
55+
}
56+
57+
exec { "gluster option ${vol} ${opt} ${_value}":
58+
command => "${facts['gluster_binary']} volume ${cmd}",
5059
}
5160
}

spec/classes/repo_apt_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
is_expected.to contain_apt__source('glusterfs-LATEST').with(
2020
repos: 'main',
2121
release: facts[:lsbdistcodename].to_s,
22-
location: "https://download.gluster.org/pub/gluster/glusterfs/3.12/LATEST/Debian/#{facts[:lsbdistcodename]}/#{facts[:architecture]}/apt/"
22+
location: "https://download.gluster.org/pub/gluster/glusterfs/7/LATEST/Debian/#{facts[:lsbdistcodename]}/#{facts[:architecture]}/apt/"
2323
)
2424
end
2525
end
@@ -47,7 +47,7 @@
4747
is_expected.to contain_apt__source('glusterfs-LATEST').with(
4848
repos: 'main',
4949
release: facts[:lsbdistcodename].to_s,
50-
location: "https://download.gluster.org/pub/gluster/glusterfs/3.12/LATEST/Debian/#{facts[:lsbdistcodename]}/#{facts[:architecture]}/apt/",
50+
location: "https://download.gluster.org/pub/gluster/glusterfs/7/LATEST/Debian/#{facts[:lsbdistcodename]}/#{facts[:architecture]}/apt/",
5151
pin: '700'
5252
)
5353
end
@@ -88,7 +88,7 @@
8888
'id' => '8B7C364430B66F0B084C0B0C55339A4C6A7BD8D4',
8989
'key_source' => 'https://download.gluster.org/pub/gluster/glusterfs/3.12/rsa.pub'
9090
},
91-
location: "https://download.gluster.org/pub/gluster/glusterfs/3.12/LATEST/Debian/#{facts[:lsbdistcodename]}/amd64/apt/"
91+
location: "https://download.gluster.org/pub/gluster/glusterfs/01.old-releases/3.12/LATEST/Debian/#{facts[:lsbdistcodename]}/amd64/apt/"
9292
)
9393
end
9494
end

0 commit comments

Comments
 (0)