Showing with 57 additions and 33 deletions.
  1. +0 −1 .fixtures.yml
  2. +17 −0 CHANGELOG.md
  3. +1 −0 manifests/admin.pp
  4. +5 −1 manifests/init.pp
  5. +1 −5 metadata.json
  6. +32 −25 spec/classes/pulpcore_spec.rb
  7. +1 −1 templates/settings.py.erb
1 change: 0 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ fixtures:
extlib: 'https://github.com/voxpupuli/puppet-extlib'
postgresql: 'https://github.com/puppetlabs/puppetlabs-postgresql'
redis: 'https://github.com/voxpupuli/puppet-redis'
selinux: 'https://github.com/voxpupuli/puppet-selinux'
selinux_core:
repo: 'https://github.com/puppetlabs/puppetlabs-selinux_core'
puppet_version: '>= 6.0.0'
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [2.2.0](https://github.com/theforeman/puppet-pulpcore/tree/2.2.0) (2020-12-03)

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

**Implemented enhancements:**

- Set logoutput to on\_failure for pulpcore::admin [\#148](https://github.com/theforeman/puppet-pulpcore/pull/148) ([ekohl](https://github.com/ekohl))
- Fixes [\#30436](https://projects.theforeman.org/issues/30436) - add allowed\_export\_paths to settings.py [\#147](https://github.com/theforeman/puppet-pulpcore/pull/147) ([jeremylenz](https://github.com/jeremylenz))

**Fixed bugs:**

- Drop selinux module dependency [\#149](https://github.com/theforeman/puppet-pulpcore/pull/149) ([ekohl](https://github.com/ekohl))

**Merged pull requests:**

- Correct allowed\_{export,import}\_paths tests [\#150](https://github.com/theforeman/puppet-pulpcore/pull/150) ([ekohl](https://github.com/ekohl))

## [2.1.0](https://github.com/theforeman/puppet-pulpcore/tree/2.1.0) (2020-11-11)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/2.0.0...2.1.0)
Expand Down
1 change: 1 addition & 0 deletions manifests/admin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
environment => ["PULP_SETTINGS=${pulp_settings}"],
refreshonly => $refreshonly,
unless => $unless,
logoutput => 'on_failure',
}
}
6 changes: 5 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@
# Django remote user environment variable
#
# @param allowed_import_path
# Allowed paths that pulp can sync from using file:// protocol
# Allowed paths that pulp can use for content imports, or sync from using file:// protocol
#
# @param allowed_export_path
# Allowed paths that pulp can use for content exports
#
# @param worker_count
# Number of pulpcore workers. Defaults to 8 or the number of CPU cores, whichever is smaller. Enabling more than 8 workers, even with additional CPU cores
Expand Down Expand Up @@ -175,6 +178,7 @@
Integer[0] $redis_db = 8,
Stdlib::Fqdn $servername = $facts['networking']['fqdn'],
Array[Stdlib::Absolutepath] $allowed_import_path = ['/var/lib/pulp/sync_imports'],
Array[Stdlib::Absolutepath] $allowed_export_path = [],
String[1] $remote_user_environ_name = 'HTTP_REMOTE_USER',
Integer[0] $worker_count = min(8, $facts['processors']['count']),
Boolean $service_enable = true,
Expand Down
6 changes: 1 addition & 5 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "theforeman-pulpcore",
"version": "2.1.0",
"version": "2.2.0",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand Down Expand Up @@ -33,10 +33,6 @@
{
"name": "puppet/extlib",
"version_requirement": ">= 3.0.0 < 6.0.0"
},
{
"name": "puppet/selinux",
"version_requirement": ">= 3.1.0 < 4.0.0"
}
],
"operatingsystem_support": [
Expand Down
57 changes: 32 additions & 25 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
is_expected.to contain_class('pulpcore::config')
is_expected.to contain_concat('pulpcore settings').with_path('/etc/pulp/settings.py')
is_expected.to contain_concat__fragment('base')
.with_content(%r{ALLOWED_EXPORT_PATHS = \[\]})
.with_content(%r{ALLOWED_IMPORT_PATHS = \["/var/lib/pulp/sync_imports"\]})
.without_content(/sslmode/)
is_expected.to contain_file('/etc/pulp')
is_expected.to contain_file('/var/lib/pulp')
Expand Down Expand Up @@ -114,6 +116,35 @@
end
end

context 'with allowed import paths' do
let :params do
{
allowed_import_path: ['/test/path', '/test/path2'],
}
end

it do
is_expected.to compile.with_all_deps
is_expected.to contain_concat__fragment('base')
.with_content(%r{ALLOWED_IMPORT_PATHS = \["/test/path", "/test/path2"\]})
end
end

context 'with allowed export paths' do
let :params do
{
allowed_export_path: ['/test/path', '/test/path2'],
}
end

it do
is_expected.to compile.with_all_deps
is_expected.to contain_concat__fragment('base')
.with_content(%r{ALLOWED_EXPORT_PATHS = \["/test/path", "/test/path2"\]})

end
end

context 'with worker_count set to 5' do
let(:params) { { worker_count: 5 } }

Expand Down Expand Up @@ -187,7 +218,7 @@
is_expected.not_to contain_file('/var/lib/pulp/pulpcore_static')
is_expected.not_to contain_apache__vhost('pulpcore')
is_expected.not_to contain_apache__vhost('pulpcore-https')
is_expected.not_to contain_selinux__boolean('httpd_can_network_connect')
is_expected.not_to contain_selboolean('httpd_can_network_connect')
end
end

Expand Down Expand Up @@ -323,30 +354,6 @@
end
end

context 'with allowed import paths' do
let :params do
{
allowed_import_path: ['/test/path', '/test/path2'],
}
end

it do
is_expected.to compile.with_all_deps
is_expected.to contain_concat__fragment('base')
.with_content(%r{ALLOWED_IMPORT_PATHS = \["/test/path", "/test/path2"\]})

end
end

context 'with empty allowed import paths' do
it do
is_expected.to compile.with_all_deps
is_expected.to contain_concat__fragment('base')
.with_content(%r{ALLOWED_IMPORT_PATHS = \["/var/lib/pulp/sync_imports"\]})

end
end

context 'with custom static dirs' do
let :params do
{
Expand Down
2 changes: 1 addition & 1 deletion templates/settings.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ REST_FRAMEWORK__DEFAULT_AUTHENTICATION_CLASSES = (
'pulpcore.app.authentication.PulpRemoteUserAuthentication'
)

<%# This setting whitelists paths that can be used for repository sync with file protocol. Katello uses the path /var/lib/pulp/sync_imports/ to run tests -%>
ALLOWED_IMPORT_PATHS = <%= scope['pulpcore::allowed_import_path'] %>
ALLOWED_EXPORT_PATHS = <%= scope['pulpcore::allowed_export_path'] %>

# Derive HTTP/HTTPS via the X-Forwarded-Proto header set by Apache
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')