Add SSH Host Key Verifier Strategy

Since version 1.15, the Jenkins SSH Slave Plugin has added a requirement
for a SSH Host Key Verification Strategy. This defaults to requiring
that the host key is already accepted by the Jenkins SSH environment.

This path reactivates the old and expected behavior of accepting, but
throwing a warning in the job logs whenever a host is SSHed into that
has an unknown SSH host key.

Change-Id: I2316cac0b2bb6ff2f0f4abc7dfd5307d80edf1b3
This commit is contained in:
Ben Kero 2017-07-13 10:50:14 -07:00
parent c1db43b515
commit 56e0172805

View File

@ -29,11 +29,19 @@ class CreateNodeTask(Task):
if 'credentials_id' in self.args:
launcher_params = {'port': 22,
'credentialsId': self.args['credentials_id'],
'sshHostKeyVerificationStrategy':
{'stapler-class':
('hudson.plugins.sshslaves.verifiers.'
'NonVerifyingKeyVerificationStrategy')},
'host': self.args['host']}
else:
launcher_params = {'port': 22,
'username': self.args['username'],
'privatekey': self.args['private_key'],
'sshHostKeyVerificationStrategy':
{'stapler-class':
('hudson.plugins.sshslaves.verifiers.'
'NonVerifyingKeyVerificationStrategy')},
'host': self.args['host']}
args = dict(
name=self.args['name'],