Converting agent configuration to JCasC
Similar to the controller configuration, let's identify all the changes we've made for agent configuration, then find out how to apply the same changes using JCasC by looking up the relevant section of jen
kins.yaml
.
This time I won't repeat the same steps, but instead discuss the meaning of the entries more in depth:
- Save the SSH private key as a credential in the Jenkins credentials store:
redentials:
system:
domainCredentials:
- credentials:
- basicSSHUserPrivateKey:
description: "firewalled-agent-robot_acct-priv"
id: "firewalled-agent-robot_acct-priv"
privateKeySource:
directEntry:
privateKey: "{AQAAABAu4YD...UN8IhfZyc5nQi}"
scope: SYSTEM
username: "robot_acct"
As discussed before, privateKey
is stored as an encrypted value, and only the current Jenkins has the...