2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
setfile: ${{fromJson(needs.setup_matrix.outputs.beaker_setfiles)}}
puppet: ${{fromJson(needs.setup_matrix.outputs.puppet_major_versions)}}
pulpcore_version:
- '3.21'
- '3.18'
- '3.17'
- '3.16'
name: Acceptance / ${{ matrix.puppet.name }} - ${{ matrix.setfile.name }} - Pulp ${{ matrix.pulpcore_version }}
Expand Down
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Changelog

## [7.0.0](https://github.com/theforeman/puppet-pulpcore/tree/7.0.0) (2022-10-28)

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

**Breaking changes:**

- Drop EL7 support [\#257](https://github.com/theforeman/puppet-pulpcore/pull/257) ([ehelms](https://github.com/ehelms))

**Implemented enhancements:**

- Fixes [\#35607](https://projects.theforeman.org/issues/35607) - Configure Pulpcore's TELEMETRY setting [\#267](https://github.com/theforeman/puppet-pulpcore/pull/267) ([wbclark](https://github.com/wbclark))
- Add pulpcore 3.21 support [\#266](https://github.com/theforeman/puppet-pulpcore/pull/266) ([sjha4](https://github.com/sjha4))
- Add a loggers parameter and set default loggers [\#265](https://github.com/theforeman/puppet-pulpcore/pull/265) ([ekohl](https://github.com/ekohl))
- Fixes [\#35496](https://projects.theforeman.org/issues/35496) - Add default pulp\_deb config [\#263](https://github.com/theforeman/puppet-pulpcore/pull/263) ([quba42](https://github.com/quba42))
- Allow puppetlabs/apache 8.x [\#261](https://github.com/theforeman/puppet-pulpcore/pull/261) ([ekohl](https://github.com/ekohl))
- Update to voxpupuli-test 5 [\#258](https://github.com/theforeman/puppet-pulpcore/pull/258) ([ekohl](https://github.com/ekohl))
- Add Pulpcore 3.18 support [\#256](https://github.com/theforeman/puppet-pulpcore/pull/256) ([ianballou](https://github.com/ianballou))

**Fixed bugs:**

- Fixes [\#35390](https://projects.theforeman.org/issues/35390) - set ANSIBLE\_API\_HOSTNAME \*with\* scheme [\#262](https://github.com/theforeman/puppet-pulpcore/pull/262) ([evgeni](https://github.com/evgeni))

## [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)
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem 'puppet-lint-param-docs', '>= 1.3.0', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', {"groups"=>["test"]}
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 'voxpupuli-test', '~> 5.0', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 1.3'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ 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.17
### Pulpcore 3.21

Default recommended version.

### Pulpcore 3.18

Supported version.

### Pulpcore 3.17

Supported version.

### Pulpcore 3.16

Supported version.
Expand Down
2 changes: 1 addition & 1 deletion manifests/admin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# The directory to run pulpcore-manager from.
#
# @see exec
define pulpcore::admin(
define pulpcore::admin (
String $command = $title,
Boolean $refreshonly = false,
Optional[String] $unless = undef,
Expand Down
4 changes: 2 additions & 2 deletions manifests/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
Hash[String, Any] $http_vhost_options = {},
Hash[String, Any] $https_vhost_options = {},
Enum['none', 'optional', 'require', 'optional_no_ca'] $ssl_verify_client = 'optional',
Hash $content_proxy_params = {'timeout' => '600', 'disablereuse' => 'on'},
Hash $api_proxy_params = {'timeout' => '600'},
Hash $content_proxy_params = { 'timeout' => '600', 'disablereuse' => 'on' },
Hash $api_proxy_params = { 'timeout' => '600' },
) {
include pulpcore

Expand Down
19 changes: 18 additions & 1 deletion manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@
order => '01',
}

$loggers = {
'pulpcore.deprecation' => {
'level' => 'ERROR',
},
'django_guid' => {
'level' => 'WARNING',
},
} + $pulpcore::loggers

concat::fragment { 'logging':
target => 'pulpcore settings',
content => epp('pulpcore/settings-logging.py.epp', {
'level' => $pulpcore::log_level,
'loggers' => $loggers,
}),
order => '02',
}

file { $pulpcore::user_home:
ensure => directory,
owner => $pulpcore::user,
Expand Down Expand Up @@ -63,5 +81,4 @@
mode => '0640',
require => Exec['Create database symmetric key'],
}

}
3 changes: 1 addition & 2 deletions manifests/database.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Set up the PostgreSQL and Redis databases
# @api private
class pulpcore::database(
class pulpcore::database (
Integer[0] $timeout = 3600,
) {
if $pulpcore::postgresql_manage_db {
Expand Down Expand Up @@ -32,5 +32,4 @@
}

contain redis

}
15 changes: 13 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,16 @@
# The number of seconds that content should be cached for. Specify 'None' to never expire the cache.
#
# @param log_level
# Sets the log level.
# Sets the log level for the root logger.
#
# @param loggers
# Configure additional loggers or override pre-defined logger configuration.
#
# @param telemetry
# Configure TELEMETRY in settings.yml, which controls the reporting of anonymous data to https://analytics.pulpproject.org/,
# starting with Pulpcore version 3.21.0, to guide Pulp project developers. Set this to false to opt out of this anonymous reporting;
# if undef, it will instead be omitted from settings.yml and Pulp will report these usage statistics per its default behavior.
# Adding this configuration will have no effect in Pulp versions prior to the introduction of the telemetry feature.
#
# @example Default configuration
# include pulpcore
Expand Down Expand Up @@ -223,7 +232,9 @@
Hash[String[1], String[1]] $api_client_auth_cn_map = {},
Boolean $cache_enabled = false,
Optional[Variant[Integer[1], Enum['None']]] $cache_expires_ttl = undef,
Enum['CRITICAL', 'ERROR', 'WARNING', 'INFO', 'DEBUG'] $log_level = 'INFO',
Pulpcore::LogLevel $log_level = 'INFO',
Hash[String[1], Pulpcore::Logger] $loggers = {},
Optional[Boolean] $telemetry = undef,
) {
$settings_file = "${config_dir}/settings.py"
$certs_dir = "${config_dir}/certs"
Expand Down
1 change: 0 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#
# @api private
class pulpcore::install {

package { 'pulpcore':
ensure => present,
}
Expand Down
2 changes: 1 addition & 1 deletion manifests/plugin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# @param https_content
# Optional fragment for the Apache HTTPS vhost
define pulpcore::plugin(
define pulpcore::plugin (
String $package_name = "pulpcore-plugin(${title})",
Optional[String] $config = undef,
Optional[String] $http_content = undef,
Expand Down
6 changes: 4 additions & 2 deletions manifests/plugin/ansible.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# @param ansible_galaxy_path
# In the Apache configuration the path to forward to the api app
# for ansible galaxy support
class pulpcore::plugin::ansible(
class pulpcore::plugin::ansible (
String $ansible_galaxy_path = '/pulp_ansible/galaxy/',
) {
$context = {
Expand All @@ -19,12 +19,14 @@
fail('HTTPS must be turned on for Ansible content')
} elsif $pulpcore::apache::https_port != 443 {
$external_content_url = "https://${pulpcore::servername}:${pulpcore::apache::https_port}${pulpcore::apache::content_path}"
$external_api_url = "https://${pulpcore::servername}:${pulpcore::apache::https_port}"
} else {
$external_content_url = "https://${pulpcore::servername}${pulpcore::apache::content_path}"
$external_api_url = "https://${pulpcore::servername}"
}

pulpcore::plugin { 'ansible':
config => "ANSIBLE_API_HOSTNAME = \"${pulpcore::servername}\"\nANSIBLE_CONTENT_HOSTNAME = \"${external_content_url}\"",
config => "ANSIBLE_API_HOSTNAME = \"${external_api_url}\"\nANSIBLE_CONTENT_HOSTNAME = \"${external_content_url}\"",
https_content => epp('pulpcore/apache-fragment.epp', $context),
}
}
10 changes: 9 additions & 1 deletion manifests/plugin/deb.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# @summary Pulp Deb plugin
# @param use_pulp2_content_route Whether to redirect the legacy (Pulp 2) URL, /pulp/deb/, to the content server
# @param use_pulp2_content_route
# Whether to redirect the legacy (Pulp 2) URL, /pulp/deb/, to the content server
# @param force_ignore_missing_package_indices
# Wheter to set the FORCE_IGNORE_MISSING_PACKAGE_INDICES setting to True or
# False in /etc/pulp/settings.py.
class pulpcore::plugin::deb (
Boolean $use_pulp2_content_route = false,
Boolean $force_ignore_missing_package_indices = true,
) {
if $use_pulp2_content_route {
$context = {
Expand All @@ -27,7 +32,10 @@
$content = undef
}

$deb_plugin_config_fimpi = to_python($force_ignore_missing_package_indices)

pulpcore::plugin { 'deb':
config => "FORCE_IGNORE_MISSING_PACKAGE_INDICES = ${deb_plugin_config_fimpi}",
http_content => $content,
https_content => $content,
}
Expand Down
1 change: 0 additions & 1 deletion manifests/plugin/ostree.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# @summary Pulp Ostree plugin
#
# This plugin is not packaged on EL7.
class pulpcore::plugin::ostree {
pulpcore::plugin { 'ostree': }
}
18 changes: 8 additions & 10 deletions 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.17',
Pattern['^\d+\.\d+$'] $version = '3.21',
) {
$dist_tag = "el${facts['os']['release']['major']}"
$context = {
Expand All @@ -20,15 +20,13 @@
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'],
}
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
Expand Down
8 changes: 3 additions & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-pulpcore",
"version": "6.0.0",
"version": "7.0.0",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand All @@ -12,15 +12,15 @@
},
{
"name": "puppetlabs/stdlib",
"version_requirement": ">= 4.25.0 < 9.0.0"
"version_requirement": ">= 8.3.0 < 9.0.0"
},
{
"name": "puppet/redis",
"version_requirement": ">= 5.0.0 < 9.0.0"
},
{
"name": "puppetlabs/apache",
"version_requirement": ">= 5.4.0 < 8.0.0"
"version_requirement": ">= 5.4.0 < 9.0.0"
},
{
"name": "puppetlabs/postgresql",
Expand All @@ -39,14 +39,12 @@
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"7",
"8"
]
},
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"7",
"8"
]
}
Expand Down
7 changes: 1 addition & 6 deletions spec/acceptance/basic_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@ class { 'pulpcore':
it { is_expected.to be_listening }
end

describe service('rh-redis5-redis'), if: %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7 do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end

describe service('redis'), unless: %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7 do
describe service('redis') do
it { is_expected.to be_running }
it { is_expected.to be_enabled }
end
Expand Down
12 changes: 2 additions & 10 deletions spec/acceptance/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,14 @@ class { 'pulpcore::cli':
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { is_expected.to match(/versions/) }
its(:stderr) { is_expected.not_to match(/Error/) }
# currently this contains a warning:
# SubjectAltNameWarning: Certificate for centos7-64.example.com has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818.
unless %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7
its(:stderr) { is_expected.to eq '' }
end
its(:stderr) { is_expected.to eq '' }
end

describe command("REQUESTS_CA_BUNDLE=/etc/pulpcore-certs/ca-cert.pem pulp user list") do
its(:exit_status) { is_expected.to eq 0 }
its(:stdout) { is_expected.to match(/admin/) }
its(:stderr) { is_expected.not_to match(/Error/) }
# currently this contains a warning:
# SubjectAltNameWarning: Certificate for centos7-64.example.com has no `subjectAltName`, falling back to check for a `commonName` for now. This feature is being removed by major browsers and deprecated by RFC 2818.
unless %w[centos redhat].include?(os[:family]) && os[:release].to_i == 7
its(:stderr) { is_expected.to eq '' }
end
its(:stderr) { is_expected.to eq '' }
end
end

Expand Down
11 changes: 0 additions & 11 deletions spec/acceptance/hieradata/os/RedHat/7.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion spec/classes/plugin_ansible_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
is_expected.to contain_apache__vhost__fragment('pulpcore-https-plugin-ansible')
.with_content(expected_vhost_content)
is_expected.to contain_concat__fragment('plugin-ansible')
.with_content(/^ANSIBLE_API_HOSTNAME = "foo.example.com"/)
.with_content(%r{^ANSIBLE_API_HOSTNAME = "https://foo.example.com"})
.with_content(%r{^ANSIBLE_CONTENT_HOSTNAME = "https://foo.example.com/pulp/content"})
end
end
Expand Down
10 changes: 10 additions & 0 deletions spec/classes/plugin_deb_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@
is_expected.to contain_pulpcore__plugin('deb')
.that_subscribes_to('Class[Pulpcore::Install]')
.that_notifies(['Class[Pulpcore::Database]', 'Class[Pulpcore::Service]'])
.with_config('FORCE_IGNORE_MISSING_PACKAGE_INDICES = True')
end

context 'with force ignore missing set' do
let(:params) { { force_ignore_missing_package_indices: false } }

it do
is_expected.to contain_pulpcore__plugin('deb')
.with_config('FORCE_IGNORE_MISSING_PACKAGE_INDICES = False')
end
end

context 'with pulp2 content route' do
Expand Down
Loading