Skip to content
Open
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
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ name: CI

on:
pull_request:
push:
branches:
- 'develop'
- 'master'
- '*-stable'


concurrency:
Expand All @@ -12,8 +17,7 @@ concurrency:
jobs:
puppet:
name: Puppet
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v2
uses: voxpupuli/gha-puppet/.github/workflows/beaker.yml@v3
with:
pidfile_workaround: 'true'
rubocop: false
cache-version: '1'
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ gem 'rake'

gem 'kafo_module_lint', {"groups"=>["test"]}
gem 'puppet-lint-spaceship_operator_without_tag-check', '~> 1.0', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 7.0', {"groups"=>["test"]}
gem 'voxpupuli-test', '~> 9.0', {"groups"=>["test"]}
gem 'github_changelog_generator', '>= 1.15.0', {"groups"=>["development"]}
gem 'puppet_metadata', '~> 4.0'
gem 'puppet-blacksmith', '>= 6.0.0', {"groups"=>["development"]}
gem 'voxpupuli-acceptance', '~> 3.0', {"groups"=>["system_tests"]}
gem 'voxpupuli-acceptance', '~> 3.4', {"groups"=>["system_tests"]}
gem 'puppetlabs_spec_helper', {"groups"=>["system_tests"]}
gem 'hocon'

Expand Down
4 changes: 2 additions & 2 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'ssldir': value => $puppet::ssldir;
'privatekeydir': value => '$ssldir/private_keys { group = service }';
'hostprivkey': value => '$privatekeydir/$certname.pem { mode = 640 }';
'show_diff': value => $puppet::show_diff;
'show_diff': value => $puppet::show_diff;
'codedir': value => $puppet::codedir;
}

Expand Down Expand Up @@ -92,7 +92,7 @@
-> case $facts['os']['family'] {
'Windows': {
concat { "${puppet_dir}/puppet.conf":
mode => $puppet::puppetconf_mode,
mode => $puppet::puppetconf_mode,
}
}

Expand Down
46 changes: 46 additions & 0 deletions spec/classes/puppet_server_puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
end

describe 'with default parameters' do
it { should contain_file('/etc/custom/puppetserver/services.d').with_ensure('directory') }

Check failure on line 37 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on redhat-8-x86_64 with default parameters is expected to contain File[/etc/custom/puppetserver/services.d] with ensure => "directory" Failure/Error: it { should contain_file('/etc/custom/puppetserver/services.d').with_ensure('directory') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net
it {

Check failure on line 38 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on redhat-8-x86_64 with default parameters is expected to contain File[/etc/custom/puppetserver/services.d/ca.cfg] with content =~ /^puppetlabs.services.ca.certificate-authority-service\/certificate-authority-service/, content =~ /^#puppetlabs.services.ca.certificate-authority-disabled-service\/certificate-authority-disabled-service/ and content =~ /^puppetlabs.trapperkeeper.services.watcher.filesystem-watch-service\/filesystem-watch-service/ Failure/Error: should contain_file('/etc/custom/puppetserver/services.d/ca.cfg') .with_content(%r{^puppetlabs.services.ca.certificate-authority-service/certificate-authority-service}) .with_content(%r{^#puppetlabs.services.ca.certificate-authority-disabled-service/certificate-authority-disabled-service}) .with_content(%r{^puppetlabs.trapperkeeper.services.watcher.filesystem-watch-service/filesystem-watch-service}) Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net
should contain_file('/etc/custom/puppetserver/services.d/ca.cfg')
.with_content(%r{^puppetlabs.services.ca.certificate-authority-service/certificate-authority-service})
.with_content(%r{^#puppetlabs.services.ca.certificate-authority-disabled-service/certificate-authority-disabled-service})
Expand Down Expand Up @@ -117,6 +117,10 @@
.with_content(/^\s+name: "puppetlabs cert status"/)
.with_content(%r{^\s+path: "/puppet-ca/v1/certificate_statuses"})
.with_content(/^\s+name: "puppetlabs cert statuses"/)
.with_content(%r{^\s+path: "/puppet-ca/v1/sign"})
.with_content(/^\s+name: "puppetlabs cert sign"/)
.with_content(%r{^\s+path: "/puppet-ca/v1/sign/all"})
.with_content(/^\s+name: "puppetlabs cert sign all"/)
.with_content(%r{^\s+path: "/puppet-admin-api/v1/environment-cache"})
.with_content(/^\s+name: "environment-cache"/)
.with_content(%r{^\s+path: "/puppet-admin-api/v1/jruby-pool"})
Expand Down Expand Up @@ -345,7 +349,7 @@

describe 'server_max_open_files', unless: facts[:osfamily] == 'FreeBSD' do
context 'when server_max_open_files => undef' do
it do

Check failure on line 352 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on centos-9-x86_64 server_max_open_files when server_max_open_files => undef is expected to contain File_line[puppet::server::puppetserver::max_open_files] with ensure => "absent" Failure/Error: should contain_file_line('puppet::server::puppetserver::max_open_files') .with_ensure('absent') expected that the catalogue would contain File_line[puppet::server::puppetserver::max_open_files]

Check failure on line 352 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on redhat-9-x86_64 server_max_open_files when server_max_open_files => undef is expected to contain File_line[puppet::server::puppetserver::max_open_files] with ensure => "absent" Failure/Error: should contain_file_line('puppet::server::puppetserver::max_open_files') .with_ensure('absent') expected that the catalogue would contain File_line[puppet::server::puppetserver::max_open_files]

Check failure on line 352 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on redhat-8-x86_64 server_max_open_files when server_max_open_files => undef is expected to contain File_line[puppet::server::puppetserver::max_open_files] with ensure => "absent" Failure/Error: should contain_file_line('puppet::server::puppetserver::max_open_files') .with_ensure('absent') expected that the catalogue would contain File_line[puppet::server::puppetserver::max_open_files]
if facts['service_provider'] == 'systemd'
should contain_systemd__dropin_file('puppetserver.service-limits.conf')
.with_ensure('absent')
Expand All @@ -359,7 +363,7 @@
context 'when server_max_open_files => 32143' do
let(:params) { super().merge(server_max_open_files: 32143) }

it do

Check failure on line 366 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on centos-9-x86_64 server_max_open_files when server_max_open_files => 32143 is expected to contain File_line[puppet::server::puppetserver::max_open_files] with ensure => "present", path => "/etc/default/puppetserver", line => "ulimit -n 32143" and match => "^ulimit\\ -n" Failure/Error: should contain_file_line('puppet::server::puppetserver::max_open_files') .with_ensure('present') .with_path('/etc/default/puppetserver') .with_line('ulimit -n 32143') .with_match('^ulimit\ -n') expected that the catalogue would contain File_line[puppet::server::puppetserver::max_open_files]

Check failure on line 366 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on redhat-9-x86_64 server_max_open_files when server_max_open_files => 32143 is expected to contain File_line[puppet::server::puppetserver::max_open_files] with ensure => "present", path => "/etc/default/puppetserver", line => "ulimit -n 32143" and match => "^ulimit\\ -n" Failure/Error: should contain_file_line('puppet::server::puppetserver::max_open_files') .with_ensure('present') .with_path('/etc/default/puppetserver') .with_line('ulimit -n 32143') .with_match('^ulimit\ -n') expected that the catalogue would contain File_line[puppet::server::puppetserver::max_open_files]

Check failure on line 366 in spec/classes/puppet_server_puppetserver_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on redhat-8-x86_64 server_max_open_files when server_max_open_files => 32143 is expected to contain File_line[puppet::server::puppetserver::max_open_files] with ensure => "present", path => "/etc/default/puppetserver", line => "ulimit -n 32143" and match => "^ulimit\\ -n" Failure/Error: should contain_file_line('puppet::server::puppetserver::max_open_files') .with_ensure('present') .with_path('/etc/default/puppetserver') .with_line('ulimit -n 32143') .with_match('^ulimit\ -n') expected that the catalogue would contain File_line[puppet::server::puppetserver::max_open_files]
if facts['service_provider'] == 'systemd'
should contain_systemd__dropin_file('puppetserver.service-limits.conf')
.with_ensure('present')
Expand Down Expand Up @@ -577,6 +581,48 @@
it { expect(rule['allow']).to eq(['localhost', 'host.example.com']) }
end
end

describe 'cert sign endpoint' do
let(:content) { catalogue.resource('file', auth_conf).send(:parameters)[:content] }
let(:rules) { Hocon.parse(content)['authorization']['rules'] }
let(:rule) { rules.find {|rule| rule['name'] == 'puppetlabs cert sign' } }

context 'by default' do
it { expect(rule).not_to be_nil }
it { expect(rule['match-request']['path']).to eq('/puppet-ca/v1/sign') }
it { expect(rule['match-request']['type']).to eq('path') }
it { expect(rule['match-request']['method']).to eq('post') }
it { expect(rule['sort-order']).to eq(500) }
it { expect(rule['allow']).to eq(['localhost', 'foo.example.com', {'extensions' => {'pp_cli_auth' => 'true'}}]) }
end

context 'with server_ca_client_allowlist set' do
let(:params) { super().merge(server_ca_client_allowlist: ['puppetserver.example.com', 'admin.example.com']) }

it { expect(rule['allow']).to eq(['puppetserver.example.com', 'admin.example.com', {'extensions' => {'pp_cli_auth' => 'true'}}]) }
end
end

describe 'cert sign all endpoint' do
let(:content) { catalogue.resource('file', auth_conf).send(:parameters)[:content] }
let(:rules) { Hocon.parse(content)['authorization']['rules'] }
let(:rule) { rules.find {|rule| rule['name'] == 'puppetlabs cert sign all' } }

context 'by default' do
it { expect(rule).not_to be_nil }
it { expect(rule['match-request']['path']).to eq('/puppet-ca/v1/sign/all') }
it { expect(rule['match-request']['type']).to eq('path') }
it { expect(rule['match-request']['method']).to eq('post') }
it { expect(rule['sort-order']).to eq(500) }
it { expect(rule['allow']).to eq(['localhost', 'foo.example.com', {'extensions' => {'pp_cli_auth' => 'true'}}]) }
end

context 'with server_ca_client_allowlist set' do
let(:params) { super().merge(server_ca_client_allowlist: ['puppetserver.example.com', 'admin.example.com']) }

it { expect(rule['allow']).to eq(['puppetserver.example.com', 'admin.example.com', {'extensions' => {'pp_cli_auth' => 'true'}}]) }
end
end
end
end
end
5 changes: 5 additions & 0 deletions spec/classes/puppet_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
end

describe 'with no custom parameters' do
it { should compile.with_all_deps }

Check failure on line 50 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on redhat-8-x86_64 with no custom parameters is expected to compile into a catalogue without dependency cycles Failure/Error: it { should compile.with_all_deps } error during compilation: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

# install
it { should contain_class('puppet::server::install') }

Check failure on line 53 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on redhat-8-x86_64 with no custom parameters is expected to contain Class[puppet::server::install] Failure/Error: it { should contain_class('puppet::server::install') } Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net
it { should contain_user('puppet') }
it { should contain_package(puppetserver_pkg).with_install_options(nil) }

Expand Down Expand Up @@ -484,7 +484,7 @@
)
end

it 'should not sync the crl' do

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on debian-11-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on fedora-36-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on scientific-7-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on rocky-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on almalinux-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on almalinux-8-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on oraclelinux-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on centos-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on redhat-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 8 (Ruby 3.2)

puppet on redhat-8-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') expected that the catalogue would not contain File[/etc/custom/puppetlabs/puppet/ssl/crl.pem]

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on debian-11-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on fedora-36-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on scientific-7-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on rocky-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on almalinux-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on almalinux-8-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on oraclelinux-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on centos-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on redhat-9-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net

Check warning on line 487 in spec/classes/puppet_server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / 7 (Ruby 2.7)

puppet on redhat-8-x86_64 with server_ca_crl_sync => true with server_ca => false and running "puppet apply" should not sync the crl Failure/Error: should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem') Puppet::PreformattedError: Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/cron: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected ',' ...t a valid %{name}') % { value:, name: self.class.name } unle... ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:189: syntax error, unexpected '}', expecting `end' ...value:, name: self.class.name } unless retval ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:190: Invalid return in class/module body return retval.to_s if retval ^~~~~~ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:420: syntax error, unexpected '}' ...eld}') % ({ cron: ref, field: }) ... ^ /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/cron_core/lib/puppet/type/cron.rb:469: syntax error, unexpected `end', expecting ')' (file: /home/runner/work/puppet-puppet/puppet-puppet/spec/fixtures/modules/puppet/manifests/agent/service/cron.pp, line: 23, column: 7) on node runnervm3jd5f.5tem4wnxuzpupadixjw3cxa4tb.cx.internal.cloudapp.net
# https://github.com/puppetlabs/rspec-puppet/issues/37
pending("rspec-puppet always sets $server_facts['servername']")
should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem')
Expand Down Expand Up @@ -530,6 +530,11 @@
it 'should not sync the crl' do
should_not contain_file('/etc/custom/puppetlabs/puppet/ssl/crl.pem')
end
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path:\s*"/puppet-ca/v1/certificate_renewal"}) }
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path:\s*"/puppet-ca/v1/certificate_status"}) }
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path:\s*"/puppet-ca/v1/certificate_statuses"}) }
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path:\s*"/puppet-ca/v1/sign"}) }
it { should contain_file("#{conf_d_dir}/auth.conf").with_content(%r{path:\s*"/puppet-ca/v1/sign/all"}) }
end
end

Expand Down
40 changes: 40 additions & 0 deletions templates/server/puppetserver/conf.d/auth.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,46 @@ authorization: {
sort-order: 500
name: "puppetlabs cert clean"
},
{
# Allow the CA CLI to access the certificate sign endpoint
match-request: {
path: "/puppet-ca/v1/sign"
type: path
method: post
}
allow: [
<%- @server_ca_client_allowlist.each do |client| -%>
"<%= client %>",
<%- end -%>
{
extensions: {
pp_cli_auth: "true"
}
}
]
sort-order: 500
name: "puppetlabs cert sign"
},
{
# Allow the CA CLI to access the certificate sign all endpoint
match-request: {
path: "/puppet-ca/v1/sign/all"
type: path
method: post
}
allow: [
<%- @server_ca_client_allowlist.each do |client| -%>
"<%= client %>",
<%- end -%>
{
extensions: {
pp_cli_auth: "true"
}
}
]
sort-order: 500
name: "puppetlabs cert sign all"
},
{
# Allow unauthenticated access to the status service endpoint
match-request: {
Expand Down
Loading