The YAML defines one user with id 'admin' and password 'admin123'.
Step 2: Identify the admin username
The user id 'admin' is the admin username set by this config.
Final Answer:
admin -> Option D
Quick Check:
User id in YAML = admin [OK]
Hint: Look for 'id' under users in securityRealm [OK]
Common Mistakes:
Assuming default username instead of YAML value
Confusing password with username
Ignoring YAML indentation and structure
4. You applied this JCasC YAML but Jenkins failed to start:
jenkins:
systemMessage "Hello Jenkins!"
What is the error in this configuration?
medium
A. Incorrect indentation of systemMessage
B. Missing colon ':' after systemMessage key
C. systemMessage should be under securityRealm
D. Quotes around Hello Jenkins! are not allowed
Solution
Step 1: Check YAML key-value syntax
YAML requires a colon ':' after keys to separate them from values.
Step 2: Identify missing colon
The line 'systemMessage "Hello Jenkins!"' misses the colon after systemMessage.
Final Answer:
Missing colon ':' after systemMessage key -> Option B
Quick Check:
YAML key:value needs colon [OK]
Hint: YAML keys must have colon ':' before values [OK]
Common Mistakes:
Forgetting colon after key
Misplacing keys under wrong parent
Thinking quotes are forbidden
5. You want to automate Jenkins setup with JCasC to create two users: 'alice' and 'bob'. Which YAML snippet correctly defines both users with passwords?
Users must be a list of maps with 'id' and 'password' keys for each user.
Step 2: Check each option's structure
jenkins:
securityRealm:
local:
allowsSignup: false
users:
- id: "alice"
password: "alicePass"
- id: "bob"
password: "bobPass" correctly uses a list with '- id' and 'password' pairs for alice and bob.