Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

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 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 a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at <a href="https://www.cotocus.com/">Cotocus</a>. I share tech blog at <a href="https://www.devopsschool.com/">DevOps School</a>, travel stories at <a href="https://www.holidaylandmark.com/">Holiday Landmark</a>, stock market tips at <a href="https://www.stocksmantra.in/">Stocks Mantra</a>, health and fitness guidance at <a href="https://www.mymedicplus.com/">My Medic Plus</a>, product reviews at <a href="https://www.truereviewnow.com/">TrueReviewNow</a> , and SEO strategies at <a href="https://www.wizbrand.com/">Wizbrand.</a> Do you want to learn <a href="https://www.quantumuting.com/">Quantum Computing</a>? <strong>Please find my social handles as below;</strong> <a href="https://www.rajeshkumar.xyz/">Rajesh Kumar Personal Website</a> <a href="https://www.youtube.com/TheDevOpsSchool">Rajesh Kumar at YOUTUBE</a> <a href="https://www.instagram.com/rajeshkumarin">Rajesh Kumar at INSTAGRAM</a> <a href="https://x.com/RajeshKumarIn">Rajesh Kumar at X</a> <a href="https://www.facebook.com/RajeshKumarLog">Rajesh Kumar at FACEBOOK</a> <a href="https://www.linkedin.com/in/rajeshkumarin/">Rajesh Kumar at LINKEDIN</a> <a href="https://www.wizbrand.com/rajeshkumar">Rajesh Kumar at WIZBRAND</a> <a href="https://www.rajeshkumar.xyz/dailylogs">Rajesh Kumar DailyLogs</a>

Related Posts

What is Chef and use cases of Chef?

What is Chef? Chef is a powerful configuration management and automation tool that allows organizations to manage and automate the deployment, configuration, and maintenance of infrastructure. It…

Read More

What is Chef Compliance and use cases of Chef Compliance?

What is Chef Compliance? Chef Compliance is a component of Chef, an automation platform used for configuration management, application deployment, and infrastructure as code (IaC). Chef Compliance…

Read More

Chef Tutorials: Test Kitchen – Example of kitchen.yml on AWS Ec2

Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at…

Read More

Chef Tutorials: Test Kitchen – Example of kitchen.yml using vagrant

Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked at Cotocus. I share tech blog at DevOps School, travel stories at…

Read More

Chef Tutorials: Test Kitchen – Example of kitchen.yml using vagrant on ubuntu

Example of .kitchen.yml for driver_plugin vagrant with ubuntu for Chef Test Kitchen Rajesh Kumar I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I have worked…

Read More

Chef Tutorials: Test Kitchen – Example of kitchen.yml with VAGRANT and VirtualBox

How to test Chef recipes/cookbooks on your workstation with VAGRANT and VirtualBox using Test Kitchen Install Test Kitchen, VAGRANT and VirtualBox: Chef Test Kitchen: Test Kitchen is…

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