Showing with 926 additions and 748 deletions.
  1. +1 −0 .gitignore
  2. +3 −3 .sync.yml
  3. +55 −0 .travis.yml
  4. +30 −1 CHANGELOG.md
  5. +54 −12 CONTRIBUTING.md
  6. +5 −25 Gemfile
  7. +1 −1 HISTORY.md
  8. +16 −12 README.md
  9. +4 −17 Rakefile
  10. +23 −23 manifests/agent/config.pp
  11. +5 −5 manifests/agent/install.pp
  12. +6 −6 manifests/agent/service.pp
  13. +3 −3 manifests/agent/service/cron.pp
  14. +1 −1 manifests/agent/service/daemon.pp
  15. +14 −14 manifests/agent/service/systemd.pp
  16. +27 −27 manifests/config.pp
  17. +3 −3 manifests/config/entry.pp
  18. +26 −25 manifests/init.pp
  19. +40 −45 manifests/params.pp
  20. +127 −125 manifests/server.pp
  21. +105 −115 manifests/server/config.pp
  22. +1 −1 manifests/server/enc.pp
  23. +9 −9 manifests/server/install.pp
  24. +39 −0 manifests/server/puppetdb.pp
  25. +71 −68 manifests/server/puppetserver.pp
  26. +13 −8 metadata.json
  27. +16 −0 spec/acceptance/puppet_spec.rb
  28. +1 −1 spec/acceptance/puppetserver_config_spec.rb
  29. +1 −1 spec/acceptance/puppetserver_latest_spec.rb
  30. +1 −1 spec/acceptance/puppetserver_upgrade_5_3_6_to_5_3_7_spec.rb
  31. +1 −1 spec/acceptance/puppetserver_upgrade_6_7_0_to_6_7_2_spec.rb
  32. +10 −13 spec/classes/puppet_agent_spec.rb
  33. +14 −24 spec/classes/puppet_config_spec.rb
  34. +19 −24 spec/classes/puppet_init_spec.rb
  35. +30 −0 spec/classes/puppet_server_puppetdb_spec.rb
  36. +28 −1 spec/classes/puppet_server_puppetserver_spec.rb
  37. +41 −26 spec/classes/puppet_server_spec.rb
  38. +1 −1 spec/defines/puppet_config_entry_spec.rb
  39. +9 −0 spec/setup_acceptance_node.pp
  40. +1 −69 spec/spec_helper.rb
  41. +18 −32 spec/spec_helper_acceptance.rb
  42. +4 −0 spec/support/acceptance/puppetserver.rb
  43. +3 −5 spec/support/aio.rb
  44. +27 −0 spec/support/facts.rb
  45. +12 −0 templates/server/puppetserver/conf.d/auth.conf.erb
  46. +7 −0 templates/server/puppetserver/conf.d/puppetserver.conf.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
6 changes: 3 additions & 3 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
- centos6-64
- debian9-64
- debian10-64
- fedora31-64
- ubuntu1804-64
- ubuntu2004-64
env:
global:
- PARALLEL_TEST_PROCESSORS=8
beaker_puppet_collections:
- puppet5
- puppet6
Rakefile:
param_docs_pattern:
- manifests/init.pp
55 changes: 55 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,60 @@ 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=fedora31-64{hostname=fedora31-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=fedora31-64{hostname=fedora31-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=puppet5
- BEAKER_setfile=ubuntu1804-64{hostname=ubuntu1804-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=ubuntu1804-64{hostname=ubuntu1804-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=ubuntu2004-64{hostname=ubuntu2004-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
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog

## [14.0.0](https://github.com/theforeman/puppet-puppet/tree/14.0.0) (2020-05-13)

[Full Changelog](https://github.com/theforeman/puppet-puppet/compare/13.0.0...14.0.0)

**Breaking changes:**

- Use modern facts [\#743](https://github.com/theforeman/puppet-puppet/issues/743)
- Drop EOL Windows 7, 2008 R2 [\#739](https://github.com/theforeman/puppet-puppet/pull/739) ([ekohl](https://github.com/ekohl))
- Drop Foreman API version parameters [\#736](https://github.com/theforeman/puppet-puppet/pull/736) ([ekohl](https://github.com/ekohl))
- Refactor PuppetDB integration [\#732](https://github.com/theforeman/puppet-puppet/pull/732) ([ekohl](https://github.com/ekohl))

**Implemented enhancements:**

- Support Ubuntu Focal \(20.04\) [\#746](https://github.com/theforeman/puppet-puppet/pull/746) ([mmoll](https://github.com/mmoll))
- Fixes [\#29735](https://projects.theforeman.org/issues/29735) - support el8 [\#742](https://github.com/theforeman/puppet-puppet/pull/742) ([wbclark](https://github.com/wbclark))
- Switch AIO detection to use aio\_agent\_version fact [\#737](https://github.com/theforeman/puppet-puppet/pull/737) ([ekohl](https://github.com/ekohl))
- Allow extlib 5.x [\#733](https://github.com/theforeman/puppet-puppet/pull/733) ([mmoll](https://github.com/mmoll))
- Add server\_trusted\_external\_command parameter [\#731](https://github.com/theforeman/puppet-puppet/pull/731) ([baurmatt](https://github.com/baurmatt))
- Add server\_ca\_client\_self\_delete to CA Servers [\#728](https://github.com/theforeman/puppet-puppet/pull/728) ([neilfromit](https://github.com/neilfromit))
- implement 'versioned code' for puppetserver [\#726](https://github.com/theforeman/puppet-puppet/pull/726) ([mmoll](https://github.com/mmoll))

**Closed issues:**

- Systemd dependency missing [\#704](https://github.com/theforeman/puppet-puppet/issues/704)

**Merged pull requests:**

- Add Fedora 31, drop Fedora 26 [\#745](https://github.com/theforeman/puppet-puppet/pull/745) ([ekohl](https://github.com/ekohl))

## [13.0.0](https://github.com/theforeman/puppet-puppet/tree/13.0.0) (2020-02-12)

[Full Changelog](https://github.com/theforeman/puppet-puppet/compare/12.1.0...13.0.0)
Expand Down Expand Up @@ -280,7 +309,7 @@
`$server_http` parameter.
* Other features:
* Support native puppetserver package on FreeBSD
* Allow disabling crl when `server_ca => true`
* Allow disabling crl when `server_ca => true`
* Add SLES AIO agent support
* Add support for Parallels PSBM
* Other changes and fixes:
Expand Down
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).
30 changes: 5 additions & 25 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,16 @@ source 'https://rubygems.org'

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

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-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
2 changes: 1 addition & 1 deletion HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
`$server_http` parameter.
* Other features:
* Support native puppetserver package on FreeBSD
* Allow disabling crl when `server_ca => true`
* Allow disabling crl when `server_ca => true`
* Add SLES AIO agent support
* Add support for Parallels PSBM
* Other changes and fixes:
Expand Down
28 changes: 16 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ configure the Puppet master to connect to PuppetDB.

Requires [puppetlabs/puppetdb](https://forge.puppetlabs.com/puppetlabs/puppetdb)

Please see the notes about using puppetlabs/puppetdb 5.x with older versions of Puppet (< 4.x) and PuppetDB (< 3.x) with
newer releases of the module and set the values via hiera or an extra include of `puppetdb::globals` with
`puppetdb_version` defined.
```puppet
class { 'puppet':
server => true,
server_reports => 'puppetdb,foreman',
server_storeconfigs => true,
}
class { 'puppet::server::puppetdb':
server => 'mypuppetdb.example.com',
}
```

Please also make sure your puppetdb ciphers are compatible with your puppet server ciphers, ie that the two following parameters match:
```
Expand Down Expand Up @@ -102,10 +109,12 @@ wrapper classes or even your ENC (if it supports param classes). For example:

# Want to integrate with an existing PuppetDB?
class { '::puppet':
server => true,
server_puppetdb_host => 'mypuppetdb.example.com',
server_reports => 'puppetdb,foreman',
server_storeconfigs_backend => 'puppetdb',
server => true,
server_reports => 'puppetdb,foreman',
server_storeconfigs => true,
}
class { 'puppet::server::puppetdb':
server => 'mypuppetdb.example.com',
}

Look in _init.pp_ for what can be configured this way, see Contributing if anything
Expand Down Expand Up @@ -150,11 +159,6 @@ versions, which this module supports. It's recommended that you set the
you have installed. By default the module will configure for the latest
version available.

# Soft Dependencies

If you use a OS which uses systemd you may consider to download `camptocamp/systemd` module for compatibility.
It is **only** needed if you use the **puppetserver** feature.

# Contributing

* Fork the project
Expand Down
21 changes: 4 additions & 17 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,18 +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'
PuppetLintParamDocs.define_selective do |config|
config.pattern = ["manifests/init.pp"]
end

require 'kafo_module_lint/tasks'
KafoModuleLint::RakeTask.new do |config|
config.pattern = ["manifests/init.pp"]
end

task :default => [:release_checks]
Loading