opscode-cookbooks/jenkins — pull request #147 by slingcode (2014-02-12 02:39:10+00:00)
Title: private_key will be used or ignored depending on if Jenkins authentication is enabled

This commit allows a private key to be set for the Jenkins executor at the top of a wrapper cookbook.
The private key will then either be used or ignored by the executor, depending on if authentication is enabled on the Jenkins server.

The new setup for configuring authentication can now be:
A) configure the private key for the executor
B) configure a 'chef' user in Jenkins which has the corresponding public key (the private key will not be used)
C) configure authentication on the server (the private key will not be used)
D) add jobs/make config changes (the private key will now be used)

This change was needed to address the fact that the steps (1-3) shown below would fail on step #1 in the second run, as the private key had not yet been set at this point in the 2nd run:
1) configure a 'chef' user in Jenkins with the public key
2) configuring the private key for the executor
3) configure authentication on the server

Without this change, the new steps (A-D above) will fail on step B in the first run as the public key has not yet been loaded into Jenkins for the private key to authenticate with.