Back to the course
Test yourself

Chef

Final exam · 13 questions · answers explained as you pick
Beginner
4 questions
01Chef’s architecture is best described as…
Incorrect — that is Ansible; Chef uses an agent.
Correct — nodes self-maintain on a schedule — good for large, long-lived fleets.
Incorrect — there is a central server (or local mode for testing).
Incorrect — unrelated.
02A Chef recipe is written in…
Correct — recipes are Ruby; resources declare desired state.
Incorrect — that is Ansible/Kubernetes, not Chef.
Incorrect — that is Terraform.
Incorrect — data bags are JSON; recipes are Ruby.
03In a chef-client run, all Ruby logic executes during…
Incorrect — no — Ruby runs first, at compile.
Incorrect — reporting is last and unrelated.
Correct — reading a file a resource creates “above” fails because that resource has not run yet — the classic gotcha.
Incorrect — compile happens every run.
04The execute resource should be avoided when possible because…
Incorrect — speed is not the issue.
Correct — prefer a real resource; guard execute with not_if/only_if/creates.
Incorrect — no.
Incorrect — it can — that is part of the risk.
4 questions · explanations appear as you answer
Intermediate
4 questions
01Automatic attributes (from ohai) are…
Correct — they are ground truth about the machine — read them for portable recipes.
Incorrect — they are the highest — you cannot override them.
Incorrect — that is data bags.
Incorrect — they are discovered automatically.
02A "why won't this attribute change" bug usually means…
Incorrect — rarely; it is precedence.
Correct — Chef has six levels; something above your default is set.
Incorrect — unrelated.
Incorrect — no.
03metadata.rb’s depends declarations are used to…
Incorrect — run-lists are separate from cookbook metadata.
Incorrect — unrelated.
Correct — they let the server resolve which cookbooks/versions a node needs.
Incorrect — templates live in templates/.
04A node’s run-list is…
Incorrect — no — it is what the node should become.
Correct — change it and the node converges to the new definition on its next run.
Incorrect — that is automatic attributes.
Incorrect — unrelated.
4 questions · explanations appear as you answer
Advanced
5 questions
01For secrets, plain data bags are insufficient because…
Correct — encrypt to a shared key (bags) or per-node keys (Vault), or an external store.
Incorrect — performance is not the issue.
Incorrect — they hold JSON — that is exactly what they are.
Incorrect — unrelated.
02Chef Vault improves on encrypted data bags by…
Incorrect — no — it strengthens it.
Correct — only authorized nodes decrypt; no shared key file to spread and rotate.
Incorrect — the opposite of the goal.
Incorrect — unrelated.
03Test Kitchen is used to…
Incorrect — that is cookstyle.
Incorrect — that is the server.
Correct — full integration testing across platforms before shipping.
Incorrect — unrelated.
04A Policyfile.lock.json gives you…
Correct — closes the reproducibility gap of roles + Berkshelf resolving newer versions.
Incorrect — Chef is agent-pull, not SSH; unrelated.
Incorrect — not what it does.
Incorrect — that is data bags/Vault.
05Setting ssl_verify_mode :verify_none on a node is dangerous because…
Incorrect — the risk is security, not speed.
Correct — keep :verify_peer; fix cert trust properly instead.
Incorrect — unrelated.
Incorrect — never use it in prod.
5 questions · explanations appear as you answer