Skip to main content
  1. Posts/

Chef Zero, Cookbooks and Data Bags locations

··339 words·2 mins·
DevOps Chef

I like chef-zero a lot. There’s so much overlap between chef’s products: chef-zero, chef-solo, chef-apply - yes, each have their own uses, but I digress. Chef-zero has been relatively pain-free for me - except when I tried to get it running - trying to figure out why it wasn’t fetching the cookbooks was so annoying! I went and RTFM couple of times, no dice. Then I decided to not skim read and read the entire thing.

chef-zero is a very lightweight Chef server that runs in-memory on the local machine. This allows the chef-client to be run against the chef-repo as if it were running against the Chef server. chef-zero was originally a standalone tool{.reference.external}; it is enabled from within the chef-client by using the –local-mode option

Local mode does not require a configuration file, instead it will look for a directory named /cookbooks and will set chef_repo_path to be just above that. (Local mode will honor the settings in a configuration file, if desired.) If the client.rb file is not found and no configuration file is specified, local mode will search for a knife.rb file.)

Sometimes skim reading and Ctrl+F doesn’t really go in your way. Especially if what you’re searching for and what’s referred to are nowhere close to each other. Back to topic again - for a new recipe I was working on, I needed to use databags. No problem. Wanted to do some ad-hoc checks and verification before going the Test Kitchen way. No problem. Wrote the code, then it dawned me. How and where the heck do I upload the databags to? After couple of unsuccessful converge runs, mainly because of 404 when databags were being fetched, I realized that databags were not being fetched. After some searching, I found that the databags need to be in the root directory of where you’re starting your chef-zero run. And in a directory called data_bags. Not databags. Sigh. Just a pro tip.

Also, bonus video: See how chef-zero came alive during a black friday line.

https://www.youtube.com/watch?v=bUYjX1SNUh8

 

Sathyajith Bhat
Author
Sathyajith Bhat
Author, AWS Container Hero and DevOps Specialist.

Related

DevOps Diaries: When Terminator terminates your MySQL imports onto an AWS Instance…
··627 words·3 mins
DevOps Aws
I have begun to use Terminator quite a lot. Terminator’s quite handy when you want to connect to multiple servers on a single terminal thanks to its split pane feature. (And yes I know about tmux & screen - I have screen on my servers, don’t want to get into the headache that is nested screen panes). Few days back we were preparing for a big migration & deploy and I was tasked upon to prepare a failover just in case the migration goes wrong.
Bash bashings..
··131 words·1 min
Tips & How-To's Bash Linux Popd Pushd
Since my new job involves lot more of Linux, shell scripting bash and automation, I’ve been trying to brush up my Linux skills. Ran into this “problem” today where there’s an init script which handles unicorn start/stop/reload and we were debugging some kinks around this. The init script had a chain of cd to the directory and the unicorn invoke script. Was trying to figure out why unicorn wasn’t starting up, till I read a bit more and dropped to using echo to understand what’s happening
Review of Supergiant Games’ Transistor
··837 words·4 mins
Gaming Games Reviews
Transistor is the second game made by Supergiant Games following up on their previous game, Bastion. Bastion didn’t hold my attention long enough so I really can’t say much about it, except at first glance, Bastion seemed to have great artwork and music. Story # Transistor follows the story of Red, a singer in a city called Cloudbank who gets nearly killed. She manages to escape and acquires the Transistor - a sword-like weapon.