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 Puppetserver 6.3 auth.conf update #689

Merged
merged 1 commit into from
Apr 15, 2019
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
12 changes: 12 additions & 0 deletions spec/classes/puppet_server_puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,18 @@
end
end

describe 'puppetlabs v4 catalog for services' do
context 'when server_puppetserver_version >= 6.3' do
let(:params) { super().merge(server_puppetserver_version: '6.3.0') }
it { should contain_file(auth_conf).with_content(%r{^(\ *)path: "\^/puppet/v4/catalog/\?\$"$}) }
end

context 'when server_puppetserver_version < 6.3' do
let(:params) { super().merge(server_puppetserver_version: '6.2.0') }
it { should contain_file(auth_conf).without_content(%r{^(\ *)path: "\^/puppet/v4/catalog/\?\$"$}) }
end
end

describe 'when server_puppetserver_version < 5.3.6' do
let(:params) { super().merge(server_puppetserver_version: '5.3.5') }
it { should raise_error(Puppet::Error, /puppetserver <5.3.6 is not supported by this module version/) }
Expand Down
15 changes: 14 additions & 1 deletion templates/server/puppetserver/conf.d/auth.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,21 @@ authorization: {
}
allow: <%= @server_trusted_agents << '$1' %>
sort-order: 500
name: "puppetlabs catalog"
name: "puppetlabs v3 catalog from agents"
},
<%- if scope.function_versioncmp([@server_puppetserver_version, '6.3.0']) >= 0 -%>
{
# Allow services to retrieve catalogs on behalf of others
match-request: {
path: "^/puppet/v4/catalog/?$"
type: regex
method: post
}
deny: "*"
sort-order: 500
name: "puppetlabs v4 catalog for services"
},
<%- end -%>
{
# Allow nodes to retrieve the certificate they requested earlier
match-request: {
Expand Down