9 changes: 9 additions & 0 deletions .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
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'
concat: 'https://github.com/puppetlabs/puppetlabs-concat.git'
cron_core:
repo: 'https://github.com/puppetlabs/puppetlabs-cron_core'
puppet_version: '>= 6.0.0'
extlib: 'https://github.com/voxpupuli/puppet-extlib.git'
foreman: 'https://github.com/theforeman/puppet-foreman.git'
git: 'https://github.com/theforeman/puppet-git.git'
inifile: 'https://github.com/puppetlabs/puppetlabs-inifile.git'
puppetdb: 'https://github.com/puppetlabs/puppetlabs-puppetdb.git'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
yumrepo_core:
repo: 'https://github.com/puppetlabs/puppetlabs-yumrepo_core'
puppet_version: '>= 6.0.0'
7 changes: 5 additions & 2 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
- centos7-64
- centos6-64
- debian8-64
- debian9-64
env:
global:
- PARALLEL_TEST_PROCESSORS=8
# Some upgrade tests rely on PC1 version numbers
beaker_puppet_collection: pc1
beaker_puppet_collections:
- pc1
- puppet5
- puppet6
Rakefile:
param_docs_pattern:
- manifests/init.pp
Expand Down
38 changes: 38 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,62 @@ matrix:
env: PUPPET_VERSION=5.0
- rvm: 2.5.1
env: PUPPET_VERSION=5.0
- rvm: 2.5.1
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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
- 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}
script: bundle exec rake beaker
services: docker
bundler_args: --without development
bundler_args: --without system_tests development
sudo: false
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## [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)

**Implemented enhancements:**

- Add support for managing jetty threads [\#647](https://github.com/theforeman/puppet-puppet/pull/647) ([bastelfreak](https://github.com/bastelfreak))
- Refactor testing and use data types in private classes [\#645](https://github.com/theforeman/puppet-puppet/pull/645) ([ekohl](https://github.com/ekohl))
- Update CA related files for Puppetserver 5.3.6 [\#643](https://github.com/theforeman/puppet-puppet/pull/643) ([mmoll](https://github.com/mmoll))
- Add Puppet 6 support [\#642](https://github.com/theforeman/puppet-puppet/pull/642) ([ekohl](https://github.com/ekohl))

**Fixed bugs:**

- adjust puppetversion to puppetserver\_version mapping [\#651](https://github.com/theforeman/puppet-puppet/pull/651) ([mmoll](https://github.com/mmoll))

## [10.0.0](https://github.com/theforeman/puppet-puppet/tree/10.0.0) (2018-10-16)

[Full Changelog](https://github.com/theforeman/puppet-puppet/compare/9.1.0...10.0.0)
Expand Down Expand Up @@ -500,3 +515,6 @@
* Notify agent service when configs change
* Fix SSL parameter pass-through for Foreman puppetmaster setup
* Change fixture URLs from git:// to https:// (Guido Günther)


\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[![Puppet Forge](http://img.shields.io/puppetforge/v/theforeman/puppet.svg)](https://forge.puppetlabs.com/theforeman/puppet)
[![Puppet Forge](https://img.shields.io/puppetforge/v/theforeman/puppet.svg)](https://forge.puppetlabs.com/theforeman/puppet)
[![Build Status](https://travis-ci.org/theforeman/puppet-puppet.svg?branch=master)](https://travis-ci.org/theforeman/puppet-puppet)

# Puppet module for installing the Puppet agent and master

Installs and configures the Puppet agent and optionally a Puppet master (when
`server` is true). Part of the [Foreman installer](http://github.com/theforeman/foreman-installer)
`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
Expand Down Expand Up @@ -189,7 +189,7 @@ Currently supported values and configuration behaviours are:

# More info

See http://theforeman.org or at #theforeman irc channel on freenode
See https://theforeman.org or at #theforeman irc channel on freenode

Copyright (c) 2010-2012 Ohad Levy

Expand All @@ -203,4 +203,4 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.
33 changes: 13 additions & 20 deletions manifests/agent/service/cron.pp
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
class puppet::agent::service::cron (
$enabled = false,
Boolean $enabled = false,
) {
if ! ('cron' in $::puppet::unavailable_runmodes) {
case $enabled {
true: {
$command = $::puppet::cron_cmd ? {
undef => "${::puppet::puppet_cmd} agent --config ${::puppet::dir}/puppet.conf --onetime --no-daemonize",
default => $::puppet::cron_cmd,
}

$times = ip_to_cron($::puppet::runinterval)
cron { 'puppet':
command => $command,
user => root,
hour => $times[0],
minute => $times[1],
}
unless '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)
cron { 'puppet':
command => $command,
user => root,
hour => $times[0],
minute => $times[1],
}
false: {
cron { 'puppet':
ensure => absent,
}
} else{
cron { 'puppet':
ensure => absent,
}
}
}
Expand Down
96 changes: 46 additions & 50 deletions manifests/agent/service/systemd.pp
Original file line number Diff line number Diff line change
@@ -1,70 +1,66 @@
class puppet::agent::service::systemd (
$enabled = false,
Boolean $enabled = false,
) {
if ! ('systemd.timer' in $::puppet::unavailable_runmodes) {
unless 'systemd.timer' in $::puppet::unavailable_runmodes {
exec { 'systemctl-daemon-reload-puppet':
refreshonly => true,
path => $::path,
command => 'systemctl daemon-reload',
}

case $enabled {
true: {
# Use the same times as for cron
$times = ip_to_cron($::puppet::runinterval)
if $enabled {
# Use the same times as for cron
$times = 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",
default => $::puppet::systemd_cmd,
}
$command = $::puppet::systemd_cmd ? {
undef => "${::puppet::puppet_cmd} agent --config ${::puppet::dir}/puppet.conf --onetime --no-daemonize --detailed-exitcode --no-usecacheonfailure",
default => $::puppet::systemd_cmd,
}

$randomizeddelaysec = $::puppet::systemd_randomizeddelaysec
$randomizeddelaysec = $::puppet::systemd_randomizeddelaysec

file { "/etc/systemd/system/${::puppet::systemd_unit_name}.timer":
content => template('puppet/agent/systemd.puppet-run.timer.erb'),
notify => [
Exec['systemctl-daemon-reload-puppet'],
Service['puppet-run.timer'],
],
}
file { "/etc/systemd/system/${::puppet::systemd_unit_name}.timer":
content => template('puppet/agent/systemd.puppet-run.timer.erb'),
notify => [
Exec['systemctl-daemon-reload-puppet'],
Service['puppet-run.timer'],
],
}

file { "/etc/systemd/system/${::puppet::systemd_unit_name}.service":
content => template('puppet/agent/systemd.puppet-run.service.erb'),
notify => Exec['systemctl-daemon-reload-puppet'],
}
file { "/etc/systemd/system/${::puppet::systemd_unit_name}.service":
content => template('puppet/agent/systemd.puppet-run.service.erb'),
notify => Exec['systemctl-daemon-reload-puppet'],
}

service { 'puppet-run.timer':
ensure => running,
provider => 'systemd',
name => "${::puppet::systemd_unit_name}.timer",
enable => true,
require => Exec['systemctl-daemon-reload-puppet'],
}
service { 'puppet-run.timer':
ensure => running,
provider => 'systemd',
name => "${::puppet::systemd_unit_name}.timer",
enable => true,
require => Exec['systemctl-daemon-reload-puppet'],
}
} else {
# Reverse order - stop, delete files, exec
service { 'puppet-run.timer':
ensure => stopped,
provider => 'systemd',
name => "${::puppet::systemd_unit_name}.timer",
enable => false,
before => [
File["/etc/systemd/system/${::puppet::systemd_unit_name}.timer"],
File["/etc/systemd/system/${::puppet::systemd_unit_name}.service"],
],
}
false: {
# Reverse order - stop, delete files, exec
service { 'puppet-run.timer':
ensure => stopped,
provider => 'systemd',
name => "${::puppet::systemd_unit_name}.timer",
enable => false,
before => [
File["/etc/systemd/system/${::puppet::systemd_unit_name}.timer"],
File["/etc/systemd/system/${::puppet::systemd_unit_name}.service"],
],
}

file { "/etc/systemd/system/${::puppet::systemd_unit_name}.timer":
ensure => absent,
notify => Exec['systemctl-daemon-reload-puppet'],
}
file { "/etc/systemd/system/${::puppet::systemd_unit_name}.timer":
ensure => absent,
notify => Exec['systemctl-daemon-reload-puppet'],
}

file { "/etc/systemd/system/${::puppet::systemd_unit_name}.service":
ensure => absent,
notify => Exec['systemctl-daemon-reload-puppet'],
}
file { "/etc/systemd/system/${::puppet::systemd_unit_name}.service":
ensure => absent,
notify => Exec['systemctl-daemon-reload-puppet'],
}
default: { fail('puppet::agent::service::systemd::enabled should be true or false') }
}
}
}
38 changes: 38 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,37 @@
# $server_parser:: Sets the parser to use. Valid options are 'current' or 'future'.
# Defaults to 'current'.
#
# $server_acceptor_threads:: This sets the number of threads that the webserver will dedicate to accepting
# socket connections for unencrypted HTTP traffic. If not provided, the webserver
# defaults to the number of virtual cores on the host divided by 8, with a minimum
# of 1 and maximum of 4.
#
# $server_selector_threads:: This sets the number of selectors that the webserver will dedicate to processing
# events on connected sockets for unencrypted HTTPS traffic. If not provided,
# the webserver defaults to the minimum of: virtual cores on the host divided by 2
# or max-threads divided by 16, with a minimum of 1.
#
# $server_max_threads:: This sets the maximum number of threads assigned to responding to HTTP and/or
# HTTPS requests for a single webserver, effectively changing how many
# concurrent requests can be made at one time. If not provided, the
# webserver defaults to 200.
#
# $server_ssl_acceptor_threads:: This sets the number of threads that the webserver will dedicate to accepting
# socket connections for encrypted HTTPS traffic. If not provided, defaults to
# the number of virtual cores on the host divided by 8, with a minimum of 1 and maximum of 4.
#
# $server_ssl_selector_threads:: This sets the number of selectors that the webserver will dedicate to processing
# events on connected sockets for encrypted HTTPS traffic. Defaults to the number of
# virtual cores on the host divided by 2, with a minimum of 1 and maximum of 4.
# The number of selector threads actually used by Jetty is twice the number of selectors
# requested. For example, if a value of 3 is specified for the ssl-selector-threads setting,
# Jetty will actually use 6 selector threads.
#
# $server_ca_allow_sans:: Allow CA to sign certificate requests that have Subject Alternative Names
# Defaults to false
#
# $server_ca_allow_auth_extensions:: Allow CA to sign certificate requests that have authorization extensions
#
# === Usage:
#
# * Simple usage:
Expand Down Expand Up @@ -735,6 +766,13 @@
Boolean $server_puppetserver_experimental = $puppet::params::server_puppetserver_experimental,
Array[String] $server_puppetserver_trusted_agents = $puppet::params::server_puppetserver_trusted_agents,
Optional[Enum['off', 'jit', 'force']] $server_compile_mode = $puppet::params::server_compile_mode,
Optional[Integer[1]] $server_acceptor_threads = undef,
Optional[Integer[1]] $server_selector_threads = undef,
Optional[Integer[1]] $server_ssl_acceptor_threads = undef,
Optional[Integer[1]] $server_ssl_selector_threads = undef,
Optional[Integer[1]] $server_max_threads = undef,
Boolean $server_ca_allow_sans = $puppet::params::server_ca_allow_sans,
Boolean $server_ca_allow_auth_extensions = $puppet::params::server_ca_allow_auth_extensions,
) inherits puppet::params {
contain puppet::config

Expand Down
Loading