Creating a new Node on Jenkins with SSH Credentials #102
-
I am trying to remotely create an jenkins node with ssh credentials, is there a way to do that?
I am using the the following code:
I want to add other attributes that are required to create a node with ssh credentials. I am not sure what keys and values should I add. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
@devrajshetake it's a little complicated, you have to create ssh node in browser and inspect the request to get the supported attributes. for example, inspect request with default setting: {
"name": "test",
"nodeDescription": "",
"": [
"",
"hudson.plugins.sshslaves.SSHLauncher",
"0"
],
"numExecutors": "1",
"remoteFS": "",
"labelString": "",
"mode": "NORMAL",
"launcher": {
"oldCommand": "",
"stapler-class": "hudson.plugins.sshslaves.SSHLauncher",
"$class": "hudson.plugins.sshslaves.SSHLauncher",
**"host": "<some-ssh-node-address>",**
"includeUser": "false",
**"credentialsId": "<some-ssh-key-credential-id>",**
"": "0",
"sshHostKeyVerificationStrategy": {
"stapler-class": "hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy",
"$class": "hudson.plugins.sshslaves.verifiers.KnownHostsFileKeyVerificationStrategy"
},
"port": "22",
"javaPath": "",
"jvmOptions": "",
"prefixStartSlaveCmd": "",
"suffixStartSlaveCmd": "",
"launchTimeoutSeconds": "",
"maxNumRetries": "",
"retryWaitTime": "",
"tcpNoDelay": true,
"workDir": ""
},
"retentionStrategy": {
"stapler-class": "hudson.slaves.RetentionStrategy$Always",
"$class": "hudson.slaves.RetentionStrategy$Always"
},
"nodeProperties": {
"stapler-class-bag": "true"
},
"type": "hudson.slaves.DumbSlave",
"Submit": "",
"Jenkins-Crumb": "5b0dc43b1a9f3d975164478c572906e33b3e109a77609a44cb9dcf8e4b4d82a9"
} |
Beta Was this translation helpful? Give feedback.
@devrajshetake it's a little complicated, you have to create ssh node in browser and inspect the request to get the supported attributes. for example, inspect request with default setting: