Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Puppet 6 support #642

Merged
merged 2 commits into from
Nov 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 1 addition & 3 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@
$autosign_source = undef

$puppet_cmd = "${bindir}/puppet"
$puppetserver_cmd = "${bindir}/puppetserver"

$manage_packages = true

Expand Down Expand Up @@ -317,9 +318,6 @@
$client_package = ['puppet']
}

$puppetrun_cmd = "${puppet_cmd} kick"
$puppetca_cmd = "${puppet_cmd} cert"

# Puppet service name
$service_name = 'puppet'

Expand Down
8 changes: 7 additions & 1 deletion manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,15 @@

# Generate a new CA and host cert if our host cert doesn't exist
if $::puppet::server::ca {
if versioncmp($::puppetversion, '6.0') > 0 {
$command = "${::puppet::puppetserver_cmd} ca setup"
} else {
$command = "${::puppet::puppet_cmd} cert --generate ${::puppet::server::certname} --allow-dns-alt-names"
}

exec {'puppet_server_config-generate_ca_cert':
creates => $::puppet::server::ssl_cert,
command => "${::puppet::puppetca_cmd} --generate ${::puppet::server::certname} --allow-dns-alt-names",
command => $command,
umask => '0022',
require => [
Concat["${::puppet::server::dir}/puppet.conf"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require 'spec_helper_acceptance'

describe 'Scenario: 2.6.0 to 2.7.2 upgrade:' do
describe 'Scenario: 2.6.0 to 2.7.2 upgrade:', if: ENV['BEAKER_PUPPET_COLLECTION'] == 'pc1' do
before(:context) do
if check_for_package(default, 'puppetserver')
on default, puppet('resource package puppetserver ensure=purged')
Expand Down
14 changes: 11 additions & 3 deletions spec/classes/puppet_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
confdir = '/usr/local/etc/puppet'
environments_dir = '/usr/local/etc/puppet/environments'
etcdir = '/usr/local/etc/puppet'
puppetcacmd = '/usr/local/bin/puppet cert'
if facts[:puppetversion] >= '6.0'
puppetcacmd = '/usr/local/bin/puppetserver ca setup'
else
puppetcacmd = '/usr/local/bin/puppet cert --generate puppetmaster.example.com --allow-dns-alt-names'
end
puppetserver_logdir = '/var/log/puppetserver'
puppetserver_rundir = '/var/run/puppetserver'
puppetserver_vardir = '/var/puppet/server/data/puppetserver'
Expand All @@ -24,7 +28,11 @@
confdir = '/etc/puppetlabs/puppet'
environments_dir = '/etc/puppetlabs/code/environments'
etcdir = '/etc/puppetlabs/puppet'
puppetcacmd = '/opt/puppetlabs/bin/puppet cert'
if facts[:puppetversion] >= '6.0'
puppetcacmd = '/opt/puppetlabs/bin/puppetserver ca setup'
else
puppetcacmd = '/opt/puppetlabs/bin/puppet cert --generate puppetmaster.example.com --allow-dns-alt-names'
end
puppetserver_logdir = '/var/log/puppetlabs/puppetserver'
puppetserver_rundir = '/var/run/puppetlabs/puppetserver'
puppetserver_vardir = '/opt/puppetlabs/server/data/puppetserver'
Expand Down Expand Up @@ -96,7 +104,7 @@

should contain_exec('puppet_server_config-generate_ca_cert') \
.with_creates("#{ssldir}/certs/puppetmaster.example.com.pem") \
.with_command("#{puppetcacmd} --generate puppetmaster.example.com --allow-dns-alt-names") \
.with_command(puppetcacmd) \
.with_umask('0022') \
.that_requires(["Concat[#{conf_file}]", 'Exec[puppet_server_config-create_ssl_dir]'])
end
Expand Down