Showing with 57 additions and 76 deletions.
  1. +1 −0 .fixtures.yml
  2. +1 −1 .github/workflows/ci.yml
  3. +1 −1 .sync.yml
  4. +13 −0 CHANGELOG.md
  5. +1 −13 README.md
  6. +15 −24 manifests/repo.pp
  7. +1 −1 metadata.json
  8. +1 −1 spec/classes/pulpcore_spec.rb
  9. +21 −16 spec/classes/repo_spec.rb
  10. +1 −1 templates/pulpcore-api.service.erb
  11. +1 −2 templates/pulpcore-content.service.erb
  12. +0 −16 templates/repo.epp
1 change: 1 addition & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ fixtures:
puppet_version: '>= 6.0.0'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
systemd: 'https://github.com/voxpupuli/puppet-systemd'
yumrepo_core: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core'
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ jobs:
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
with:
pidfile_workaround: 'false'
beaker_facter: 'pulpcore_version:Pulp:3.28,3.22,3.21'
beaker_facter: 'pulpcore_version:Pulp:nightly,3.39'
rubocop: false
cache-version: '1'
2 changes: 1 addition & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
---
.github/workflows/ci.yml:
beaker_facter: 'pulpcore_version:Pulp:3.28,3.22,3.21'
beaker_facter: 'pulpcore_version:Pulp:nightly,3.39'
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## [9.0.0](https://github.com/theforeman/puppet-pulpcore/tree/9.0.0) (2023-11-28)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/8.6.0...9.0.0)

**Breaking changes:**

- Fixes [\#36902](https://projects.theforeman.org/issues/36902) - Support Pulpcore 3.39, drop older versions [\#315](https://github.com/theforeman/puppet-pulpcore/pull/315) ([ianballou](https://github.com/ianballou))

**Implemented enhancements:**

- Use the yumrepo type to manage the repository & expose more params [\#320](https://github.com/theforeman/puppet-pulpcore/pull/320) ([ekohl](https://github.com/ekohl))
- Support nightly repository version [\#318](https://github.com/theforeman/puppet-pulpcore/pull/318) ([ehelms](https://github.com/ehelms))

## [8.6.0](https://github.com/theforeman/puppet-pulpcore/tree/8.6.0) (2023-11-15)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/8.5.0...8.6.0)
Expand Down
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,10 @@ All supported versions are listed below. For every supported version, acceptance

Supported operating systems are listed in `metadata.json` but individual releases can divert from that. For example, if Pulpcore x.y drops EL7, it will still be listed in metadata.json until all versions supported by the module have dropped it. Similarly, if x.z adds support for EL9, it'll be listed in `metadata.json` and all versions that don't support EL9 will have a note.

### Pulpcore 3.28
### Pulpcore 3.39

Default recommended version.

### Pulpcore 3.22

Supported version.

### Pulpcore 3.21

Supported version. The parameter `$hide_guarded_distributions` doesn't work since it's a Pulp 3.22 feature.

### Pulpcore 3.16 - 3.18

Untested, but should work besides the `$hide_guarded_distributions` parameter. Not recommended.

## Installation layout

Pulpcore doesn't mandate a specific layout so this module creates and manages this. There are some constraints, mostly due to SELinux support.
Expand Down
39 changes: 15 additions & 24 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,25 @@
#
# @param version
# The Pulpcore version to use
# @param baseurl
# An optional base URL to be used for yumrepo, instead of the default
# @param gpgkey
# An optional value for gpgkey to be used for yumrepo, instead of the default.
# If an empty string is passed, gpgcheck will be disabled.
class pulpcore::repo (
Pattern['^\d+\.\d+$'] $version = '3.28',
Variant[Enum['nightly'], Pattern['^\d+\.\d+$']] $version = '3.39',
Optional[Stdlib::HTTPUrl] $baseurl = undef,
Optional[String[0]] $gpgkey = undef,
) {
$dist_tag = "el${facts['os']['release']['major']}"
$context = {
'version' => $version,
'dist_tag' => $dist_tag,
}

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'],
}

# Only EL8 has DNF modules
if $dist_tag == 'el8' {
package { 'pulpcore-dnf-module':
ensure => $dist_tag,
name => 'pulpcore',
enable_only => true,
provider => 'dnfmodule',
require => File['/etc/yum.repos.d/pulpcore.repo'],
notify => Anchor['pulpcore::repo'],
}
yumrepo { 'pulpcore':
descr => "Pulpcore ${version}",
baseurl => pick($baseurl, "https://yum.theforeman.org/pulpcore/${version}/${dist_tag}/\$basearch"),
enabled => '1',
gpgcheck => if $gpgkey == '' or $version == 'nightly' { '0' } else { '1' },
gpgkey => pick($gpgkey, "https://yum.theforeman.org/pulpcore/${version}/GPG-RPM-KEY-pulpcore"),
notify => Anchor['pulpcore::repo'],
}

# An anchor is used because it can be collected
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-pulpcore",
"version": "8.6.0",
"version": "9.0.0",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand Down
2 changes: 1 addition & 1 deletion spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@
it do
is_expected.to compile.with_all_deps
is_expected.to contain_class('pulpcore::repo')
is_expected.to contain_file('/etc/yum.repos.d/pulpcore.repo').that_notifies('Class[pulpcore::install]')
is_expected.to contain_yumrepo('pulpcore').that_notifies('Class[pulpcore::install]')
end
end

Expand Down
37 changes: 21 additions & 16 deletions spec/classes/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,31 @@
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$})
describe "with default values" do
it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_anchor('pulpcore::repo') }
it { is_expected.to contain_yumrepo('pulpcore')
.with_baseurl(%r{https://yum.theforeman.org/pulpcore/\d+\.\d+/el\d+/\$basearch$})
.with_gpgcheck(1)
.with_gpgkey(%r{https://yum.theforeman.org/pulpcore/\d+\.\d+/GPG-RPM-KEY-pulpcore})
.that_notifies('Anchor[pulpcore::repo]')
}
end

if os_facts[:os]['release']['major'] == '8'
it 'configures the pulpcore module' do
is_expected.to contain_package('pulpcore-dnf-module')
.with_name('pulpcore')
.with_ensure(/^el\d+/)
.with_enable_only(true)
.with_provider('dnfmodule')
.that_requires('File[/etc/yum.repos.d/pulpcore.repo]')
.that_notifies('Anchor[pulpcore::repo]')
describe "with nightly version" do
let :params do
{
version: 'nightly',
gpgkey: '',
}
end
else
it { is_expected.not_to contain_package('pulpcore-dnf-module') }

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_yumrepo('pulpcore')
.with_baseurl(%r{https://yum.theforeman.org/pulpcore/nightly/el\d+/\$basearch$})
.with_gpgcheck(0)
.that_notifies('Anchor[pulpcore::repo]')
}
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion templates/pulpcore-api.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ User=<%= scope['pulpcore::user'] %>
Group=<%= scope['pulpcore::group'] %>
WorkingDirectory=<%= scope['pulpcore::user_home'] %>
RuntimeDirectory=pulpcore-api
ExecStart=/usr/libexec/pulpcore/gunicorn pulpcore.app.wsgi:application \
ExecStart=/usr/bin/pulpcore-api \
--preload \
--timeout <%= scope['pulpcore::api_service_worker_timeout'] %> \
--workers <%= scope['pulpcore::api_service_worker_count'] %> \
Expand Down
3 changes: 1 addition & 2 deletions templates/pulpcore-content.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ User=<%= scope['pulpcore::user'] %>
Group=<%= scope['pulpcore::group'] %>
WorkingDirectory=<%= scope['pulpcore::user_home'] %>
RuntimeDirectory=pulpcore-content
ExecStart=/usr/libexec/pulpcore/gunicorn pulpcore.content:server \
ExecStart=/usr/bin/pulpcore-content \
--preload \
--timeout <%= scope['pulpcore::content_service_worker_timeout'] %> \
--worker-class 'aiohttp.GunicornWebWorker' \
--workers <%= scope['pulpcore::content_service_worker_count'] %> \
--access-logfile -
ExecReload=/bin/kill -s HUP $MAINPID
Expand Down
16 changes: 0 additions & 16 deletions templates/repo.epp

This file was deleted.