Showing with 74 additions and 14 deletions.
  1. +14 −0 CHANGELOG.md
  2. +28 −0 HISTORY.md
  3. +0 −5 manifests/config.pp
  4. +1 −1 manifests/database.pp
  5. +3 −3 manifests/init.pp
  6. +16 −0 manifests/static.pp
  7. +1 −1 metadata.json
  8. +6 −2 spec/classes/pulpcore_spec.rb
  9. +0 −1 templates/pulpcore-api.service.erb
  10. +5 −1 templates/settings.py.erb
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

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

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

**Implemented enhancements:**

- Handle X-Forwarded-Proto headers [\#120](https://github.com/theforeman/puppet-pulpcore/pull/120) ([ekohl](https://github.com/ekohl))

**Fixed bugs:**

- Manage the static assets via a class [\#121](https://github.com/theforeman/puppet-pulpcore/pull/121) ([ekohl](https://github.com/ekohl))
- Refs [\#30780](https://projects.theforeman.org/issues/30780) - set proper content origin setting [\#119](https://github.com/theforeman/puppet-pulpcore/pull/119) ([jlsherrill](https://github.com/jlsherrill))
- Fixes [\#30770](https://projects.theforeman.org/issues/30770) - check for the admin user before pw reset [\#118](https://github.com/theforeman/puppet-pulpcore/pull/118) ([jlsherrill](https://github.com/jlsherrill))

## [1.2.0](https://github.com/theforeman/puppet-pulpcore/tree/1.2.0) (2020-08-06)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/1.1.0...1.2.0)
Expand Down
28 changes: 28 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
## [1.3.0](https://github.com/theforeman/puppet-pulpcore/tree/1.3.0) (2020-09-23)

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

**Implemented enhancements:**

- Handle X-Forwarded-Proto headers [\#120](https://github.com/theforeman/puppet-pulpcore/pull/120) ([ekohl](https://github.com/ekohl))

**Fixed bugs:**

- Manage the static assets via a class [\#121](https://github.com/theforeman/puppet-pulpcore/pull/121) ([ekohl](https://github.com/ekohl))
- Refs [\#30780](https://projects.theforeman.org/issues/30780) - set proper content origin setting [\#119](https://github.com/theforeman/puppet-pulpcore/pull/119) ([jlsherrill](https://github.com/jlsherrill))
- Fixes [\#30770](https://projects.theforeman.org/issues/30770) - check for the admin user before pw reset [\#118](https://github.com/theforeman/puppet-pulpcore/pull/118) ([jlsherrill](https://github.com/jlsherrill))

## [1.2.0](https://github.com/theforeman/puppet-pulpcore/tree/1.2.0) (2020-08-06)

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

**Implemented enhancements:**

- Fixes [\#29895](https://projects.theforeman.org/issues/29895) - add pulp\_deb plugin [\#112](https://github.com/theforeman/puppet-pulpcore/pull/112) ([m-bucher](https://github.com/m-bucher))
- Use pulpcore-manager [\#111](https://github.com/theforeman/puppet-pulpcore/pull/111) ([ekohl](https://github.com/ekohl))
- Refs [\#30057](https://projects.theforeman.org/issues/30057) - Configure Pulpcore Worker Count [\#100](https://github.com/theforeman/puppet-pulpcore/pull/100) ([wbclark](https://github.com/wbclark))

**Fixed bugs:**

- Add the GPL license text [\#109](https://github.com/theforeman/puppet-pulpcore/pull/109) ([ekohl](https://github.com/ekohl))

## [1.1.0](https://github.com/theforeman/puppet-pulpcore/tree/1.1.0) (2020-06-30)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/1.0.0...1.1.0)
Expand Down
5 changes: 0 additions & 5 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@
mode => '0775',
}

pulpcore::admin { 'collectstatic --noinput':
refreshonly => true,
subscribe => Concat['pulpcore settings'],
}

selinux::port { 'pulpcore-api-port':
ensure => 'present',
seltype => 'pulpcore_port_t',
Expand Down
2 changes: 1 addition & 1 deletion manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
}

pulpcore::admin { 'reset-admin-password --random':
unless => 'pulpcore-manager dumpdata auth.User | grep "auth.user"',
unless => 'pulpcore-manager dumpdata auth.User | grep "\"username\": \"admin\""',
refreshonly => false,
require => Pulpcore::Admin['migrate --noinput'],
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,18 @@
Optional[String] $remote_user_environ_name = undef,
Integer[0] $worker_count = min(8, $facts['processors']['count']),
) {

$settings_file = "${config_dir}/settings.py"

contain pulpcore::install
contain pulpcore::database
contain pulpcore::config
contain pulpcore::static
contain pulpcore::service
contain pulpcore::apache

Class['pulpcore::install'] ~> Class['pulpcore::config', 'pulpcore::database', 'pulpcore::service']
Class['pulpcore::config'] ~> Class['pulpcore::database', 'pulpcore::service']
Class['pulpcore::database'] -> Class['pulpcore::service'] -> Class['pulpcore::apache']
Class['pulpcore::config'] ~> Class['pulpcore::database', 'pulpcore::static', 'pulpcore::service']
Class['pulpcore::database', 'pulpcore::static'] -> Class['pulpcore::service'] -> Class['pulpcore::apache']

# lint:ignore:spaceship_operator_without_tag
Class['pulpcore::install']
Expand Down
16 changes: 16 additions & 0 deletions manifests/static.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# @summary Manage the static files (assets)
# @api private
class pulpcore::static {
file { $pulpcore::pulp_static_root:
ensure => directory,
owner => $pulpcore::user,
group => $pulpcore::group,
mode => '0755',
}

pulpcore::admin { 'collectstatic --noinput':
refreshonly => true,
subscribe => Concat['pulpcore settings'],
require => File[$pulpcore::pulp_static_root],
}
}
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": "1.2.0",
"version": "1.3.0",
"author": "theforeman",
"summary": "Installs next generation Pulp server",
"license": "GPL-3.0-or-later",
Expand Down
8 changes: 6 additions & 2 deletions spec/classes/pulpcore_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
is_expected.to contain_file('/var/lib/pulp')
is_expected.to contain_file('/var/lib/pulp/docroot')
is_expected.to contain_file('/var/lib/pulp/tmp')
is_expected.to contain_pulpcore__admin('collectstatic --noinput')
end

it 'sets up static files' do
is_expected.to contain_file('/var/lib/pulp/assets')
is_expected.to contain_pulpcore__admin('collectstatic --noinput')
is_expected.to contain_exec('pulpcore-manager collectstatic --noinput')
end

it 'configures the database' do
is_expected.to contain_class('pulpcore::database')
Expand Down Expand Up @@ -250,11 +254,11 @@
is_expected.to compile.with_all_deps
is_expected.to contain_file('/my/custom/directory')
is_expected.to contain_systemd__unit_file('pulpcore-api.service')
.with_content(%r{Environment="PULP_STATIC_ROOT=/my/other/custom/directory"})
is_expected.to contain_apache__vhost('pulpcore')
.with_docroot('/my/custom/directory')
is_expected.to contain_concat__fragment('base')
.with_content(%r{MEDIA_ROOT = "/my/custom/directory"})
.with_content(%r{STATIC_ROOT = "/my/other/custom/directory"})
end
end
end
Expand Down
1 change: 0 additions & 1 deletion templates/pulpcore-api.service.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Wants=network-online.target
[Service]
Environment="DJANGO_SETTINGS_MODULE=pulpcore.app.settings"
Environment="PULP_SETTINGS=<%= scope['pulpcore::settings_file'] %>"
Environment="PULP_STATIC_ROOT=<%= scope['pulpcore::pulp_static_root'] %>"
User=<%= scope['pulpcore::user'] %>
PIDFile=/run/pulpcore-api.pid
RuntimeDirectory=pulpcore-api
Expand Down
6 changes: 5 additions & 1 deletion templates/settings.py.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONTENT_HOST = "<%= scope['pulpcore::servername'] %>"
CONTENT_ORIGIN = "http://<%= scope['pulpcore::servername'] %>"
CONTENT_ORIGIN = "https://<%= scope['pulpcore::servername'] %>"
SECRET_KEY = "<%= scope['pulpcore::django_secret_key'] %>"
DATABASES = {
'default': {
Expand All @@ -20,6 +20,7 @@ DATABASES = {
},
}
MEDIA_ROOT = "<%= scope['pulpcore::webserver_static_dir'] %>"
STATIC_ROOT = "<%= scope['pulpcore::pulp_static_root'] %>"
REDIS_HOST = "localhost"
REDIS_PORT = "<%= scope['redis::port'] %>"
REDIS_DB = <%= scope['pulpcore::redis_db'] %>
Expand All @@ -36,3 +37,6 @@ REST_FRAMEWORK__DEFAULT_AUTHENTICATION_CLASSES = (

<%# 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'] %>

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