You shouldn't do this kata until you've mastered the Basic Chef Fluency Kata.
- Create a new chef_repo with a connection to a new manage.chef.io Organization
- Create a Chef Server in Azure using a wrapper cookbook to the chef-server cookbook
- Use kitchen-dokken as a driver
- This should be built using an ARM template to create and bootstrap, using a manage.chef.io account. Once you create the ARM template the first time, clone it in all future kata runs.
- Create a Private Chef Supermarket in Azure using a wrapper cookbook to the supermarket-omnibus-cookbook. See also Irving's post for help.
- Continue to use
kitchen-dokkenwhen testing the cookbook - Create another ARM template for creating and bootstrapping this in Azure, using your manage.chef.io account.
- Continue to use
- In the private Chef Server, log in as the administrator and add a new Organization
- Log in as a user and request an invitation to an Organization
- Log in as the administrator and grant the invitation
- Log in as a user and access the organization. Set up a new connection to this chef server
You can rebuild the above implementation with an ARM template.c
For all cookbooks below, follow these rules:
- Run
foodcriticbefore every checkin - Run
rubocopbefore every checkin (and autocorrect with it when you have issues; also know the difference betweenrubocopandcookstyle) - Run Delivery Local Lint to automate
foodcriticandrubocopruns - Ensure that kitchen runs (with Delivery Local as well)
- Use
dokkenrunner to speed up your kitchen runs
- Ensure that all recipes created have
# Authored by: [Your Name]at the top of the recipe (using achef generatetemplate) - Create a
platformcookbook on version0.1.0 - Add a
platformcustom resource that installsnanoandcurlpackages calledbase_utilities - Test the
platformcustom resource with an embedded test-only cookbook and recipe - Upload
platformto your private supermarket - Create a
websitecookbook on version0.1.0 - Write a ChefSpec test that ensures
nanoandcurlpackages are installed by yourdefaultrecipe - In the
defaultrecipe, ensure that the base utilities are installed - Write an inspec test, test it with test kitchen
- Using your private supermarket, upload
websiteandplatformto the Chef Server, converge a node withknife bootstrapand run your inspec profile to test that it converged properly - Freeze the version of the cookbook so it doesn't accidentally get written over
- In the platform cookbook add an action to
base_utilitiesthat would remove those packages - Keep the original action as the default
- Use
knife sporkto increment the version to0.1.1 - Upload the new version of the
platformto the supermarket - Add a
rollbackrecipe towebsitethat would remove it - Test the
rollbackrecipe in another kitchen suite - Increment the
websiteversion to0.2.0(withknife spork) - Upload to the chef server with frozen version, reconverge machine and see that nothing changed
- Roll back the website by changing the run list of your node to the new recipe, converging again, and see the packages removed
- Include the
chef-clientrecipe in yourdefaultrecipe and make chef run every 30 minutes. Override the chef-client attributes in the recipe itself. - Have berks get the
chef-clientrecipe from GitHub (it won't be on your private supermarket) - Ignore
foodcriticruleFC002in your entireplatformcookbook - Ignore
foodcriticruleFC002in just yourrollbackrecipe - Change the max line length for rubocop to
500for your entireplatformcookbook - Change kitchen to use
vagrantandvirtualboxfor yourwebsitecookbook and ensure thatcentosandubuntuare tested platforms - Your
defaultrecipe should installchocolateyand thennotepad++chocolatey package if it is a windows node (update the underlying resource). Test this on Windows 2016. - Update your ChefSpec test to work with windows as well
- Write a file out to your file cache directory that has a completely different format if
centos,ubuntu, orwindowsbut writes the same variable data out from an attribute - Create another recipe
securitythat will write out a security-related attribute to that same file (see partial template) - Write out a list of names of five people you admire to this file as well
- Write a file out to the file cache directory named
memory.txt. If the memory on the node is greater than 8GB, write out "this machine has lots of memory", otherwise write out "this machine doesn't have a lot of memory" - Save the computer's password to the Chef Server using chef-vault. You should still be able to test this with kitchen using the data bag fallback.
- View this password with
knife vault showcommand - Write this password out in clear text to
password.txtin your file cache directory - Write all nodes that are running
ubuntuto a fileubuntu_nodes.txtin the file cache directory (usingsearch). Make sure this doesn't break your kitchen runs - On ubuntu nodes only, run
lsb_release -rand write the results to a file, without using the execute resource. See https://docs.chef.io/ruby.html#shelling-out - Extract the contents of the
defaultandrollbackrecipes intowebsite_installedresource with two actions
- Create a kitchen run with
shellprovisioner andbussertest that will installnanoand test that it's installed (using kitchen init)