Skip to content

Commit

Permalink
(PE-25146) Check for hostnames when puppetserver signing
Browse files Browse the repository at this point in the history
We were seeing race conditions in ci for frictionless installs on
solaris and ubuntu (slower platforms?) where the frictionless install
script starts the puppet service, which runs the agent, which begins the
csr submission.

The 'puppetserver ca list --all' output now returns 'Requested' certs in one
section and 'Signed' certs in another. The test for a lack of
'Requested' section works so long as we haven't gotten here before the
agent service has completed submitting the CSR.

To work around this, verify that hostnames are all signed by checking
that we have no Requested, and that therefore we're finding hostnames in
the Signed section.
  • Loading branch information
jpartlow committed Sep 14, 2018
1 parent fbefb88 commit b929a01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/beaker-puppet/helpers/puppet_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def sign_certificate_for(host = [])
else
on master, 'puppetserver ca sign --all', :acceptable_exit_codes => [0, 24]
out = on(master, 'puppetserver ca list --all').stdout
unless out =~ /.*Requested.*/
if out !~ /.*Requested.*/ && hostnames.all? { |hostname| out =~ /\b#{hostname}\b/ }
hostnames.clear
break
end
Expand Down

0 comments on commit b929a01

Please sign in to comment.