17 changes: 14 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
include: ${{fromJson(needs.setup_matrix.outputs.puppet_unit_test_matrix)}}
env:
BUNDLE_WITHOUT: development:system_tests:release
PUPPET_VERSION: "${{ matrix.puppet }}.0"
PUPPET_GEM_VERSION: "~> ${{ matrix.puppet }}.0"
name: Unit / Puppet ${{ matrix.puppet }} (Ruby ${{ matrix.ruby }})
steps:
- uses: actions/checkout@v2
Expand All @@ -51,6 +51,7 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
cache-version: '1'
- name: Run tests
run: bundle exec rake parallel_spec

Expand All @@ -65,8 +66,8 @@ jobs:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
pulpcore_version:
- '3.15'
- '3.14'
- '3.17'
- '3.16'
name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} - Pulp ${{ matrix.pulpcore_version }}
steps:
- uses: actions/checkout@v2
Expand All @@ -75,6 +76,7 @@ jobs:
with:
ruby-version: '2.7'
bundler-cache: true
cache-version: '1'
- name: Run tests
run: bundle exec rake beaker
env:
Expand All @@ -84,3 +86,12 @@ jobs:
# This locale doesn't exist in EL7 and won't be supported either.
LANG: en_US.UTF-8
BEAKER_FACTER_PULPCORE_VERSION: ${{ matrix.pulpcore_version }}

tests:
needs:
- unit
- acceptance
runs-on: ubuntu-latest
name: Test suite
steps:
- run: echo Test suite completed
4 changes: 4 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
# This file is different in that it also tests multiple pulpcore versions
.github/workflows/ci.yml:
unmanaged: true
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
# Changelog

## [6.0.0](https://github.com/theforeman/puppet-pulpcore/tree/6.0.0) (2022-04-20)

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

**Breaking changes:**

- Drop Pulpcore 3.14 & 3.15, move to 3.16 and 3.17 [\#249](https://github.com/theforeman/puppet-pulpcore/pull/249) ([ekohl](https://github.com/ekohl))

**Implemented enhancements:**

- Fixes [\#34684](https://projects.theforeman.org/issues/34684) - install pulp-cli [\#252](https://github.com/theforeman/puppet-pulpcore/pull/252) ([evgeni](https://github.com/evgeni))
- Allow extlib 6.x, apache 7.x, stdlib 8.x, postgresql 8.x [\#246](https://github.com/theforeman/puppet-pulpcore/pull/246) ([ekohl](https://github.com/ekohl))

## [5.2.1](https://github.com/theforeman/puppet-pulpcore/tree/5.2.1) (2022-02-03)

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

**Merged pull requests:**
**Fixed bugs:**

- Fixes [\#34379](https://projects.theforeman.org/issues/34379) - Create the Pulp group as a system group [\#244](https://github.com/theforeman/puppet-pulpcore/pull/244) ([ekohl](https://github.com/ekohl))

Expand Down
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5', groups: ['development', 'test']
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '>= 5.5', groups: ['development', 'test']
gem 'rake'

gem 'kafo_module_lint', {"groups"=>["test"]}
Expand All @@ -15,9 +15,12 @@ gem 'puppet-lint-strict_indent-check', {"groups"=>["test"]}
gem 'puppet-lint-undef_in_function-check', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 1.4', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 0.3'
gem 'puppet_metadata', '~> 1.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 1.0', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}

# Pin rdoc to prevent updating bundled psych (https://github.com/ruby/rdoc/commit/ebe185c8775b2afe844eb3da6fa78adaa79e29a4)
gem 'rdoc', '< 6.4'

# vim:ft=ruby
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ 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.15
### Pulpcore 3.17

Default recommended version.

Starting Pulpcore 3.15 the migration plugin is no longer built. Users should remove the plugin prior to upgrding. The [foreman_maintain Pulp 2 removal procedure](https://github.com/theforeman/foreman_maintain/blob/d49ece67f1dba761bb232229593765f61e01361a/definitions/procedures/pulp/remove.rb#L109-L160) is a good reference. Additionally the package `python3-pulp-2to3-migration` should be removed.
### Pulpcore 3.16

### Pulpcore 3.14

At least pulpcore 3.14.8-2 (and matching plugins) should be used, as this version introduced virtual package names that are used in this module. Certguard 1.4.0-3 should be used to pull in the correct RHSM package.
Supported version.

## Installation layout

Expand Down
92 changes: 92 additions & 0 deletions manifests/cli.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# = Pulpcore command line interface
#
# This class installs the Pulpcore command line interface (CLI).
#
# === Parameters:
#
# $pulpcore_url:: URL on which Pulpcore runs
#
# $username:: Username for authentication
#
# $password:: Password for authentication
#
# $cert:: Client certificate for authentication
#
# $key:: Client key for authentication
#
# === Advanced parameters:
#
# $manage_root_config:: Whether to manage /root/.config/pulp configuration.
#
# $api_root:: Absolute API base path on server (not including 'api/v3/')
#
# $verify_ssl:: Verify SSL connection
#
# $dry_run:: Trace commands without performing any unsafe HTTP calls
#
# $version:: pulp-cli package version, it's passed to ensure parameter of package resource
# can be set to specific version number, 'latest', 'present' etc.
#
class pulpcore::cli (
Optional[Stdlib::HTTPUrl] $pulpcore_url = undef,
String $version = 'installed',
Optional[String] $username = undef,
Optional[String] $password = undef,
Optional[String] $cert = undef,
Optional[String] $key = undef,
Optional[String] $api_root = undef,
Boolean $verify_ssl = true,
Boolean $dry_run = true,
Boolean $manage_root_config = true,
) {
package { 'pulp-cli':
ensure => $version,
}
-> file { '/etc/pulp/cli.toml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
content => epp(
'pulpcore/cli-config.toml.epp',
{
base_url => $pulpcore_url,
api_root => $api_root,
verify_ssl => $verify_ssl,
dry_run => $dry_run,
}
),
}

if $manage_root_config and (($username and $password) or ($cert and $key)) {
file { '/root/.config':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0600',
}
file { '/root/.config/pulp':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0600',
}
file { '/root/.config/pulp/cli.toml':
ensure => file,
owner => 'root',
group => 'root',
mode => '0600',
content => epp(
'pulpcore/cli-config.toml.epp',
{
username => $username,
password => $password,
cert => $cert,
key => $key,
}
),
}
}

Anchor <| title == 'pulpcore::repo' |> ~> Package <| tag == 'pulpcore::cli' |>
}
6 changes: 0 additions & 6 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,6 @@
# You should not need to modify this setting unless the application reports workers timing out while they are busy completing tasks.
# Modification should be performed incrementally to determine the least value that prevents false positive worker timeouts.
#
# @param use_rq_tasking_system
# Use the older RQ workers tasking system instead of the newer PostgreSQL tasking system introduced in Pulpcore 3.14. This is deprecated in 3.15.
# Any benchmarking you did to optimize worker_count or other tasking related parameters will no longer be accurate after changing the tasking system.
# Do not modify this setting unless you understand the implications for performance and stability.
#
# @param service_enable
# Enable/disable Pulp services at boot.
#
Expand Down Expand Up @@ -219,7 +214,6 @@
String[1] $remote_user_environ_name = 'HTTP_REMOTE_USER',
Integer[0] $worker_count = min(8, $facts['processors']['count']),
Optional[Integer[0]] $worker_ttl = undef,
Boolean $use_rq_tasking_system = false,
Boolean $service_enable = true,
Boolean $service_ensure = true,
Integer[0] $content_service_worker_count = (2*min(8, $facts['processors']['count']) + 1),
Expand Down
18 changes: 15 additions & 3 deletions manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# @param version
# The Pulpcore version to use
class pulpcore::repo (
Pattern['^\d+\.\d+$'] $version = '3.15',
Pattern['^\d+\.\d+$'] $version = '3.17',
) {
$dist_tag = "el${facts['os']['release']['major']}"
$context = {
'version' => $version,
'dist_tag' => "el${facts['os']['release']['major']}",
'version' => $version,
'dist_tag' => $dist_tag,
}

file { '/etc/yum.repos.d/pulpcore.repo':
Expand All @@ -19,6 +20,17 @@
notify => Anchor['pulpcore::repo'],
}

if $facts['os']['release']['major'] != '7' {
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'],
}
}

# An anchor is used because it can be collected
anchor { 'pulpcore::repo': } # lint:ignore:anchor_resource
}
17 changes: 5 additions & 12 deletions manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,11 @@
service_content => template('pulpcore/pulpcore-content.service.erb'),
}

if $pulpcore::use_rq_tasking_system {
systemd::unit_file { 'pulpcore-resource-manager.service':
content => template('pulpcore/pulpcore-resource-manager.service.erb'),
active => $pulpcore::service_ensure,
enable => $pulpcore::service_enable,
}
} else {
systemd::unit_file { 'pulpcore-resource-manager.service':
ensure => 'absent',
active => false,
enable => false,
}
# Clean up the RQ tasking system which 3.16 removed
systemd::unit_file { 'pulpcore-resource-manager.service':
ensure => 'absent',
active => false,
enable => false,
}

systemd::unit_file { 'pulpcore-worker@.service':
Expand Down
10 changes: 5 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-pulpcore",
"version": "5.2.1",
"version": "6.0.0",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand All @@ -12,27 +12,27 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.25.0 < 8.0.0"
"version_requirement": ">= 4.25.0 < 9.0.0"
},
{
"name": "puppet/redis",
"version_requirement": ">= 5.0.0 < 9.0.0"
},
{
"name": "puppetlabs/apache",
"version_requirement": ">= 5.4.0 < 7.0.0"
"version_requirement": ">= 5.4.0 < 8.0.0"
},
{
"name": "puppetlabs/postgresql",
"version_requirement": ">= 6.5.0 < 8.0.0"
"version_requirement": ">= 6.5.0 < 9.0.0"
},
{
"name": "puppet/systemd",
"version_requirement": ">= 2.2.0 < 4.0.0"
},
{
"name": "puppet/extlib",
"version_requirement": ">= 3.0.0 < 6.0.0"
"version_requirement": ">= 3.0.0 < 7.0.0"
}
],
"operatingsystem_support": [
Expand Down
Loading