MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Chef Tutorials: What is Chef Solo with example programs


How to deploy chef cookbooks without chef server? – Answer is – Chef Solo

What is Chef Solo?

chef-solo is a command that executes Chef Infra Client in a way that does not require the Chef Infra Server to converge cookbooks. chef-solo uses Chef Infra Clientโ€™s Chef local mode, and does not support the following functionality present in Chef Infra Client / server configurations:

Centralized distribution of cookbooks
A centralized API that interacts with and integrates infrastructure components
Authentication or authorization

How Chef solo Works?

Chef Solo flow: chef-solo runs solo.rb cookbook_path and solo.json run_list from /etc/chef/cookbooks, then converges

chef-solo supports two locations from which cookbooks can be run:

  • A local directory.
  • A URL at which a tar.gz archive is located.

Before running Chef-Solo on the local machine, one needs to install the following two files on the local machine.

  • Solo.rb โˆ’ This file tells Chef about where to find cookbooks, roles, and data bags.
  • Node.json โˆ’ This file sets the run list and any node-specific attribute, if required.

A small chef-solo example



ย 
Install chef
============
> curl -L https://www.opscode.com/chef/install.sh | bash
ย 
Check
=====
> chef-solo -v
ย 
Setup chef repository
=====================
> wget http://github.com/opscode/chef-repo/tarball/master
ย 
> tar zxvf master
ย 
> mv opscode-chef-repo-f9d4b0c/ chef-repo
ย 
>ls chef-repo/
ย 
Create .chef directory inside chef-repo
=======================================
> mkdir chef-repo/.chef
ย 
Setup a local cookbook path
===========================
ย 
> vi chef-repo/.chef/knife.rb
cookbook_path [ ‘/root/chef-repo/cookbooks’ ]
ย 
Create your first cookbook
==========================
ย 
> knife cookbook create ntp
ย 
Writing your first recipe
=========================
> vi chef-repo/cookbooks/ntp/recipes/default.rb
ย 
package ‘ntp’
ย 
Now configure your server using chef-solo
=========================================
> vi chef-repo/solo.rb
ย 
file_cache_path “/root/chef-solo”
cookbook_path “/root/chef-repo/cookbooks”
ย 
> vi node.json
ย 
{
“run_list”: [ “recipe[ntp]” ]
}
ย 
Ensure ntp is not installed
===========================
> yum remove -y ntp
ย 
Use chef-solo to configure your server
=====================================
ย 
> chef-solo -c chef-repo/solo.rb -j chef-repo/node.json
ย 
Confirm ntp is installed
========================
> yum info ntp
ย 

Reference

  • https://docs.chef.io/chef_solo/
  • https://www.devopsschool.com/blog/difference-between-chef-infra-server-vs-chef-zero-vs-chef-solo/
  • https://docs.chef.io/ctl_chef_solo/

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services โ€” all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Chef Training Roadmap for DevOps Engineers: Course Tracks, Lab Workflow, and Practical Commands

This guide turns a promotional Chef training post into a practical roadmap for engineers. Compare course levels, understand the learning workflow, and use hands-on commands you can run in a lab.

Read More

Provision an AWS EC2 Instance with Chef (Legacy ChefDK Workflow)

A practical, step-by-step walkthrough for provisioning an AWS EC2 VM using the classic ChefDK and chef-provisioning approach. Includes workflow, commands, recipe examples, and validation checks for legacy environments.

Read More

How to Install ChefDK on RHEL, Ubuntu, macOS, and Windows (Legacy-Friendly Guide)

Learn a practical, cross-platform process to install ChefDK and verify it correctly on RHEL/CentOS, Ubuntu, macOS, and Windows. This guide also helps you decide when ChefDK is still appropriate versus Chef Workstation.

Read More

Foodcritic for Chef Cookbooks: Practical Linting and Jenkins CI for Legacy Pipelines

Foodcritic helps you statically lint Chef cookbooks for style, correctness, and common anti-patterns before convergence fails in production. This guide shows how to run it locally, wire it into Jenkins, and enforce fail policies that teams will actually use.

Read More

Chef Command-Line Reference: Essential chef-solo, chef-client, and Knife Workflows

A task-oriented reference for frequently used Chef and Knife commands, from cookbook scaffolding to node bootstrap and run-list management. Includes workflow guidance and copy-ready command examples.

Read More

Chef Interview Q&A (Part 2): Resources, Run-Lists, Bootstrap, and Test Kitchen

A practical rewrite of classic Chef interview questions, focused on how Chef resources converge, how run-lists drive node configuration, and how to test cookbooks safely. Includes command examples, workflow diagrams, and comparison tables.

Read More
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
0
Would love your thoughts, please comment.x
()
x