Set up your computer Display the file extensions In Windows 10 Open File Explorer On the View tab select File name extensions Hidden items In Windows 7 Open Windows Explorer and select Organize Select Folder and search options On the View tab Select Show hidden files, folders, and drives Uncheck Hide extensions for known file …
Category Archives: Chef
`block in filter_instances’: undefined method `empty?’ for nil:NilClass (NoMethodError)
When you try to execute any of the “kitchen” commands in Chef Test Kitchen you may get the following error message. lib/kitchen/config.rb:182:in `block in filter_instances’: undefined method `empty?’ for nil:NilClass (NoMethodError) This happened in my cookbook, when I have removed the value from the “excludes:” option in the .kitchen.yml file, but left the “excludes:” option …
Serialize SSH and RSA private keys to store them in a Chef Data Bag
To send RSA private keys to instances, store them in encrypted data bags. The data bag item is a JSON file that contains keys and values inline. Use base64 encoding Base64 encoding converts binary data to ASCII format to represent special characters, like line breaks as ASCII text. The result will be larger, 8 / …
Continue reading “Serialize SSH and RSA private keys to store them in a Chef Data Bag”
HTTP Request Returned 409 Conflict: Client already exists
The Chef server maintains the list of registered nodes and clients in its database. When you launch a new instance with Chef you may encounter the following error message: *** Input CHEF_CLIENT_NODE_NAME is undefined, using: IP-0AFE6965 … *** Starting chef-client *** Finished chef-client Printing Log … […] INFO: Client key C:\chef\client.pem is not present – …
Continue reading “HTTP Request Returned 409 Conflict: Client already exists”
DevOps Engineering part 5. – Create an enterprise cookbook
In this exercise we will create a Chef cookbook for a corporation. It will be robust and include all the necessary elements to be used in a large enterprise. If your company already has established standards, as you progress with this tutorial, copy the appropriate file from an existing cookbook. If this is the first …
Continue reading “DevOps Engineering part 5. – Create an enterprise cookbook”
DevOps Engineering part 4. – Connect to the Chef server
Find a Chef Server To work in a corporate environment, your organization needs access to a Chef server. To learn Chef and test your cookbooks for free, you can create an account on the “hosted” Chef server, maintained by the Chef company. The plan allows five nodes at a time, so you can even launch a small …
Continue reading “DevOps Engineering part 4. – Connect to the Chef server”
Last characters of a string in Ruby
To get the last characters of a string in Ruby, use the following instructions. If the string is shorter than the selected number of characters, the entire string is returned. a = ‘12345’ b = a[-3..-1] || a puts b Returns 345
DevOps Engineering part 3. – Working with AWS
Personalize your workstation Set up your account in the AWS console If you are not an AWS account administrator, ask your AWS account administrator to do the following for you Create an account in AWS Add the account to the appropriate user group Generate a password with a request to change it at the first login Generate an AWS Access …
Continue reading “DevOps Engineering part 3. – Working with AWS”
Remove Policyfile.rb from your Chef cookbook
When you test your cookbook in Chef Test Kitchen and get the following error, delete the “Policyfile.rb” from your Chef cookbook directory. $$$$$$ You must set your run_list in your policyfile instead of kitchen config. The run_list your config will be ignored. $$$$$$ Ignored run_list: [“recipe[…::…]”] Preparing dna.json Exporting cookbook dependencies from Policyfile /tmp/… Error: Invalid …
Continue reading “Remove Policyfile.rb from your Chef cookbook”
Chef Data Bags
Create an encrypted Chef data bag There are secrets in most of the Chef cookbooks that we want to protect. We don’t want to give out user names, passwords and AWS keys. In Chef the best place to hide these secrets is the Encrypted Data Bag. A Data Bag is a JSON file that we can …