0
0
Jenkinsdevops~10 mins

Agent connection methods (SSH, JNLP) in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the agent launch method using SSH in Jenkins.

Jenkins
agent {
  label 'linux'
  [1] {
    host '192.168.1.10'
    credentialsId 'ssh-key'
  }
}
Drag options to blanks, or click blank then click option'
Ajnlp
Bdocker
Cssh
Dscript
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'jnlp' instead of 'ssh' for SSH connection.
2fill in blank
medium

Complete the code to launch a Jenkins agent using JNLP.

Jenkins
node('agent-node') {
  stage('Run') {
    steps {
      [1] {
        url 'http://jenkins.example.com'
        tunnel 'jenkins.example.com:50000'
      }
    }
  }
}
Drag options to blanks, or click blank then click option'
AjnlpLauncher
BscriptLauncher
CdockerLauncher
DsshLauncher
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'sshLauncher' instead of 'jnlpLauncher' for JNLP connection.
3fill in blank
hard

Fix the error in the Jenkins agent configuration to use the correct launch method.

Jenkins
agent {
  label 'build-agent'
  [1] {
    credentialsId 'agent-creds'
    host '10.0.0.5'
  }
}
Drag options to blanks, or click blank then click option'
Ajnlp
Bssh
Cdocker
Dscript
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'jnlp' instead of 'ssh' causes connection failure.
4fill in blank
hard

Fill both blanks to configure a Jenkins agent with SSH launch and specify the correct host and credentials.

Jenkins
agent {
  [1] {
    host '[2]'
    credentialsId 'ssh-key-123'
  }
}
Drag options to blanks, or click blank then click option'
Assh
Bjnlp
C192.168.100.50
D10.10.10.10
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'jnlp' instead of 'ssh' or invalid host IP.
5fill in blank
hard

Fill all three blanks to define a Jenkins agent using JNLP with the correct URL, tunnel, and launch method.

Jenkins
agent {
  [1] {
    url '[2]'
    tunnel '[3]'
  }
}
Drag options to blanks, or click blank then click option'
AjnlpLauncher
Bhttp://jenkins.local:8080
Cjenkins.local:50000
DsshLauncher
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'sshLauncher' instead of 'jnlpLauncher' or wrong URL/tunnel.