A Practical Guide to Continuous Delivery by Eberhard Wolff
Automation through Chef Opscode: A Hands-on Approach to Chef by Navin Sabharwal and Manak Wadhwa
Chef Essentials by John Ewart
Chef Cookbook – Third Edition by Matthias Marschall
Chef Infrastructure Automation Cookbook – Second Edition by Matthias Marschall
Chef Server on AWS (AWS Quick Start) by AWS Whitepapers and Amazon Web Services
Configuration Management with Chef-Solo by Naveed ur Rahman
Customizing Chef: Getting the Most Out of Your Infrastructure Automation by Jon Cowie
Exploration of Chef: Fast And Easy Learning!
Problem scenario
You are trying to create an organization using the chef-server-ctl org-create command. But you get an error that the “name” entered was invalid. For example, you run this:
sudo chef-server-ctl org-create ContInt “ContinualIntegration” –association_user contintuser –filename /bin/good.pem
But you get this:
ERROR: The data in your request was invalid
Response: Field ‘name’ invalid
What should you do?
Solution
For the “shortname” that is immediately after the “org-create” command,
Problem scenario
You have Linux servers that need Apache web server installed on them. How do you write a Chef recipe to deploy Apache web server?
Solution
Prerequisite
This solution requires that the Chef server must have access to GitHub. If you want to install Chef server, see this posting. If you want to install Chef client, see this posting.
Problem scenario
You try to run a knife command but you get 404 not found. What should you do?
Solution
Run this command: knife client list
If you get a 404 error with this command, then look at your client.rb file. Is the chef_server_url correct? Is the hostname actually the Chef server or is it something else? Is the “organizations/companynickname” present and correctly typed?
Problem scenario
You are running a Linux server, and you installed Chef. How do you find out what version is installed?
Solution
Run this command:
sudo cat /opt/opscode/version-manifest.txt
Problem scenario
You are running Ubuntu 16.04 Linux. You tried to follow the directions for installing the Chef development kit on these two sites: GitHub and Chef.io. But they do not work. What should you do?
Solution
Follow these steps:
1. Change directories to the home directory (e.g., /home/ubuntu or /root/) of the user are logged in as.
Problem scenario
You have Linux servers that need Java 1.8 installed on them. How do you write a Chef recipe to deploy Java?
Solution
Prerequisite
This solution requires that the Chef server must have access to GitHub. If you want to install Chef server, see this posting. If you want to install Chef client, see this posting.
Problem scenario
You have installed Chef on Ubuntu. You run this command:
sudo knife client list
You expect to see a list of Chef client nodes. But you see an error like this:
“ERROR: You authenticated successfully to https://<FQDN of Chef Server>/organizations/companynickname as <FQDN of Chef client node> but you are not authorized for this action
Response: missing read permission”
What do you do?
Problem scenario
You are trying to use Chef’s knife command. Every time you try to regenerate a key or delete a user, you get an error like this:
“ERROR: Failed to authenticate to https://continualintegration.com/organizations/contintnickname as contint with key /home/ec2-user/.chef/contint.pem
Response: Invalid signature for user or client ‘contint'”
What do you do?
Solution
1. Log into the GUI for Chef Manage.
Problem scenario
You have a desired configuration that you want implemented with Chef. You want a command to execute and a file to transfer via a Chef recipe or cookbook. You have installed Chef server on one server (see this posting if you want to do this) and Chef client on another (see this posting for installing Chef client). You want to use Chef for the first time doing something as an example.