Chef Principles Certification (CP101) — Questions and Answers
Question 1: When troubleshooting network design & administration issues in Chef DevOps, what is the BEST approach?
- Escalating immediately without initial investigation
- Making multiple changes simultaneously to save time
- Systematic diagnosis starting with the most likely causes and documenting steps (Correct answer)
- Restarting systems without investigating the root cause
Correct answer: Systematic diagnosis starting with the most likely causes and documenting steps
Systematic diagnosis with documentation ensures efficient problem resolution and prevents recurrence by addressing root causes.
Question 2: What is the purpose of `kitchen verify` in the Test Kitchen lifecycle?
- Upload the cookbook to Chef Server
- Create the virtual machine
- Run InSpec or Serverspec tests against the converged instance (Correct answer)
- Apply cookbook recipes to the instance
Correct answer: Run InSpec or Serverspec tests against the converged instance
`kitchen verify` executes the defined test suite (InSpec, Serverspec, etc.) against a converged Test Kitchen instance to assert the desired state was achieved.
Question 3: Which action BEST demonstrates a commitment to compliance & governance in Chef DevOps?
- Maintaining current knowledge of all applicable regulations and standards (Correct answer)
- Relying on colleagues to interpret regulatory requirements
- Following only the regulations that are convenient
- Addressing compliance issues only when audited
Correct answer: Maintaining current knowledge of all applicable regulations and standards
Actively maintaining current knowledge of applicable regulations demonstrates genuine commitment to compliance and helps prevent violations.
Question 4: In a CI/CD pipeline for Chef cookbooks, which stage typically runs first?
- Lint checks and ChefSpec unit tests (Correct answer)
- Upload cookbook to Chef Server
- Test Kitchen integration tests
- Deploy cookbook to production nodes
Correct answer: Lint checks and ChefSpec unit tests
Linting (Cookstyle) and unit tests (ChefSpec) run first in a Chef CI pipeline because they are fast, cheap, and catch most issues before spinning up real instances.
Question 5: How does `knife cookbook create` differ from `chef generate cookbook`?
- They produce identical output
- knife creates an older legacy structure without modern Test Kitchen integration (Correct answer)
- knife includes more test boilerplate than chef generate
- chef generate creates simpler cookbooks with fewer files
Correct answer: knife creates an older legacy structure without modern Test Kitchen integration
`knife cookbook create` generates the older legacy cookbook structure, while `chef generate cookbook` produces the modern ChefDK-compatible structure with Test Kitchen.
Question 6: In Chef DevOps, what is the MOST appropriate response when a potential compliance violation is discovered?
- Report it immediately through established channels and document findings (Correct answer)
- Address it only if a supervisor specifically asks about it
- Wait to see if the violation causes harm before reporting
- Discuss it informally without documentation
Correct answer: Report it immediately through established channels and document findings
Immediate reporting through established channels with proper documentation ensures timely resolution and maintains the integrity of the compliance program.
Question 7: Which command in Chef Workstation generates a new cookbook skeleton with the recommended directory structure?
- berkshelf init <name>
- knife cookbook create <name>
- chef init cookbook <name>
- chef generate cookbook <name> (Correct answer)
Correct answer: chef generate cookbook <name>
`chef generate cookbook <name>` is the modern Chef Workstation command that creates a cookbook with the correct directory layout, metadata.rb, and test files.
Question 8: What is a Test Kitchen 'suite' used for in .kitchen.yml?
- Managing encrypted cookbook versions
- Grouping test configurations with specific attributes or run lists (Correct answer)
- Storing data bag items for testing
- Defining cloud provider credentials
Correct answer: Grouping test configurations with specific attributes or run lists
A Test Kitchen suite groups a set of test configurations together, enabling different attribute sets or run lists to be tested against the same platform.
Question 9: Which element is ESSENTIAL for an effective compliance & governance program in Chef DevOps?
- Compliance responsibility assigned to one individual only
- Annual review without interim checks
- Documentation stored without regular updates
- Regular audits and continuous monitoring processes (Correct answer)
Correct answer: Regular audits and continuous monitoring processes
Regular audits and continuous monitoring enable early detection of compliance gaps and ensure ongoing adherence to standards.
Question 10: What is the MOST effective way to stay current with developments in automation & scripting for Chef DevOps?
- Following a single expert opinions
- Relying on experience gained early in career
- Participating in professional development, industry events, and peer collaboration (Correct answer)
- Reading only internal communications
Correct answer: Participating in professional development, industry events, and peer collaboration
A multi-faceted approach including formal development, industry events, and peer collaboration provides the broadest perspective on current developments.
Question 11: In Chef DevOps, how does implementation & configuration contribute to professional credibility?
- By using impressive terminology
- By demonstrating competence, maintaining standards, and delivering consistent results (Correct answer)
- By avoiding challenging situations
- Through the number of years in practice alone
Correct answer: By demonstrating competence, maintaining standards, and delivering consistent results
Professional credibility is built through demonstrated competence, consistent adherence to standards, and reliable delivery of quality results.
Question 12: What is the PRIMARY objective of compliance & governance in the Chef DevOps field?
- To create additional paperwork for professionals
- To increase operational costs for organizations
- To limit the scope of professional practice
- To ensure adherence to established standards and protect stakeholders (Correct answer)
Correct answer: To ensure adherence to established standards and protect stakeholders
The primary objective of compliance and regulatory frameworks is to ensure adherence to standards that protect stakeholders.
Question 13: What does InSpec provide in a Chef DevOps workflow?
- Compliance-as-code testing (Correct answer)
- Recipe compilation
- Cookbook dependency management
- Node bootstrapping
Correct answer: Compliance-as-code testing
InSpec provides compliance-as-code testing, enabling teams to write human-readable tests that verify infrastructure meets security and compliance requirements.
Question 14: Which metric BEST indicates successful data management & integration in Chef DevOps?
- Volume of emails sent
- Number of meetings held per week
- Achievement of defined key performance indicators and stakeholder satisfaction (Correct answer)
- Hours worked by team members
Correct answer: Achievement of defined key performance indicators and stakeholder satisfaction
KPI achievement and stakeholder satisfaction directly measure whether management activities are producing desired outcomes.
Question 15: In InSpec, what does a `describe file('/etc/passwd')` block test?
- Existence and properties of the file on the target system (Correct answer)
- Chef cookbook file resource syntax
- User login credentials stored in the file
- Network file share permissions
Correct answer: Existence and properties of the file on the target system
The InSpec `file` resource block tests a file's existence, permissions, ownership, and content on the actual target system.
Question 16: What is the MOST important skill for effective project planning & deployment in Chef DevOps?
- Clear communication and the ability to align team efforts with objectives (Correct answer)
- Avoiding conflict at all costs
- Technical expertise alone without people skills
- Maintaining strict authority over all decisions
Correct answer: Clear communication and the ability to align team efforts with objectives
Clear communication is essential for aligning team efforts, building consensus, and ensuring everyone understands and works toward shared objectives.
Question 17: Which competency is MOST essential for professionals working in automation & scripting in Chef DevOps?
- Memorization of procedures without understanding principles
- Critical thinking combined with practical application of knowledge (Correct answer)
- Seniority-based decision making
- Speed of task completion above all else
Correct answer: Critical thinking combined with practical application of knowledge
Critical thinking allows professionals to apply knowledge effectively in varied situations, leading to better outcomes than rote procedures.
Question 18: Which InSpec resource would you use to assert that a system service is running?
- file
- service (Correct answer)
- package
- port
Correct answer: service
The InSpec `service` resource tests whether a system service is installed, enabled, and currently running.
Question 19: What does the `notifies` method do when used in a Chef resource definition?
- It broadcasts a resource state change event to all nodes in the Chef environment
- It logs a Chef Server notification when the resource successfully converges
- It triggers a specified action on another resource when the current resource is updated (Correct answer)
- It sends an email alert to operators when the resource changes state on the node
Correct answer: It triggers a specified action on another resource when the current resource is updated
`notifies :action, 'resource[name]', :timing` queues an action on the target resource whenever the notifying resource makes a change during convergence.
Question 20: How does ongoing professional development support compliance & governance in Chef DevOps?
- It only benefits entry-level professionals
- It is irrelevant to compliance outcomes
- It replaces the need for formal compliance audits
- It keeps professionals informed of evolving standards and best practices (Correct answer)
Correct answer: It keeps professionals informed of evolving standards and best practices
Ongoing professional development ensures that practitioners stay current with evolving regulations, standards, and best practices in their field.
Question 21: Which Cookstyle command checks a cookbook for style violations without auto-correcting them?
- cookstyle --check
- cookstyle (no flags) (Correct answer)
- cookstyle --dry-run
- cookstyle --lint
Correct answer: cookstyle (no flags)
Running `cookstyle` without flags checks for style violations and reports them; use `cookstyle -a` to auto-correct fixable offenses.
Question 22: In a GitOps workflow with Chef, what ultimately causes managed nodes to apply updated cookbooks?
- A Git push triggers the CI/CD pipeline which updates policies, and nodes pull changes on their next client run (Correct answer)
- A cron job on the Chef Server that pushes to nodes
- Manual knife ssh command to each node
- Direct SSH access to each node to run chef-client manually
Correct answer: A Git push triggers the CI/CD pipeline which updates policies, and nodes pull changes on their next client run
In a GitOps Chef workflow, a Git push triggers the pipeline to test and upload cookbooks/policies, and nodes then apply those updates automatically on their scheduled chef-client runs.
Question 23: What is the PRIMARY benefit of standardizing system architecture & design practices in Chef DevOps?
- Increasing dependency on specific vendors
- Limiting innovation and creativity
- Consistency, easier maintenance, and improved collaboration among team members (Correct answer)
- Reducing the number of tools available
Correct answer: Consistency, easier maintenance, and improved collaboration among team members
Standardization promotes consistency across the organization, simplifies maintenance, and enables better collaboration between team members.
Question 24: What is the PRIMARY objective of implementation & configuration within the Chef DevOps profession?
- To limit the scope of professional activities
- To create additional requirements for practitioners
- To ensure quality outcomes through standardized practices and continuous improvement (Correct answer)
- To maintain the status quo without change
Correct answer: To ensure quality outcomes through standardized practices and continuous improvement
The primary objective is ensuring quality outcomes through established standards while continuously improving practices and processes.
Question 25: What is the Chef 'wrapper cookbook' pattern?
- A cookbook that depends on a community cookbook and overrides its attributes to customize behavior (Correct answer)
- A cookbook that provides a REST API interface for Chef resource management
- A cookbook that archives and distributes another cookbook as a compressed artifact
- A cookbook that wraps multiple cookbook recipes into a single entry-point recipe
Correct answer: A cookbook that depends on a community cookbook and overrides its attributes to customize behavior
The wrapper cookbook pattern creates a thin cookbook that sets attributes and calls recipes from a community cookbook, keeping customizations separate from upstream code.
Question 26: What is the PRIMARY objective of security & access control within the Chef DevOps profession?
- To maintain the status quo without change
- To ensure quality outcomes through standardized practices and continuous improvement (Correct answer)
- To limit the scope of professional activities
- To create additional requirements for practitioners
Correct answer: To ensure quality outcomes through standardized practices and continuous improvement
The primary objective is ensuring quality outcomes through established standards while continuously improving practices and processes.
Question 27: What is the MOST effective way to stay current with developments in security & access control for Chef DevOps?
- Relying on experience gained early in career
- Participating in professional development, industry events, and peer collaboration (Correct answer)
- Reading only internal communications
- Following a single expert opinions
Correct answer: Participating in professional development, industry events, and peer collaboration
A multi-faceted approach including formal development, industry events, and peer collaboration provides the broadest perspective on current developments.
Question 28: In Chef DevOps, how does automation & scripting contribute to professional credibility?
- By avoiding challenging situations
- By using impressive terminology
- Through the number of years in practice alone
- By demonstrating competence, maintaining standards, and delivering consistent results (Correct answer)
Correct answer: By demonstrating competence, maintaining standards, and delivering consistent results
Professional credibility is built through demonstrated competence, consistent adherence to standards, and reliable delivery of quality results.
Question 29: What is the MOST effective way to stay current with developments in implementation & configuration for Chef DevOps?
- Relying on experience gained early in career
- Following a single expert opinions
- Participating in professional development, industry events, and peer collaboration (Correct answer)
- Reading only internal communications
Correct answer: Participating in professional development, industry events, and peer collaboration
A multi-faceted approach including formal development, industry events, and peer collaboration provides the broadest perspective on current developments.
Question 30: Which tool replaced Foodcritic as the primary Chef cookbook linter?
- Cookstyle (Correct answer)
- RuboCop
- ChefSpec
- InSpec
Correct answer: Cookstyle
Cookstyle replaced Foodcritic as the primary cookbook linter, built on RuboCop with Chef-specific cops maintained by Chef Software.
Question 31: What is the BEST approach to documentation & best practices standardization in Chef DevOps?
- Standardizing only external-facing documents
- Using whatever format is most convenient at the time
- Implementing consistent formats, terminology, and processes across the organization (Correct answer)
- Allowing each department to create its own standards
Correct answer: Implementing consistent formats, terminology, and processes across the organization
Organization-wide consistency in formats, terminology, and processes ensures data can be shared, compared, and analyzed effectively.
Question 32: What is the PRIMARY objective of automation & scripting within the Chef DevOps profession?
- To limit the scope of professional activities
- To create additional requirements for practitioners
- To ensure quality outcomes through standardized practices and continuous improvement (Correct answer)
- To maintain the status quo without change
Correct answer: To ensure quality outcomes through standardized practices and continuous improvement
The primary objective is ensuring quality outcomes through established standards while continuously improving practices and processes.
Question 33: What is the PRIMARY benefit of standardizing network design & administration practices in Chef DevOps?
- Increasing dependency on specific vendors
- Reducing the number of tools available
- Limiting innovation and creativity
- Consistency, easier maintenance, and improved collaboration among team members (Correct answer)
Correct answer: Consistency, easier maintenance, and improved collaboration among team members
Standardization promotes consistency across the organization, simplifies maintenance, and enables better collaboration between team members.
Question 34: When facing an unfamiliar challenge in automation & scripting within Chef DevOps, what is the BEST approach?
- Attempt to resolve it independently without consultation
- Avoid the challenge if possible
- Research established best practices, consult colleagues, and document the approach (Correct answer)
- Apply the most familiar technique regardless of suitability
Correct answer: Research established best practices, consult colleagues, and document the approach
Researching best practices and consulting colleagues combines established knowledge with practical experience, while documentation supports future reference.
Question 35: What does a passing ChefSpec test confirm about your cookbook?
- InSpec compliance controls all passed
- The cookbook was successfully uploaded to Chef Server
- Chef resources would be declared and executed correctly during a run (Correct answer)
- The node converged successfully in a production environment
Correct answer: Chef resources would be declared and executed correctly during a run
Passing ChefSpec tests confirm that the cookbook's Chef resources would be declared with correct parameters during a simulated Chef run.
Question 36: Which factor BEST indicates mastery of automation & scripting in Chef DevOps?
- The ability to adapt knowledge and skills to varying contexts while maintaining standards (Correct answer)
- Speed of task completion
- Years of experience in a single setting
- Number of certifications held
Correct answer: The ability to adapt knowledge and skills to varying contexts while maintaining standards
True mastery is demonstrated by the ability to apply knowledge flexibly across different contexts while consistently maintaining quality standards.
Question 37: What consequence can result from failing to maintain proper compliance & governance standards in Chef DevOps?
- Reduced workload for staff
- Lower training requirements
- Loss of certification, legal penalties, and reputational damage (Correct answer)
- Increased customer satisfaction
Correct answer: Loss of certification, legal penalties, and reputational damage
Non-compliance can result in serious consequences including certification revocation, legal penalties, fines, and significant reputational damage.
Question 38: What does `kitchen destroy` do in the Test Kitchen workflow?
- Deletes the cookbook source files
- Removes local test result files
- Uninstalls Test Kitchen from the workstation
- Tears down and removes the test instance (Correct answer)
Correct answer: Tears down and removes the test instance
`kitchen destroy` tears down and removes the provisioned test instance (e.g., Vagrant VM or Docker container) to free resources.
Question 39: What is the role of data in performance monitoring & optimization programs for Chef DevOps?
- Data is collected but rarely analyzed
- Data provides objective evidence for decision-making and measuring progress (Correct answer)
- Data complicates the improvement process
- Data is only needed for external reporting
Correct answer: Data provides objective evidence for decision-making and measuring progress
Data provides the objective evidence needed to make informed decisions, track progress, and validate the effectiveness of improvements.
Question 40: What does `berks upload` do after dependencies have been installed locally?
- Runs Berkshelf integration tests
- Installs cookbook dependencies to the local cache
- Uploads all resolved cookbooks from the local cache to Chef Server (Correct answer)
- Creates a Berksfile.lock file
Correct answer: Uploads all resolved cookbooks from the local cache to Chef Server
`berks upload` takes the locally cached cookbooks resolved by Berkshelf and uploads them and their dependencies to the Chef Server.
Question 41: Which factor BEST indicates mastery of troubleshooting & problem resolution in Chef DevOps?
- Years of experience in a single setting
- Number of certifications held
- The ability to adapt knowledge and skills to varying contexts while maintaining standards (Correct answer)
- Speed of task completion
Correct answer: The ability to adapt knowledge and skills to varying contexts while maintaining standards
True mastery is demonstrated by the ability to apply knowledge flexibly across different contexts while consistently maintaining quality standards.
Question 42: What is the PRIMARY objective of cloud infrastructure & services within the Chef DevOps profession?
- To create additional requirements for practitioners
- To ensure quality outcomes through standardized practices and continuous improvement (Correct answer)
- To limit the scope of professional activities
- To maintain the status quo without change
Correct answer: To ensure quality outcomes through standardized practices and continuous improvement
The primary objective is ensuring quality outcomes through established standards while continuously improving practices and processes.
Question 43: What is Berkshelf used for in Chef cookbook development?
- Running integration tests
- Bootstrapping nodes
- Managing and resolving cookbook dependencies (Correct answer)
- Encrypting data bags
Correct answer: Managing and resolving cookbook dependencies
Berkshelf is Chef's cookbook dependency manager that resolves, downloads, and caches required cookbooks and their transitive dependencies.
Question 44: What is the default Test Kitchen driver used for local cookbook testing?
- Vagrant (Correct answer)
- Docker
- AWS EC2
- Hyper-V
Correct answer: Vagrant
Vagrant is Test Kitchen's default driver, using virtual machines (typically with VirtualBox) to create isolated local test instances.
Question 45: When facing an unfamiliar challenge in troubleshooting & problem resolution within Chef DevOps, what is the BEST approach?
- Apply the most familiar technique regardless of suitability
- Avoid the challenge if possible
- Attempt to resolve it independently without consultation
- Research established best practices, consult colleagues, and document the approach (Correct answer)
Correct answer: Research established best practices, consult colleagues, and document the approach
Researching best practices and consulting colleagues combines established knowledge with practical experience, while documentation supports future reference.
Question 46: What is the purpose of Foodcritic in Chef cookbook development?
- Running integration tests
- Bootstrapping nodes
- Linting Chef cookbooks for style and correctness issues (Correct answer)
- Managing cookbook versions
Correct answer: Linting Chef cookbooks for style and correctness issues
Foodcritic is a linting tool that analyzes Chef cookbooks against defined rules to catch common mistakes and style violations.
Question 47: How should system architecture & design upgrades be managed in a Chef DevOps environment?
- Only during business hours for maximum visibility
- By implementing changes immediately without testing
- By upgrading all systems simultaneously without staging
- Through a structured change management process with testing and rollback plans (Correct answer)
Correct answer: Through a structured change management process with testing and rollback plans
A structured change management process with testing and rollback plans minimizes risk and ensures upgrades do not disrupt operations.
Question 48: How often should performance monitoring & optimization metrics be reviewed in Chef DevOps?
- Regularly at defined intervals with additional reviews triggered by significant events (Correct answer)
- Only during annual performance reviews
- When problems are reported
- When external audits are scheduled
Correct answer: Regularly at defined intervals with additional reviews triggered by significant events
Regular scheduled reviews ensure ongoing monitoring while event-triggered reviews capture the impact of significant changes.
Question 49: What is the role of the `.chef/knife.rb` configuration file?
- Storing cookbook recipes for knife to run
- Managing semantic version constraints for cookbooks
- Configuring the knife CLI with Chef Server URL, key paths, and connection settings (Correct answer)
- Defining default node attributes for all environments
Correct answer: Configuring the knife CLI with Chef Server URL, key paths, and connection settings
The `.chef/knife.rb` file configures the knife CLI tool with the Chef Server URL, client name, validation key path, and other connection parameters.
Question 50: What Chef community tool automates cookbook version bumping, Git tagging, and Supermarket publishing?
- chef
- berkshelf
- stove (Correct answer)
- knife
Correct answer: stove
Stove is the Chef cookbook release tool that automates bumping the version in metadata.rb, creating a Git tag, and publishing to the Chef Supermarket.
Chef Principles Certification (CP101)
The Chef Principles Certification validates knowledge of Chef DevOps automation tools including Chef Infra, Chef InSpec, Chef Habitat, and Chef Automate, covering configuration management, compliance automation, and DevOps pipeline practices.
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds