-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This class uses the new yum.theforeman.org repos that are versions per Pulpcore release. This allows easy switching between versions. It also properly sets the GPG key validation. It does switch acceptance testing from staging repositories to stable repositories. Another implication is that it switches to Pulpcore 3.6 by default. This was chosen since 3.7 is not complete yet.
- Loading branch information
Showing
6 changed files
with
71 additions
and
15 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 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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Configure the Pulpcore repo | ||
# | ||
# @param version | ||
# The Pulpcore version to use | ||
class pulpcore::repo ( | ||
Pattern['^\d+\.\d+$'] $version = '3.6', | ||
) { | ||
$context = { | ||
'version' => $version, | ||
'dist_code' => "el${facts['os']['release']['major']}", | ||
} | ||
|
||
file { '/etc/yum.repos.d/pulpcore.repo': | ||
ensure => file, | ||
owner => 'root', | ||
group => 'root', | ||
mode => '0644', | ||
content => epp('pulpcore/repo.epp', $context), | ||
notify => Anchor['pulpcore::repo'], | ||
} | ||
|
||
# An anchor is used because it can be collected | ||
anchor { 'pulpcore::repo': } # lint:ignore:anchor_resource | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
require 'spec_helper' | ||
|
||
describe 'pulpcore::repo' do | ||
on_supported_os.each do |os, os_facts| | ||
context "on #{os}" do | ||
let(:facts) { os_facts } | ||
|
||
it { is_expected.to compile.with_all_deps } | ||
it do | ||
is_expected.to contain_anchor('pulpcore::repo') | ||
is_expected.to contain_file('/etc/yum.repos.d/pulpcore.repo') | ||
.with_content(%r{^baseurl=https://yum.theforeman.org/pulpcore/\d+\.\d+/el\d+/\$basearch$}) | ||
.that_comes_before('Anchor[pulpcore::repo]') | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<%- | String[1] $version, String[1] $dist_code | -%> | ||
[pulpcore] | ||
name=Pulpcore <%= $version %> | ||
baseurl=https://yum.theforeman.org/pulpcore/<%= $version %>/<%= $dist_code %>/$basearch | ||
enabled=1 | ||
gpgcheck=1 | ||
gpgkey=https://yum.theforeman.org/pulpcore/<%= $version %>/GPG-RPM-KEY-pulpcore | ||
module_hotfixes=1 | ||
|
||
[pulpcore-source] | ||
name=Pulpcore ${version} Soure | ||
baseurl=https://yum.theforeman.org/pulpcore/<%= $version %>/<%= $dist_code %>/source | ||
enabled=0 | ||
gpgcheck=1 | ||
gpgkey=https://yum.theforeman.org/pulpcore/<%= $version %>/GPG-RPM-KEY-pulpcore | ||
module_hotfixes=1 |