Showing with 321 additions and 150 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 .sync.yml
  3. +22 −1 .travis.yml
  4. +23 −1 CHANGELOG.md
  5. +54 −12 CONTRIBUTING.md
  6. +5 −29 Gemfile
  7. +80 −0 HISTORY.md
  8. +9 −0 README.md
  9. +4 −10 Rakefile
  10. +1 −1 manifests/admin.pp
  11. +6 −0 manifests/database.pp
  12. +5 −1 manifests/init.pp
  13. +8 −6 metadata.json
  14. +5 −0 spec/acceptance/basic_spec.rb
  15. +25 −0 spec/classes/pulpcore_spec.rb
  16. +1 −1 spec/defines/admin_spec.rb
  17. +44 −0 spec/setup_acceptance_node.pp
  18. +1 −43 spec/spec_helper.rb
  19. +17 −45 spec/spec_helper_acceptance.rb
  20. +9 −0 templates/settings.py.erb
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ junit/
pkg/
coverage/
.yardoc/
REFERENCE.md

## InteliJ / RubyMine
.idea
Expand Down
1 change: 1 addition & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.travis.yml:
beaker_sets:
- centos7-64
- centos8-64
23 changes: 22 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ matrix:
env: PUPPET_VERSION=5.0
- rvm: 2.5.1
env: PUPPET_VERSION=6.0

# Acceptance tests
- rvm: 2.5.1
env:
Expand All @@ -32,5 +31,27 @@ matrix:
- echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart

- rvm: 2.5.1
env:
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_setfile=centos8-64{hostname=centos8-64.example.com}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
before_install:
- echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart

- rvm: 2.5.1
env:
- BEAKER_PUPPET_COLLECTION=puppet6
- BEAKER_setfile=centos8-64{hostname=centos8-64.example.com}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
before_install:
- echo '{"ipv6":true,"fixed-cidr-v6":"2001:db8:1::/64"}' | sudo tee /etc/docker/daemon.json
- sudo service docker restart

bundler_args: --without system_tests development
dist: xenial
24 changes: 23 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## [1.0.0](https://github.com/theforeman/puppet-pulpcore/tree/1.0.0) (2020-05-14)

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

**Breaking changes:**

- Use modern facts [\#96](https://github.com/theforeman/puppet-pulpcore/issues/96)
- Fixes [\#29371](https://projects.theforeman.org/issues/29371) - Update settings.py for pulpcore3.2 [\#79](https://github.com/theforeman/puppet-pulpcore/pull/79) ([sjha4](https://github.com/sjha4))

**Implemented enhancements:**

- Allow puppet/redis 6.x [\#95](https://github.com/theforeman/puppet-pulpcore/pull/95) ([ekohl](https://github.com/ekohl))
- Revert "Pin Facter to \< 4" [\#86](https://github.com/theforeman/puppet-pulpcore/pull/86) ([ekohl](https://github.com/ekohl))
- Create admin user [\#85](https://github.com/theforeman/puppet-pulpcore/pull/85) ([sjha4](https://github.com/sjha4))
- Allow extlib 5.x [\#84](https://github.com/theforeman/puppet-pulpcore/pull/84) ([mmoll](https://github.com/mmoll))
- Fixes [\#29190](https://projects.theforeman.org/issues/29190) - Support EL8 [\#77](https://github.com/theforeman/puppet-pulpcore/pull/77) ([wbclark](https://github.com/wbclark))

**Fixed bugs:**

- Update pulpcore::admin to use the command parameter if it is passed [\#91](https://github.com/theforeman/puppet-pulpcore/pull/91) ([gcoxmoz](https://github.com/gcoxmoz))

# Changelog

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

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/0.1.0...0.2.0)
Expand Down Expand Up @@ -80,5 +103,4 @@
- Add file and container plugins [\#30](https://github.com/theforeman/puppet-pulpcore/pull/30) ([ekohl](https://github.com/ekohl))



\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
66 changes: 54 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,22 @@ Our puppet modules provide [`Gemfile`](./Gemfile)s which can tell a ruby
package manager such as [bundler](https://bundler.io/) what Ruby packages,
or Gems, are required to build, develop, and test this software.

Please make sure you have [bundler installed](https://bundler.io/#getting-started)
on your system, then use it to install all dependencies needed for this project,
by running

```shell
% bundle install
**Prerequisites**
1. Make sure you have [bundler installed](https://bundler.io/#getting-started)
on your system. If you are using Fedora, you can get `bundler` using
```shell
sudo dnf install rubygem-bundler
```
2. If you are using Fedora, you may need these additional packages
```shell
sudo dnf install -y ruby-devel redhat-rpm-config
```

Now, go to the root directory of this project and use `bundler` to install all
dependencies needed for this project by running

```console
$ bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching gem metadata from https://rubygems.org/..
Using rake (10.1.0)
Expand All @@ -159,21 +169,43 @@ NOTE some systems may require you to run this command with sudo.
If you already have those gems installed, make sure they are up-to-date:

```shell
% bundle update
bundle update
```

With all dependencies in place and up-to-date we can now run the tests:

```shell
% rake spec
rake spec
```

This will execute all the [rspec tests](http://rspec-puppet.com/) tests
under [spec/defines](./spec/defines), [spec/classes](./spec/classes),
and so on. rspec tests may have the same kind of dependencies as the
module they are testing. While the module defines in its [Modulefile](./Modulefile),
This will execute all the [rspec tests](http://rspec-puppet.com/) tests under
[spec/defines](./spec/defines), [spec/classes](./spec/classes), and so on.
rspec tests may have the same kind of dependencies as the module they are
testing. While the module defines in its [metadata.json](./metadata.json),
rspec tests define them in [.fixtures.yml](./fixtures.yml).

To run specific tests, use the spec test file name and a filter like:

```shell
bundle exec rspec spec/classes/foreman_spec.rb -e 'should restart passenger'
```
More filter info available [here](https://relishapp.com/rspec/rspec-core/v/3-9/docs/command-line/example-option)

To run OS specific tests:

```shell
SPEC_FACTS_OS=redhat-7-x86_64 bundle exec rspec spec/classes/foreman_spec.rb
```

If you have more than one version of `redhat` OS specified in metadata.json,
you can run them all like:

```shell
SPEC_FACTS_OS=redhat bundle exec rspec spec/classes/foreman_spec.rb
```
For more information on running the tests, see [rspec-puppet-facts](https://github.com/mcanevet/rspec-puppet-facts)
and specifically the [section for running tests](https://github.com/mcanevet/rspec-puppet-facts#running-your-tests).

Writing Tests
-------------

Expand Down Expand Up @@ -246,3 +278,13 @@ Additional Resources
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
Modulesync
==========
Various files, including this one, are
[modulesynced](https://github.com/voxpupuli/modulesync) using
[foreman-installer-modulesync](https://github.com/theforeman/foreman-installer-modulesync)
configuration. Changes should be made over there and then synced to
all [managed
modules](https://github.com/theforeman/foreman-installer-modulesync/blob/master/managed_modules.yml).
34 changes: 5 additions & 29 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,16 @@ source 'https://rubygems.org'

gem 'puppet', ENV.key?('PUPPET_VERSION') ? "~> #{ENV['PUPPET_VERSION']}" : '>= 5.5'

# https://github.com/voxpupuli/puppet-selinux/issues/318
gem 'facter', '< 4'

gem 'rake'
gem 'rspec', '~> 3.0'
gem 'rspec-puppet', '~> 2.3'
gem 'rspec-puppet-facts', '>= 1.7'
gem 'puppetlabs_spec_helper', '>= 2.1.1'
gem 'puppet-lint', '>= 2'
gem 'puppet-lint-classes_and_types_beginning_with_digits-check'
gem 'kafo_module_lint'
gem 'puppet-lint-empty_string-check'
gem 'puppet-lint-file_ensure-check'
gem 'puppet-lint-leading_zero-check'
gem 'puppet-lint-param-docs', '>= 1.3.0'
gem 'puppet-lint-spaceship_operator_without_tag-check'
gem 'puppet-lint-strict_indent-check'
gem 'puppet-lint-trailing_comma-check'
gem 'puppet-lint-undef_in_function-check'
gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-version_comparison-check'
gem 'simplecov'
gem 'github_changelog_generator', '>= 1.15.0'
gem 'puppet-blacksmith', '>= 4.1.0', {"groups"=>["development"]}
gem 'beaker', '>= 4.2.0', {"groups"=>["system_tests"]}
gem 'beaker-docker', {"groups"=>["system_tests"]}
gem 'beaker-vagrant', {"groups"=>["system_tests"]}
gem 'beaker-hostgenerator', '>= 1.1.10', {"groups"=>["system_tests"]}
gem 'beaker-puppet', {"groups"=>["system_tests"]}
gem 'beaker-rspec', {"groups"=>["system_tests"]}
gem 'beaker-module_install_helper', {"groups"=>["system_tests"]}
gem 'beaker-puppet_install_helper', {"groups"=>["system_tests"]}
gem 'metadata-json-lint'
gem 'kafo_module_lint'
gem 'parallel_tests'
gem 'voxpupuli-test', '~> 1.4'
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 0.2', {"groups"=>["system_tests"]}

# vim:ft=ruby
80 changes: 80 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Changelog

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

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

**Implemented enhancements:**

- Fixes [\#29069](https://projects.theforeman.org/issues/29069) - Apply selinux labels to pulpcore ports [\#72](https://github.com/theforeman/puppet-pulpcore/pull/72) ([wbclark](https://github.com/wbclark))
- Refs [\#28901](https://projects.theforeman.org/issues/28901) - Support SSL connection for external postgresql database [\#71](https://github.com/theforeman/puppet-pulpcore/pull/71) ([wbclark](https://github.com/wbclark))

**Merged pull requests:**

- Pin Facter to \< 4 [\#81](https://github.com/theforeman/puppet-pulpcore/pull/81) ([ekohl](https://github.com/ekohl))
- enable httpd\_can\_network\_connect selinux boolean [\#76](https://github.com/theforeman/puppet-pulpcore/pull/76) ([wbclark](https://github.com/wbclark))
- Prepare acceptance tests for EL8 [\#75](https://github.com/theforeman/puppet-pulpcore/pull/75) ([ekohl](https://github.com/ekohl))
- Fixes [\#28996](https://projects.theforeman.org/issues/28996) - Set PULP\_STATIC\_ROOT [\#69](https://github.com/theforeman/puppet-pulpcore/pull/69) ([wbclark](https://github.com/wbclark))

## [0.1.0](https://github.com/theforeman/puppet-pulpcore/tree/0.1.0) (2020-02-13)

[Full Changelog](https://github.com/theforeman/puppet-pulpcore/compare/41659cd46708a5a3ce9bdc5e9071f93fb994161c...0.1.0)

**Closed issues:**

- package installation in plugin.pp should be option [\#59](https://github.com/theforeman/puppet-pulpcore/issues/59)
- configurable REMOTE\_USER\_ENVIRON\_NAME [\#58](https://github.com/theforeman/puppet-pulpcore/issues/58)
- Pulp 2 and 3 API calls through Apache don't play nice [\#49](https://github.com/theforeman/puppet-pulpcore/issues/49)
- Add smoke tests to nightly installer pipelines [\#42](https://github.com/theforeman/puppet-pulpcore/issues/42)
- Check on pulpcore-resource-manager naming and configuration form latest ansible-pulp [\#36](https://github.com/theforeman/puppet-pulpcore/issues/36)
- Update CONTENT\_ORIGIN to match proper value ansible-pulp [\#35](https://github.com/theforeman/puppet-pulpcore/issues/35)
- Make PULP2 mongodb settings configurable [\#33](https://github.com/theforeman/puppet-pulpcore/issues/33)
- Add database migration command [\#23](https://github.com/theforeman/puppet-pulpcore/issues/23)
- Allow disabling management of Apache via a paramter [\#11](https://github.com/theforeman/puppet-pulpcore/issues/11)
- Support external postgresql [\#10](https://github.com/theforeman/puppet-pulpcore/issues/10)
- Allow specification of externally managed PostgreSQl instance [\#4](https://github.com/theforeman/puppet-pulpcore/issues/4)
- Update to use django-admin solution for pulpcore [\#39](https://github.com/theforeman/puppet-pulpcore/issues/39)
- Update Redis database number to '8' [\#34](https://github.com/theforeman/puppet-pulpcore/issues/34)
- Drop Ansible settings [\#32](https://github.com/theforeman/puppet-pulpcore/issues/32)
- Secret key handling [\#31](https://github.com/theforeman/puppet-pulpcore/issues/31)
- pulp-api fails to start due to permission denied on key [\#22](https://github.com/theforeman/puppet-pulpcore/issues/22)
- The 'gunicorn' command is located at /usr/bin [\#20](https://github.com/theforeman/puppet-pulpcore/issues/20)
- The 'rq' command is located at /usr/bin [\#19](https://github.com/theforeman/puppet-pulpcore/issues/19)
- Manage of user\_home "/var/lib/pulp" clashes with dependency in Katello [\#17](https://github.com/theforeman/puppet-pulpcore/issues/17)
- Drop settings PostgreSQL globals [\#16](https://github.com/theforeman/puppet-pulpcore/issues/16)
- Install from RPM repos rather than PyPI [\#9](https://github.com/theforeman/puppet-pulpcore/issues/9)
- Allow using Redis configured by Foreman [\#7](https://github.com/theforeman/puppet-pulpcore/issues/7)
- Deploy Apache configurations to Foreman vhost [\#5](https://github.com/theforeman/puppet-pulpcore/issues/5)

**Merged pull requests:**

- Refs [\#28901](https://projects.theforeman.org/issues/28901) - add setting postgresql\_db\_user [\#67](https://github.com/theforeman/puppet-pulpcore/pull/67) ([wbclark](https://github.com/wbclark))
- Refs [\#28720](https://projects.theforeman.org/issues/28720) - Fixup migration variables and template [\#66](https://github.com/theforeman/puppet-pulpcore/pull/66) ([wbclark](https://github.com/wbclark))
- Verify everything to have documented parameters [\#65](https://github.com/theforeman/puppet-pulpcore/pull/65) ([ekohl](https://github.com/ekohl))
- Fixes [\#28901](https://projects.theforeman.org/issues/28901) - support external postgresql [\#64](https://github.com/theforeman/puppet-pulpcore/pull/64) ([wbclark](https://github.com/wbclark))
- Refs [\#28720](https://projects.theforeman.org/issues/28720) - move migration params into migration plugin [\#63](https://github.com/theforeman/puppet-pulpcore/pull/63) ([wbclark](https://github.com/wbclark))
- Fixes [\#28904](https://projects.theforeman.org/issues/28904) - make REMOTE\_USER\_ENVIRON\_NAME configurable [\#61](https://github.com/theforeman/puppet-pulpcore/pull/61) ([synkd](https://github.com/synkd))
- Fixes [\#28812](https://projects.theforeman.org/issues/28812) - fix permissions to allow pulp2 access [\#60](https://github.com/theforeman/puppet-pulpcore/pull/60) ([jlsherrill](https://github.com/jlsherrill))
- Fixes [\#28720](https://projects.theforeman.org/issues/28720) - connect to mongo for content migrations [\#57](https://github.com/theforeman/puppet-pulpcore/pull/57) ([wbclark](https://github.com/wbclark))
- Fixes [\#28654](https://projects.theforeman.org/issues/28654) - support client cert auth with pulp3 [\#56](https://github.com/theforeman/puppet-pulpcore/pull/56) ([wbclark](https://github.com/wbclark))
- Run acceptance tests with SCL redis [\#54](https://github.com/theforeman/puppet-pulpcore/pull/54) ([ekohl](https://github.com/ekohl))
- Update pulpcore worker systemd naming [\#53](https://github.com/theforeman/puppet-pulpcore/pull/53) ([ianballou](https://github.com/ianballou))
- use puppet-redis \> 5.0.0 [\#52](https://github.com/theforeman/puppet-pulpcore/pull/52) ([wbclark](https://github.com/wbclark))
- Specify /pulp/api/v3 [\#50](https://github.com/theforeman/puppet-pulpcore/pull/50) ([wbclark](https://github.com/wbclark))
- Use koji in acceptance tests and use python3-django-admin [\#48](https://github.com/theforeman/puppet-pulpcore/pull/48) ([wbclark](https://github.com/wbclark))
- make servername configurable [\#45](https://github.com/theforeman/puppet-pulpcore/pull/45) ([wbclark](https://github.com/wbclark))
- Improve settings. [\#44](https://github.com/theforeman/puppet-pulpcore/pull/44) ([wbclark](https://github.com/wbclark))
- Introduce a pulpcore::admin define [\#43](https://github.com/theforeman/puppet-pulpcore/pull/43) ([ekohl](https://github.com/ekohl))
- Refresh collectstatic on the settings file [\#29](https://github.com/theforeman/puppet-pulpcore/pull/29) ([ekohl](https://github.com/ekohl))
- collectstatic needs --noinput to avoid waiting on user input [\#28](https://github.com/theforeman/puppet-pulpcore/pull/28) ([ehelms](https://github.com/ehelms))
- fixes [\#16](https://projects.theforeman.org/issues/16): Drop postgresql globals [\#26](https://github.com/theforeman/puppet-pulpcore/pull/26) ([ehelms](https://github.com/ehelms))
- fixes [\#23](https://projects.theforeman.org/issues/23): Only run database migrations if they are any pending [\#25](https://github.com/theforeman/puppet-pulpcore/pull/25) ([ehelms](https://github.com/ehelms))
- Install pulpcore from RPM packages + chaining + pg client [\#24](https://github.com/theforeman/puppet-pulpcore/pull/24) ([ekohl](https://github.com/ekohl))
- remove redundant reverse proxy declarations [\#15](https://github.com/theforeman/puppet-pulpcore/pull/15) ([wbclark](https://github.com/wbclark))
- don't enable software collections [\#14](https://github.com/theforeman/puppet-pulpcore/pull/14) ([wbclark](https://github.com/wbclark))
- improve declaration of api and content urls [\#13](https://github.com/theforeman/puppet-pulpcore/pull/13) ([wbclark](https://github.com/wbclark))
- apache vhost can be externally managed [\#12](https://github.com/theforeman/puppet-pulpcore/pull/12) ([wbclark](https://github.com/wbclark))
- fixed default params [\#8](https://github.com/theforeman/puppet-pulpcore/pull/8) ([wbclark](https://github.com/wbclark))
- Creation of initial classes [\#2](https://github.com/theforeman/puppet-pulpcore/pull/2) ([wbclark](https://github.com/wbclark))
- initial setup via modulesync [\#1](https://github.com/theforeman/puppet-pulpcore/pull/1) ([wbclark](https://github.com/wbclark))
- Add file and container plugins [\#30](https://github.com/theforeman/puppet-pulpcore/pull/30) ([ekohl](https://github.com/ekohl))
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,11 @@
# puppet-pulpcore
Puppet module for setting up Pulp 3 as part of Katello installation

# Pulpcore 3.2

We are adding a few new settings to make the installer compatible with pulpcore 3.2. These settings are not available in releases prior to 3.2 and should not be used in earlier versions.

**ALLOWED_IMPORT_PATHS** : 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. For more information on this, see [https://docs.pulpproject.org/settings.html#allowed-import-paths](https://docs.pulpproject.org/settings.html#allowed-import-paths).

**AUTHENTICATION_BACKENDS , REST_FRAMEWORK__DEFAULT_AUTHENTICATION_CLASSES** :
The defaults that katello uses are defined in [templates/settings.py.erb](https://github.com/theforeman/puppet-pulpcore/blob/master/templates/settings.py.erb). For more information on these authentication settings, see [https://docs.pulpproject.org/installation/authentication.html](https://docs.pulpproject.org/installation/authentication.html)
14 changes: 4 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync

require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
require 'voxpupuli/test/rake'

# We use fixtures in our modules, which is not the default
task :beaker => 'spec_prep'

# blacksmith isn't always present, e.g. on Travis with --without development
begin
Expand Down Expand Up @@ -39,11 +41,3 @@ begin
end
rescue LoadError
end

PuppetLint.configuration.ignore_paths = ["spec/**/*.pp", "pkg/**/*.pp", "vendor/**/*.pp"]
PuppetLint.configuration.log_format = '%{path}:%{line}:%{KIND}: %{message}'

require 'puppet-lint-param-docs/tasks'
require 'kafo_module_lint/tasks'

task :default => [:release_checks]
2 changes: 1 addition & 1 deletion manifests/admin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
Stdlib::Absolutepath $static_root = $pulpcore::pulp_static_root,
) {
Concat <| title == 'pulpcore settings' |>
-> exec { "python3-django-admin ${title}":
-> exec { "python3-django-admin ${command}":
path => $path,
environment => [
'DJANGO_SETTINGS_MODULE=pulpcore.app.settings',
Expand Down
6 changes: 6 additions & 0 deletions manifests/database.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
refreshonly => false,
}

pulpcore::admin { 'reset-admin-password --random':
unless => 'python3-django-admin dumpdata auth.User | grep "auth.user"',
refreshonly => false,
require => Pulpcore::Admin['migrate --noinput'],
}

include redis

}
Loading