Challenge - 5 Problems
JCasC Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
JCasC YAML Loading Behavior
Given this Jenkins Configuration as Code (JCasC) YAML snippet, what will be the output when Jenkins loads it?
jenkins:
systemMessage: "Welcome to Jenkins"
numExecutors: 3
securityRealm:
local:
allowsSignup: false
users:
- id: "admin"
password: "admin123"Attempts:
2 left
💡 Hint
Check if the YAML defines required fields for system message, executors, and local users.
✗ Incorrect
The YAML snippet correctly defines systemMessage, numExecutors, and a local security realm with one user. Jenkins will apply these settings on load.
❓ Troubleshoot
intermediate2:00remaining
Troubleshooting JCasC Plugin Failure
You applied a JCasC YAML file to Jenkins but the configuration did not apply and Jenkins logs show:
What is the most likely cause?
java.lang.IllegalArgumentException: No enum constant jenkins.security.s2m.AdminWhitelistRule
What is the most likely cause?
Attempts:
2 left
💡 Hint
Look at the error mentioning 'No enum constant' related to security.
✗ Incorrect
The error indicates an invalid enum value was given in the YAML for a security setting, likely 'authorizationStrategy'.
❓ Configuration
advanced2:00remaining
Configuring Jenkins Global Tools with JCasC
Which YAML snippet correctly configures a JDK installation named 'jdk11' with JAVA_HOME '/usr/lib/jvm/java-11-openjdk' using Jenkins Configuration as Code?
Attempts:
2 left
💡 Hint
Global tools are configured under the 'jenkins' root key and 'tools' section.
✗ Incorrect
The correct JCasC syntax places tools under 'jenkins.tools.jdk.installations'.
🔀 Workflow
advanced2:00remaining
JCasC and Pipeline Job Creation
You want to create a Jenkins pipeline job named 'build-app' using JCasC. Which approach is correct?
Attempts:
2 left
💡 Hint
JCasC supports job definitions under a specific section.
✗ Incorrect
JCasC can define jobs under the 'jobs:' key with full job configuration including pipeline scripts.
✅ Best Practice
expert2:00remaining
Best Practice for Managing Secrets in JCasC
What is the recommended way to manage sensitive credentials when using Jenkins Configuration as Code (JCasC)?
Attempts:
2 left
💡 Hint
Consider security best practices for secret management in Jenkins.
✗ Incorrect
The best practice is to store secrets securely in Jenkins Credentials Plugin and reference them by ID in JCasC YAML, avoiding secrets in plain text files.