4 changes: 3 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ fixtures:
repo: 'https://github.com/puppetlabs/puppetlabs-selinux_core'
puppet_version: '>= 6.0.0'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib'
systemd: 'https://github.com/camptocamp/puppet-systemd'
systemd:
repo: 'https://github.com/camptocamp/puppet-systemd'
ref: '2.12.0'
2 changes: 1 addition & 1 deletion .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Setup ruby
uses: actions/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- uses: actions/cache@v2
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## [2.2.3](https://github.com/theforeman/puppet-pulpcore/tree/2.2.3) (2021-05-19)

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

**Fixed bugs:**

- Fixes [\#32622](https://projects.theforeman.org/issues/32622): Include StdEnvVars, ExportCertData SSL options in Apache [\#193](https://github.com/theforeman/puppet-pulpcore/pull/193) ([ehelms](https://github.com/ehelms))
- Fixes [\#32309](https://projects.theforeman.org/issues/32309) - pulpcore-manager fails from certain directories [\#181](https://github.com/theforeman/puppet-pulpcore/pull/181) ([ianballou](https://github.com/ianballou))

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

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

**Fixed bugs:**

- Fixes [\#31694](https://projects.theforeman.org/issues/31694): systemd service type should be Type [\#165](https://github.com/theforeman/puppet-pulpcore/pull/165) ([ehelms](https://github.com/ehelms))

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

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

**Fixed bugs:**

- Fixes [\#31468](https://projects.theforeman.org/issues/31468) - create import/export directories [\#156](https://github.com/theforeman/puppet-pulpcore/pull/156) ([jeremylenz](https://github.com/jeremylenz))

## [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)
Expand Down
5 changes: 5 additions & 0 deletions manifests/admin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
# @param pulp_settings
# Root directory for static content
#
# @param working_dir
# The directory to run pulpcore-manager from.
#
# @see exec
define pulpcore::admin(
String $command = $title,
Expand All @@ -28,11 +31,13 @@
Array[Stdlib::Absolutepath] $path = ['/usr/bin'],
String $user = $pulpcore::user,
Stdlib::Absolutepath $pulp_settings = $pulpcore::settings_file,
Stdlib::Absolutepath $working_dir = $pulpcore::user_home,
) {
Concat <| title == 'pulpcore settings' |>
-> exec { "pulpcore-manager ${command}":
user => $user,
path => $path,
cwd => $working_dir,
environment => ["PULP_SETTINGS=${pulp_settings}"],
refreshonly => $refreshonly,
unless => $unless,
Expand Down
1 change: 1 addition & 0 deletions manifests/apache.pp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
ssl_chain => $pulpcore::apache_https_chain,
ssl_ca => $pulpcore::apache_https_ca,
ssl_verify_client => $ssl_verify_client,
ssl_options => ['+StdEnvVars', '+ExportCertData'],
* => $https_vhost_options,
}
}
Expand Down
14 changes: 14 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,18 @@
mode => '0750',
}

file { $pulpcore::allowed_import_path:
ensure => directory,
owner => $pulpcore::user,
group => $pulpcore::group,
mode => '0770',
}

file { $pulpcore::allowed_export_path:
ensure => directory,
owner => $pulpcore::user,
group => $pulpcore::group,
mode => '0770',
}

}
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": "2.2.0",
"version": "2.2.3",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand Down
22 changes: 17 additions & 5 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.without_content(/sslmode/)
is_expected.to contain_file('/etc/pulp')
is_expected.to contain_file('/var/lib/pulp')
is_expected.to contain_file('/var/lib/pulp/sync_imports')
is_expected.to contain_file('/var/lib/pulp/assets')
is_expected.to contain_file('/var/lib/pulp/media')
is_expected.to contain_file('/var/lib/pulp/pulpcore_static')
Expand Down Expand Up @@ -119,29 +120,40 @@
context 'with allowed import paths' do
let :params do
{
allowed_import_path: ['/test/path', '/test/path2'],
allowed_import_path: ['/tmp/imports', '/tmp/imports1'],
}
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"\]})
.with_content(%r{ALLOWED_IMPORT_PATHS = \["/tmp/imports", "/tmp/imports1"\]})
is_expected.to contain_file('/tmp/imports1')
is_expected.to contain_file('/tmp/imports').with(
:mode => '0770',
:owner => 'pulp',
:group => 'pulp'
)
end
end

context 'with allowed export paths' do
let :params do
{
allowed_export_path: ['/test/path', '/test/path2'],
allowed_export_path: ['/tmp/exports', '/tmp/exports1'],
}
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"\]})

.with_content(%r{ALLOWED_EXPORT_PATHS = \["/tmp/exports", "/tmp/exports1"\]})
is_expected.to contain_file('/tmp/exports1')
is_expected.to contain_file('/tmp/exports').with(
:mode => '0770',
:owner => 'pulp',
:group => 'pulp'
)
end
end

Expand Down
2 changes: 2 additions & 0 deletions spec/defines/admin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
{
pulp_settings: '/etc/pulpcore/settings.py',
user: 'pulpcore',
working_dir: '/var/lib/pulp'
}
end

Expand All @@ -22,6 +23,7 @@
.with_environment(['PULP_SETTINGS=/etc/pulpcore/settings.py'])
.with_refreshonly(false)
.with_unless(nil)
.with_cwd('/var/lib/pulp')
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 @@ -4,7 +4,7 @@ After=network.target
Requires=pulpcore-api.socket

[Service]
type=notify
Type=notify
Environment="DJANGO_SETTINGS_MODULE=pulpcore.app.settings"
Environment="PULP_SETTINGS=<%= scope['pulpcore::settings_file'] %>"
User=<%= scope['pulpcore::user'] %>
Expand Down
2 changes: 1 addition & 1 deletion templates/pulpcore-content.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Requires=pulpcore-content.socket
After=network.target

[Service]
type=notify
Type=notify
Environment="DJANGO_SETTINGS_MODULE=pulpcore.app.settings"
Environment="PULP_SETTINGS=<%= scope['pulpcore::settings_file'] %>"
User=<%= scope['pulpcore::user'] %>
Expand Down