Showing with 54 additions and 6 deletions.
  1. +1 −0 .github/workflows/ci.yml
  2. +9 −0 CHANGELOG.md
  3. +5 −1 README.md
  4. +7 −0 manifests/database.pp
  5. +10 −2 manifests/plugin/rpm.pp
  6. +1 −1 manifests/repo.pp
  7. +1 −1 metadata.json
  8. +11 −1 spec/classes/plugin_rpm_spec.rb
  9. +9 −0 templates/settings-rpm.py.epp
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
pulpcore_version:
- '3.22'
- '3.21'
- '3.18'
- '3.17'
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## [7.2.0](https://github.com/theforeman/puppet-pulpcore/tree/7.2.0) (2023-03-06)

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

**Implemented enhancements:**

- Fixes [\#36030](https://projects.theforeman.org/issues/36030) - Ensure HStore is enabled for Pulp 3.22 support [\#275](https://github.com/theforeman/puppet-pulpcore/pull/275) ([ekohl](https://github.com/ekohl))
- Add param for unsafe advisory conflict resolution [\#274](https://github.com/theforeman/puppet-pulpcore/pull/274) ([m-bucher](https://github.com/m-bucher))

## [7.1.0](https://github.com/theforeman/puppet-pulpcore/tree/7.1.0) (2022-12-13)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/7.0.1...7.1.0)
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ 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.21
### Pulpcore 3.22

Default recommended version.

### Pulpcore 3.21

Supported version

### Pulpcore 3.18

Supported version.
Expand Down
7 changes: 7 additions & 0 deletions manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
if $pulpcore::postgresql_manage_db {
include postgresql::client
include postgresql::server
include postgresql::server::contrib
postgresql::server::db { $pulpcore::postgresql_db_name:
user => $pulpcore::postgresql_db_user,
password => postgresql::postgresql_password($pulpcore::user, $pulpcore::postgresql_db_password),
Expand All @@ -14,6 +15,12 @@
before => Pulpcore::Admin['migrate --noinput'],
}

postgresql::server::extension { "hstore for ${pulpcore::postgresql_db_name}":
database => $pulpcore::postgresql_db_name,
extension => 'hstore',
require => Class['postgresql::server::contrib'],
}

# pulpcore-content fails to reconnect to the database, so schedule a restart whenever the db changes
# see https://pulp.plan.io/issues/9276 for details
Class['postgresql::server::service'] ~> Service['pulpcore-content.service']
Expand Down
12 changes: 10 additions & 2 deletions manifests/plugin/rpm.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@
# Pulpcore's KEEP_CHANGELOG_LIMIT setting. Uses Pulpcore's default when
# undefined. Increasing this limit will cause pulpcore workers to use more
# memory when more changelogs are available in the repo metadata.
#
# @param allow_automatic_unsafe_advisory_conflict_resolution
# Allow resolving of conflicts due to duplicate advisory ids with different creation dates
# https://docs.pulpproject.org/pulp_rpm/settings.html#allow-automatic-unsafe-advisory-conflict-resolution
class pulpcore::plugin::rpm (
Boolean $use_pulp2_content_route = false,
Optional[Integer[0]] $keep_changelog_limit = undef,
Boolean $allow_automatic_unsafe_advisory_conflict_resolution = false,
) {
if $use_pulp2_content_route {
$context = {
Expand All @@ -34,8 +39,11 @@
$content = undef
}

if $keep_changelog_limit {
$rpm_plugin_config = "KEEP_CHANGELOG_LIMIT = ${keep_changelog_limit}"
if $keep_changelog_limit or $allow_automatic_unsafe_advisory_conflict_resolution {
$rpm_plugin_config = epp('pulpcore/settings-rpm.py.epp', {
'allow_auacr' => $allow_automatic_unsafe_advisory_conflict_resolution,
'keep_changelog_limit' => $keep_changelog_limit,
})
} else {
$rpm_plugin_config = undef
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/repo.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @param version
# The Pulpcore version to use
class pulpcore::repo (
Pattern['^\d+\.\d+$'] $version = '3.21',
Pattern['^\d+\.\d+$'] $version = '3.22',
) {
$dist_tag = "el${facts['os']['release']['major']}"
$context = {
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": "7.1.0",
"version": "7.2.0",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand Down
12 changes: 11 additions & 1 deletion spec/classes/plugin_rpm_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,23 @@
is_expected.not_to contain_concat__fragment('plugin-rpm')
end

context 'with allow_unsafe_advisory_conflict_resolution' do
let(:params) { { allow_automatic_unsafe_advisory_conflict_resolution: true } }

it 'configures pulpcore with ALLOW_AUTOMATIC_UNSAFE_ADVISORY_CONFLICT_RESOLUTION' do
is_expected.to compile.with_all_deps
is_expected.to contain_concat__fragment('plugin-rpm')
.with_content("\n# rpm plugin settings\nALLOW_AUTOMATIC_UNSAFE_ADVISORY_CONFLICT_RESOLUTION = True\n")
end
end

context 'with keep_changelog_limit' do
let(:params) { { keep_changelog_limit: 20 } }

it 'configures pulpcore with KEEP_CHANGELOG_LIMIT' do
is_expected.to compile.with_all_deps
is_expected.to contain_concat__fragment('plugin-rpm')
.with_content("\n# rpm plugin settings\nKEEP_CHANGELOG_LIMIT = 20")
.with_content("\n# rpm plugin settings\nKEEP_CHANGELOG_LIMIT = 20\n")
end
end

Expand Down
9 changes: 9 additions & 0 deletions templates/settings-rpm.py.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<%- | Boolean $allow_auacr,
Optional[Integer[0]] $keep_changelog_limit
| -%>
<%- if $keep_changelog_limit { -%>
KEEP_CHANGELOG_LIMIT = <%= $keep_changelog_limit %>
<%- } -%>
<%- if $allow_auacr { -%>
ALLOW_AUTOMATIC_UNSAFE_ADVISORY_CONFLICT_RESOLUTION = True
<%- } -%>