Showing with 739 additions and 1,875 deletions.
  1. +0 −1 .fixtures.yml
  2. +0 −11 .sync.yml
  3. +100 −18 .travis.yml
  4. +25 −0 CHANGELOG.md
  5. +2 −3 Gemfile
  6. +3 −29 README.md
  7. +1 −0 manifests/agent.pp
  8. +1 −0 manifests/agent/config.pp
  9. +2 −1 manifests/agent/install.pp
  10. +3 −2 manifests/agent/service.pp
  11. +4 −2 manifests/agent/service/cron.pp
  12. +3 −1 manifests/agent/service/daemon.pp
  13. +4 −2 manifests/agent/service/systemd.pp
  14. +1 −0 manifests/config.pp
  15. +11 −3 manifests/config/agent.pp
  16. +18 −5 manifests/config/entry.pp
  17. +0 −13 manifests/config/environment.pp
  18. +11 −3 manifests/config/main.pp
  19. +11 −3 manifests/config/master.pp
  20. +12 −82 manifests/init.pp
  21. +21 −64 manifests/params.pp
  22. +89 −112 manifests/server.pp
  23. +23 −52 manifests/server/config.pp
  24. +2 −0 manifests/server/enc.pp
  25. +0 −94 manifests/server/env.pp
  26. +2 −20 manifests/server/install.pp
  27. +0 −141 manifests/server/passenger.pp
  28. +58 −126 manifests/server/puppetserver.pp
  29. +0 −32 manifests/server/rack.pp
  30. +8 −65 manifests/server/service.pp
  31. +4 −7 metadata.json
  32. +0 −15 spec/acceptance/nodesets/vagrant_libvirt/centos-6.yml
  33. +0 −15 spec/acceptance/nodesets/vagrant_libvirt/centos-7.yml
  34. +0 −15 spec/acceptance/nodesets/vagrant_libvirt/debian-8.yml
  35. +0 −15 spec/acceptance/nodesets/vagrant_libvirt/debian-9.yml
  36. +6 −1 spec/acceptance/puppetserver_latest_spec.rb
  37. +5 −5 spec/acceptance/puppetserver_upgrade_2_6_0_to_2_7_2_spec.rb
  38. +90 −0 spec/acceptance/puppetserver_upgrade_5_1_3_to_5_3_6_spec.rb
  39. +29 −5 spec/classes/puppet_agent_spec.rb
  40. +8 −0 spec/classes/puppet_config_spec.rb
  41. +7 −5 spec/classes/puppet_init_spec.rb
  42. +0 −110 spec/classes/puppet_server_passenger_spec.rb
  43. +77 −155 spec/classes/puppet_server_puppetserver_spec.rb
  44. +8 −106 spec/classes/puppet_server_service_spec.rb
  45. +19 −98 spec/classes/puppet_server_spec.rb
  46. +0 −302 spec/defines/puppet_server_env_spec.rb
  47. +6 −10 spec/spec_helper.rb
  48. +9 −0 spec/spec_helper_acceptance.rb
  49. +9 −0 spec/support/aio.rb
  50. +0 −2 templates/_header.erb
  51. +3 −0 templates/agent/systemd.puppet-run.service.erb
  52. +3 −0 templates/agent/systemd.puppet-run.timer.erb
  53. +10 −0 templates/auth.conf.erb
  54. +2 −0 templates/server/autosign.conf.erb
  55. +0 −117 templates/server/config.ru.erb
  56. +3 −0 templates/server/environment.conf.erb
  57. +3 −3 templates/server/post-receive.erb
  58. +3 −0 templates/server/puppetserver/conf.d/auth.conf.erb
  59. +5 −0 templates/server/puppetserver/conf.d/ca.conf.erb
  60. +3 −0 templates/server/puppetserver/conf.d/metrics.conf.erb
  61. +3 −0 templates/server/puppetserver/conf.d/product.conf.erb
  62. +3 −4 templates/server/puppetserver/conf.d/puppetserver.conf.erb
  63. +3 −0 templates/server/puppetserver/conf.d/webserver.conf.erb
  64. +3 −0 templates/server/puppetserver/services.d/ca.cfg.erb
1 change: 0 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
fixtures:
repositories:
apache: 'https://github.com/puppetlabs/puppetlabs-apache.git'
augeas_core:
repo: 'https://github.com/puppetlabs/puppetlabs-augeas_core'
puppet_version: '>= 6.0.0'
Expand Down
11 changes: 0 additions & 11 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,3 @@
Rakefile:
param_docs_pattern:
- manifests/init.pp
spec/spec_helper.rb:
extra_code: |
aio = on_os_under_test.reject do |os, facts|
['FreeBSD', 'DragonFly', 'Windows'].include?(facts[:operatingsystem])
end.keys
add_custom_fact :rubysitedir, '/opt/puppetlabs/puppet/lib/ruby/site_ruby/2.1.0', :confine => aio
def unsupported_puppetmaster_osfamily(osfamily)
['Archlinux', 'windows', 'Suse'].include?(osfamily)
end
118 changes: 100 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,58 +21,140 @@ matrix:
env: PUPPET_VERSION=6.0
# Acceptance tests
- rvm: 2.5.1
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=pc1 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker\,hostname=centos7-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=pc1
- BEAKER_setfile=centos7-64{hostname=centos7-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker\,hostname=centos7-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_setfile=centos7-64{hostname=centos7-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos7-64{hypervisor=docker\,hostname=centos7-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=puppet6
- BEAKER_setfile=centos7-64{hostname=centos7-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=pc1 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker\,hostname=centos6-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=pc1
- BEAKER_setfile=centos6-64{hostname=centos6-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker\,hostname=centos6-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_setfile=centos6-64{hostname=centos6-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=centos6-64{hypervisor=docker\,hostname=centos6-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=puppet6
- BEAKER_setfile=centos6-64{hostname=centos6-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=pc1 BEAKER_debug=true BEAKER_setfile=debian8-64{hypervisor=docker\,hostname=debian8-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=pc1
- BEAKER_setfile=debian8-64{hostname=debian8-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet5 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker\,hostname=debian9-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=puppet5
- BEAKER_setfile=debian8-64{hostname=debian8-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
dist: trusty
env: PUPPET_INSTALL_TYPE=agent BEAKER_IS_PE=no BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_debug=true BEAKER_setfile=debian9-64{hypervisor=docker\,hostname=debian9-64.example.com}
env:
- BEAKER_PUPPET_COLLECTION=puppet6
- BEAKER_setfile=debian8-64{hostname=debian8-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=pc1
- BEAKER_setfile=debian9-64{hostname=debian9-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=debian9-64{hostname=debian9-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=debian9-64{hostname=debian9-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
before_install:
- if [ $TRAVIS_RUBY_VERSION = 2.1.9 ] ; then
gem install -v 1.17.3 bundler --no-rdoc --no-ri;
fi
sudo: false
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## [11.0.0](https://github.com/theforeman/puppet-puppet/tree/11.0.0) (2019-01-14)

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

**Breaking changes:**

- Remove left over environment entry [\#662](https://github.com/theforeman/puppet-puppet/pull/662) ([ekohl](https://github.com/ekohl))
- remove apache dependency and leftovers [\#661](https://github.com/theforeman/puppet-puppet/pull/661) ([mmoll](https://github.com/mmoll))
- Remove dynamic and config environments [\#653](https://github.com/theforeman/puppet-puppet/pull/653) ([ekohl](https://github.com/ekohl))
- Remove passenger support [\#650](https://github.com/theforeman/puppet-puppet/pull/650) ([ekohl](https://github.com/ekohl))
- Drop support for puppetserver \< 2.7 [\#649](https://github.com/theforeman/puppet-puppet/pull/649) ([ekohl](https://github.com/ekohl))

**Implemented enhancements:**

- Fixes [\#25839](https://projects.theforeman.org/issues/25839) - Determine puppetserver version in server.pp [\#668](https://github.com/theforeman/puppet-puppet/pull/668) ([ekohl](https://github.com/ekohl))
- Remove $deb\_naio\_package & puppet-common install [\#665](https://github.com/theforeman/puppet-puppet/pull/665) ([ekohl](https://github.com/ekohl))
- Config file updates and FreeBSD refactorings [\#664](https://github.com/theforeman/puppet-puppet/pull/664) ([mmoll](https://github.com/mmoll))
- Set more data types and document classes & defines [\#663](https://github.com/theforeman/puppet-puppet/pull/663) ([ekohl](https://github.com/ekohl))
- Add unmanaged Puppet Agent runmode [\#659](https://github.com/theforeman/puppet-puppet/pull/659) ([Rathios](https://github.com/Rathios))
- namespace extlib functions [\#639](https://github.com/theforeman/puppet-puppet/pull/639) ([mmoll](https://github.com/mmoll))

**Merged pull requests:**

- add Puppetserver 5.x upgrade test [\#667](https://github.com/theforeman/puppet-puppet/pull/667) ([mmoll](https://github.com/mmoll))

## [10.1.0](https://github.com/theforeman/puppet-puppet/tree/10.1.0) (2018-12-06)

[Full Changelog](https://github.com/theforeman/puppet-puppet/compare/10.0.0...10.1.0)
Expand Down
5 changes: 2 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ gem 'puppet-lint-unquoted_string-check'
gem 'puppet-lint-variable_contains_upcase'
gem 'puppet-lint-version_comparison-check'
gem 'simplecov'
gem 'github_changelog_generator', {"git"=>"https://github.com/skywinder/github-changelog-generator", "ref"=>"20ee04ba1234e9e83eb2ffb5056e23d641c7a018", "groups"=>["development"]}
gem 'github_changelog_generator', {"git"=>"https://github.com/skywinder/github-changelog-generator", "ref"=>"20ee04ba1234e9e83eb2ffb5056e23d641c7a018", "groups"=>["development"]} if RUBY_VERSION >= '2.2.2'
gem 'puppet-blacksmith', '>= 4.1.0', {"groups"=>["development"]}
gem 'beaker', '>= 4.0.0', {"groups"=>["system_tests"]}
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"]}
Expand All @@ -36,7 +36,6 @@ 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 'rgen'
gem 'parallel_tests'

# vim:ft=ruby
32 changes: 3 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ Installs and configures the Puppet agent and optionally a Puppet master (when
`server` is true). Part of the [Foreman installer](https://github.com/theforeman/foreman-installer)
or to be used as a Puppet module.

The Puppet master is configured under Apache and Passenger by default, unless
`server_passenger` is set to false. When using Puppet Labs AIO packages
(puppet-agent) the JVM-based Puppet Server is installed by default. For Puppet
3.x based installation, `server_implementation` can be set to `puppetserver`
to switch to the JVM-based Puppet Server.

When using Puppet Server (version 2.2.x is the lowest version, this module supports),
the module supports and assumes you will be installing the latest version.
If you know you'll be installing an earlier or specific version, you will
Expand All @@ -26,13 +20,8 @@ any options that are not explicitly supported.

## Environments support

The module helps configure Puppet environments using directory environments on
Puppet 3.6+ and config environments on older versions. These are set up under
/etc/puppet/environments/ - change `server_environments` to define the list to
create, or use `puppet::server::env` for more control. When using directory
environments with R10K you need to set the `server_environments` parameter to an
empty array ie. `[]` to prevent `r10k deploy environments` from reporting an
error caused by the creation of top level environment directory(s).
The module helps configure Puppet environments using directory environments.
These are set up under /etc/puppetlabs/code/environments.

## Git repo support

Expand Down Expand Up @@ -105,15 +94,6 @@ wrapper classes or even your ENC (if it supports param classes). For example:
server_external_nodes => '',
}

# The same example as above but overriding `server_environments` for R10K
class { '::puppet':
server => true,
server_foreman => false,
server_reports => 'store',
server_external_nodes => '',
server_environments => [],
}

# Want to integrate with an existing PuppetDB?
class { '::puppet':
server => true,
Expand Down Expand Up @@ -143,12 +123,7 @@ and `X-SSL-Subject` HTTP headers to have been set on the front end server.

The listening port can be configured by setting `server_http_port` (which defaults to 8139).

For passenger setups, this HTTP instance accepts no connections by default (`deny all` in the `<Directory>`
snippet). Allowed hosts can be configured by setting the `server_http_allow` parameter
(which expects an array).

For puppetserver, this HTTP instance accepts **ALL** connections and no further restrictions can be configured. The
`server_http_allow` parameter has no effect at all!
For puppetserver, this HTTP instance accepts **ALL** connections and no further restrictions can be configured.

**Note that running an HTTP puppetmaster is a huge security risk when improperly
configured. Allowed hosts should be tightly controlled; anyone with access to an allowed
Expand All @@ -159,7 +134,6 @@ host can access all client catalogues and client certificates.**
server => true,
server_http => true,
server_http_port => 8130, # default: 8139
server_http_allow => ['10.20.30.1', 'puppetbalancer.my.corp'],
}

## Puppet Server configuration
Expand Down
1 change: 1 addition & 0 deletions manifests/agent.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Puppet agent
# @api private
class puppet::agent {
contain puppet::agent::install
contain puppet::agent::config
Expand Down
1 change: 1 addition & 0 deletions manifests/agent/config.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Puppet agent configuration
# @api private
class puppet::agent::config inherits puppet::config {
puppet::config::agent{
'classfile': value => $::puppet::classfile;
Expand Down
3 changes: 2 additions & 1 deletion manifests/agent/install.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Install the puppet client installation
# Install the puppet agent package
# @api private
class puppet::agent::install(
$manage_packages = $::puppet::manage_packages,
$package_name = $::puppet::client_package,
Expand Down
5 changes: 3 additions & 2 deletions manifests/agent/service.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Set up the puppet client as a service
# Set up the puppet agent as a service
# @api private
class puppet::agent::service {

case $::puppet::runmode {
Expand All @@ -17,7 +18,7 @@
$cron_enabled = false
$systemd_enabled = true
}
'none': {
'none', 'unmanaged': {
$service_enabled = false
$cron_enabled = false
$systemd_enabled = false
Expand Down
6 changes: 4 additions & 2 deletions manifests/agent/service/cron.pp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Set up running the agent via cron
# @api private
class puppet::agent::service::cron (
Boolean $enabled = false,
) {
unless 'cron' in $::puppet::unavailable_runmodes {
unless $::puppet::runmode == 'unmanaged' or 'cron' in $::puppet::unavailable_runmodes {
if $enabled {
$command = pick($::puppet::cron_cmd, "${::puppet::puppet_cmd} agent --config ${::puppet::dir}/puppet.conf --onetime --no-daemonize")
$times = ip_to_cron($::puppet::runinterval)
$times = extlib::ip_to_cron($::puppet::runinterval)
cron { 'puppet':
command => $command,
user => root,
Expand Down
4 changes: 3 additions & 1 deletion manifests/agent/service/daemon.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Set up running the agent as a daemon
# @api private
class puppet::agent::service::daemon (
Boolean $enabled = false,
) {
unless 'service' in $::puppet::unavailable_runmodes {
unless $::puppet::runmode == 'unmanaged' or 'service' in $::puppet::unavailable_runmodes {
if $enabled {
service {'puppet':
ensure => running,
Expand Down
6 changes: 4 additions & 2 deletions manifests/agent/service/systemd.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Set up running the agent via a systemd timer
# @api private
class puppet::agent::service::systemd (
Boolean $enabled = false,
) {
unless 'systemd.timer' in $::puppet::unavailable_runmodes {
unless $::puppet::runmode == 'unmanaged' or 'systemd.timer' in $::puppet::unavailable_runmodes {
exec { 'systemctl-daemon-reload-puppet':
refreshonly => true,
path => $::path,
Expand All @@ -10,7 +12,7 @@

if $enabled {
# Use the same times as for cron
$times = ip_to_cron($::puppet::runinterval)
$times = extlib::ip_to_cron($::puppet::runinterval)

$command = $::puppet::systemd_cmd ? {
undef => "${::puppet::puppet_cmd} agent --config ${::puppet::dir}/puppet.conf --onetime --no-daemonize --detailed-exitcode --no-usecacheonfailure",
Expand Down
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Set up the puppet config
# @api private
class puppet::config(
$allow_any_crl_auth = $::puppet::allow_any_crl_auth,
$auth_allowed = $::puppet::auth_allowed,
Expand Down
Loading