Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ Default value: `'present'`

Data type: `Variant[Stdlib::Httpurl,Array[Stdlib::Httpurl,1]]`

URL containing stable, testing and config apt or yum repositories. If an array is specified then on RedHat family multiple repos will be configured with failover. On Debian family the array can have length 1 only, failover is not supported for Debian.
URL containing stable, testing and config apt or yum repositories. If an array is specified then on RedHat family or Debian 13 or newer multiple repos will be configured with failover. For older Debian and Ubuntu only one repository can be configured.

##### <a name="-cvmfs--repo_base_alt"></a>`repo_base_alt`

Expand Down
4 changes: 3 additions & 1 deletion data/family/Debian.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---

cvmfs::repo_base: https://cvmrepo.s3.cern.ch/cvmrepo/apt
cvmfs::repo_base:
- 'https://cvmrepo.s3.cern.ch/cvmrepo/apt'
- 'https://cvmrepo.web.cern.ch/cvmrepo/apt'
cvmfs::repo_base_alt: https://cvmrepo.web.cern.ch/cvmrepo/apt
cvmfs::repo_gpgkey: https://cvmrepo.s3.cern.ch/cvmrepo/apt/cernvm.gpg
2 changes: 2 additions & 0 deletions data/name/Debian/11.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
cvmfs::repo_base: 'https://cvmrepo.s3.cern.ch/cvmrepo/apt'
2 changes: 2 additions & 0 deletions data/name/Debian/12.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
cvmfs::repo_base: 'https://cvmrepo.s3.cern.ch/cvmrepo/apt'
2 changes: 2 additions & 0 deletions data/name/Ubuntu/22.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
cvmfs::repo_base: 'https://cvmrepo.s3.cern.ch/cvmrepo/apt'
2 changes: 2 additions & 0 deletions data/name/Ubuntu/24.04.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
cvmfs::repo_base: 'https://cvmrepo.s3.cern.ch/cvmrepo/apt'
3 changes: 1 addition & 2 deletions manifests/apt.pp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
Optional[Stdlib::Httpurl] $repo_proxy = $cvmfs::repo_proxy,
Boolean $repo_gpgcheck = $cvmfs::repo_gpgcheck,
) {
# We already reject arrays of more than one element in init.pp

if ($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'],'12') <= 0 ) or
($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'],'24.04') <= 0 ) {
$_source_format = 'list'
Expand All @@ -20,6 +18,7 @@
source => $repo_gpgkey,
}
$_keyring = undef
# We already reject arrays of more than one element in init.pp
$_location = Array($repo_base,true)[0] # Take first one for old format.
$_release_cvmfs = "${facts['os']['distro']['codename']}-prod"
$_release_testing = "${facts['os']['distro']['codename']}-testing"
Expand Down
9 changes: 6 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
# @param cvmfs_max_ttl Max ttl.
# @param cvmfs_version Version of cvmfs to install.
# @param repo_base
# URL containing stable, testing and config apt or yum repositories. If an array is specified then on RedHat family multiple repos will be configured with failover. On Debian family the array can have length 1 only, failover is not supported for Debian.
# URL containing stable, testing and config apt or yum repositories. If an array is specified then on RedHat family or Debian 13 or newer multiple repos will be configured with failover. For older Debian and Ubuntu only one repository can be configured.
# @param repo_base_alt URL containing stable, Same as repo_base, hosted on a different backend. Default in hiera data.
# @param repo_includepkgs Specify an includepkgs to the yum repos to ignore other packages.
# @param repo_priority Yum priority of repositories
Expand Down Expand Up @@ -242,8 +242,11 @@
}

# Unsupported combinations
if $facts['os']['family'] == 'Debian' and $repo_base =~ Array[Any,2] {
fail('With Debian family OSes only a single url for the \"repo_base\" parameter is supported')
if (
($facts['os']['name'] == 'Debian' and versioncmp($facts['os']['release']['major'],'12') <= 0 ) or
($facts['os']['name'] == 'Ubuntu' and versioncmp($facts['os']['release']['major'],'24.04') <= 0 )
) and $repo_base =~ Array[Any,2] {
fail('With Debian 11, 12 or Ubuntu 22.04, 24.04 only a single url for the \"repo_base\" parameter is supported')
}

if $repo_manage {
Expand Down
34 changes: 30 additions & 4 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,21 +264,30 @@
{
ensure: 'present',
enabled: true,
location: ['https://cvmrepo.s3.cern.ch/cvmrepo/apt'],
location: [
'https://cvmrepo.s3.cern.ch/cvmrepo/apt',
'https://cvmrepo.web.cern.ch/cvmrepo/apt',
],
}
)
is_expected.to contain_apt__source('cvmfs-testing').with(
{
ensure: 'present',
enabled: false,
location: ['https://cvmrepo.s3.cern.ch/cvmrepo/apt'],
location: [
'https://cvmrepo.s3.cern.ch/cvmrepo/apt',
'https://cvmrepo.web.cern.ch/cvmrepo/apt',
],
}
)
is_expected.to contain_apt__source('cvmfs-future').with(
{
ensure: 'present',
enabled: false,
location: ['https://cvmrepo.s3.cern.ch/cvmrepo/apt'],
location: [
'https://cvmrepo.s3.cern.ch/cvmrepo/apt',
'https://cvmrepo.web.cern.ch/cvmrepo/apt',
],
}
)
}
Expand Down Expand Up @@ -418,7 +427,24 @@
it { is_expected.to contain_yumrepo('cvmfs-testing').with_baseurl(%r{^http://example.org/base/cvmfs-testing/(EL|fedora)/\d+/x86_64 http://example.net/base/cvmfs-testing/(EL|fedora)/\d+/x86_64$}) }
it { is_expected.to contain_yumrepo('cvmfs-config').with_baseurl(%r{^http://example.org/base/cvmfs-config/(EL|fedora)/\d+/x86_64 http://example.net/base/cvmfs-config/(EL|fedora)/\d+/x86_64$}) }
else
it { is_expected.to compile.and_raise_error(%r{Debian family OSes only a single url}) }
case [facts[:os]['name'], facts[:os]['release']['major']]
when %w[Debian 11], %w[Debian 12], ['Ubuntu', '22.04'], ['Ubuntu', '24.04']
it { is_expected.to compile.and_raise_error(%r{only a single url for the}) }
else
it {
is_expected.to contain_apt__source('cvmfs').with(
{
ensure: 'present',
enabled: true,
location: [
'http://example.org/base',
'http://example.net/base',
],
}
)
}

end
end
end

Expand Down