Skip to content

Commit

Permalink
drop Puppet 4
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoll authored and ekohl committed Apr 11, 2019
1 parent c6d90ab commit 1cd2804
Show file tree
Hide file tree
Showing 17 changed files with 122 additions and 499 deletions.
1 change: 0 additions & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
global:
- PARALLEL_TEST_PROCESSORS=8
beaker_puppet_collections:
- pc1
- puppet5
- puppet6
Rakefile:
Expand Down
47 changes: 1 addition & 46 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,17 @@
---
# This file is managed centrally by modulesync
# https://github.com/theforeman/foreman-installer-modulesync
rvm:
- 2.1.9
- 2.3.0
- 2.4.1
env:
matrix:
- PUPPET_VERSION=4.9
global:
- PARALLEL_TEST_PROCESSORS=8
matrix:
fast_finish: true
include:
- rvm: 2.4.1
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
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
env:
- BEAKER_PUPPET_COLLECTION=puppet5
Expand All @@ -53,17 +34,6 @@ 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=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
env:
- BEAKER_PUPPET_COLLECTION=puppet5
Expand All @@ -86,17 +56,6 @@ 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=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
Expand All @@ -120,8 +79,4 @@ matrix:
- 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
dist: xenial
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

source 'https://rubygems.org'

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

gem 'rake'
gem 'rspec', '~> 3.0'
Expand Down
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ 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.

When using Puppet Server (version 2.2.x is the lowest version, this module supports),
When using Puppet Server (version 5.3.6 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
need to override `server_puppetserver_version`. More information in the Puppet
Expand Down Expand Up @@ -144,18 +144,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.

Currently supported values and configuration behaviours are:

* `5.1.0` (default for Puppet >= 5.1) - configures CRL reload service and `/puppet/v3/tasks` route
* `5.0.0` (default for Puppet 5.0.x) - configures metrics service and `/puppet/experimental` route
* `2.7.x` (default for Puppet < 5) - creates `product.conf`
* `2.5.x`, `2.6.x` - configures the certificate authority in `ca.cfg`
* `2.4.99` - configures for both 2.4 and 2.5, with `bootstrap.cfg`
and `ca.cfg`
* `2.3.x`, `2.4.x` - configures the certificate authority and
versioned-code-service in `bootstrap.cfg`
* `2.2.x` - configures the certificate authority in `bootstrap.cfg`

# Contributing

* Fork the project
Expand Down
2 changes: 1 addition & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@

$server_puppetserver_version = undef

# Puppetserver >= 2.2 Which auth.conf shall we use?
# Puppetserver 5.x Which auth.conf shall we use?
$server_use_legacy_auth_conf = false

# For Puppetserver 5, use JRuby 9k?
Expand Down
14 changes: 2 additions & 12 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -475,25 +475,15 @@
$real_puppetserver_version = $puppetserver_version
} elsif versioncmp($::puppetversion, '6.0.0') >= 0 {
$real_puppetserver_version = '6.0.0'
} elsif versioncmp($::puppetversion, '5.5.7') >= 0 {
} else {
$real_puppetserver_version = '5.3.6'
} elsif versioncmp($::puppetversion, '5.5.0') >= 0 {
$real_puppetserver_version = '5.3.0'
} elsif versioncmp($::puppetversion, '5.1.0') >= 0 {
$real_puppetserver_version = '5.1.0'
} elsif versioncmp($::puppetversion, '5.0.0') >= 0 {
$real_puppetserver_version = '5.0.0'
} else {
$real_puppetserver_version = '2.7.0'
}

# Prefer the user setting,otherwise disable for Puppetserver 2.x, enabled for 5.x
$real_puppetserver_metrics = pick($puppetserver_metrics, versioncmp($real_puppetserver_version, '5.0.0') >= 0)
$real_puppetserver_metrics = pick($puppetserver_metrics, true)

if $jvm_extra_args {
$real_jvm_extra_args = $jvm_extra_args
} elsif versioncmp($real_puppetserver_version, '5.0.0') < 0 {
$real_jvm_extra_args = '-XX:MaxPermSize=256m'
} else {
$real_jvm_extra_args = '-Djruby.logger.class=com.puppetlabs.jruby_utils.jruby.Slf4jLogger'
}
Expand Down
56 changes: 20 additions & 36 deletions manifests/server/puppetserver.pp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@
) {
include ::puppet::server

if versioncmp($server_puppetserver_version, '2.7') < 0 {
fail('puppetserver <2.7 is not supported by this module version')
if versioncmp($server_puppetserver_version, '5.3.6') < 0 {
fail('puppetserver <5.3.6 is not supported by this module version')
}

$puppetserver_package = pick($::puppet::server::package, 'puppetserver')
Expand Down Expand Up @@ -167,11 +167,7 @@

$bootstrap_paths = "${server_puppetserver_dir}/services.d/,/opt/puppetlabs/server/apps/puppetserver/config/services.d/"

if versioncmp($server_puppetserver_version, '5.3') >= 0 {
$server_gem_paths = [ '${jruby-puppet.gem-home}', "\"${server_puppetserver_vardir}/vendored-jruby-gems\"", "\"/opt/puppetlabs/puppet/lib/ruby/vendor_gems\""] # lint:ignore:single_quote_string_with_variables
} else {
$server_gem_paths = [ '${jruby-puppet.gem-home}', "\"${server_puppetserver_vardir}/vendored-jruby-gems\"", ] # lint:ignore:single_quote_string_with_variables
}
$server_gem_paths = [ '${jruby-puppet.gem-home}', "\"${server_puppetserver_vardir}/vendored-jruby-gems\"", "\"/opt/puppetlabs/puppet/lib/ruby/vendor_gems\""] # lint:ignore:single_quote_string_with_variables

augeas { 'puppet::server::puppetserver::bootstrap':
lens => 'Shellvars.lns',
Expand All @@ -180,18 +176,16 @@
changes => "set BOOTSTRAP_CONFIG '\"${bootstrap_paths}\"'",
}

if versioncmp($server_puppetserver_version, '5.0') >= 0 {
$jruby_jar_changes = $server_jruby9k ? {
true => "set JRUBY_JAR '\"/opt/puppetlabs/server/apps/puppetserver/jruby-9k.jar\"'",
default => 'rm JRUBY_JAR'
}
$jruby_jar_changes = $server_jruby9k ? {
true => "set JRUBY_JAR '\"/opt/puppetlabs/server/apps/puppetserver/jruby-9k.jar\"'",
default => 'rm JRUBY_JAR'
}

augeas { 'puppet::server::puppetserver::jruby_jar':
lens => 'Shellvars.lns',
incl => $config,
context => "/files${config}",
changes => $jruby_jar_changes,
}
augeas { 'puppet::server::puppetserver::jruby_jar':
lens => 'Shellvars.lns',
incl => $config,
context => "/files${config}",
changes => $jruby_jar_changes,
}

$ensure_max_open_files = $max_open_files ? {
Expand Down Expand Up @@ -233,14 +227,8 @@
}
}

if versioncmp($server_puppetserver_version, '5.3.6') >= 0 {
$ca_conf_ensure = present
} else {
$ca_conf_ensure = absent
}

file { "${server_puppetserver_dir}/conf.d/ca.conf":
ensure => $ca_conf_ensure,
ensure => file,
content => template('puppet/server/puppetserver/conf.d/ca.conf.erb'),
}

Expand All @@ -264,17 +252,13 @@
content => template('puppet/server/puppetserver/conf.d/product.conf.erb'),
}

if versioncmp($server_puppetserver_version, '5.0') >= 0 {
$metrics_conf = "${server_puppetserver_dir}/conf.d/metrics.conf"

$metrics_conf_ensure = $server_metrics ? {
true => file,
default => absent
}
$metrics_conf_ensure = $server_metrics ? {
true => file,
default => absent
}

file { $metrics_conf:
ensure => $metrics_conf_ensure,
content => template('puppet/server/puppetserver/conf.d/metrics.conf.erb'),
}
file { "${server_puppetserver_dir}/conf.d/metrics.conf":
ensure => $metrics_conf_ensure,
content => template('puppet/server/puppetserver/conf.d/metrics.conf.erb'),
}
}
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"requirements": [
{
"name": "puppet",
"version_requirement": ">= 4.6.1 < 7.0.0"
"version_requirement": ">= 5.5.8 < 7.0.0"
}
],
"operatingsystem_support": [
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/puppetserver_config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'Puppetserver config options', unless: ENV['BEAKER_PUPPET_COLLECTION'] == 'pc1' && fact('lsbdistcodename') == 'stretch' do
describe 'Puppetserver config options' do
before(:context) do
if check_for_package(default, 'puppetserver')
on default, puppet('resource package puppetserver ensure=purged')
Expand Down
2 changes: 1 addition & 1 deletion spec/acceptance/puppetserver_latest_spec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'Scenario: install puppetserver (latest):', unless: ENV['BEAKER_PUPPET_COLLECTION'] == 'pc1' && fact('lsbdistcodename') == 'stretch' do
describe 'Scenario: install puppetserver (latest):' do
before(:context) do
if check_for_package(default, 'puppetserver')
on default, puppet('resource package puppetserver ensure=purged')
Expand Down
90 changes: 0 additions & 90 deletions spec/acceptance/puppetserver_upgrade_2_6_0_to_2_7_2_spec.rb

This file was deleted.

Loading

0 comments on commit 1cd2804

Please sign in to comment.