puppetlabs / pupperware

Container fun time lives here.
Other
183 stars 66 forks source link

(maint) Update ssl.sh to recover from common failure scenarios #230

Closed Iristyle closed 3 years ago

Iristyle commented 3 years ago

Addresses errors like:

(/ssl-scripts/ssl.sh) Error: private key '/opt/puppetlabs/server/data/console-services/certs/private_keys/pe-console-services.pem' already exists

and

(/ssl.sh) Error: cannot reach CA host 'pe-puppet' Can't open /opt/puppetlabs/server/data/orchestration-services/certs/private_keys/pe-orchestration-services.pem for reading, No such file or directory

Refactored / amended script for additional failure scenarios and manually recreated them in k8s to validate behavior:

Additionally make a number of improvements to the robustness of the script:

See also https://github.com/puppetlabs/holodeck-manifests/pull/424

Iristyle commented 3 years ago

CI doesn't vet this script - only container builds will, and they need to opt in to rebuilding with a new SHA of ssl.sh. Since this is on a branch, container builds can be vetted prior to merging this PR -- so I'm going to start putting up all the tentative related PRs for consumers (noting that puppetserver has its own process since it hosts the CA):

There is an equivalent PR for pupperware-commercial that impacts:

Iristyle commented 3 years ago

Enough vetting PRs have passed - merging and updating PRs.