Chef Internal – How Chef maintain the state of each resources internally?

chef-internal

Chef Client

A chef-client is an agent that runs locally on every node that is under management by Chef. The chef-client executable can be run as a daemon. When a chef-client is run, it will perform all of the steps that are required to bring the node into the expected state, including:

  • Registering and authenticating the node with the Chef server
  • Building the node object
  • Synchronizing cookbooks
  • Compiling the resource collection by loading each of the required cookbooks, including recipes, attributes, and all other dependencies
  • Taking the appropriate and required actions to configure the node
  • Looking for exceptions and notifications, handling each as required

RSA public key-pairs are used to authenticate the chef-client with the Chef server every time a chef-client needs access to data that is stored on the Chef server. This prevents any node from accessing data that it shouldn’t and it ensures that only nodes that are properly registered with the Chef server can be managed.

Ohai

 

Ohai is a tool that is used to collect system configuration data, which is provided to the chef-client for use within cookbooks. Ohai is run by the chef-client at the beginning of every Chef run to determine system state. Ohai includes many built-in plugins to detect common configuration details as well as a plugin model for writing custom plugins.

The types of attributes Ohai collects include but are not limited to:

  • Operating System
  • Network
  • Memory
  • Disk
  • CPU
  • Kernel
  • Host names
  • Fully qualified domain names
  • Virtualization
  • Cloud provider metadata

Attributes that are collected by Ohai are automatic level attributes, in that these attributes are used by the chef-client to ensure that these attributes remain unchanged after the chef-client is done configuring the node.

Ohai collects data for many platforms, including AIX, Darwin, Linux, FreeBSD, OpenBSD, NetBSD, Solaris, and any Microsoft Windows operating systems.

Reference
https://docs.chef.io/chef_client.html

Tagged : / / / / / /

Top Questions on Server Configuration Management Tools Chef, Puppet, and Ansible

 

server-configuration-management-tools-chef-puppet-and-ansible

Source – http://hub.scalr.com/blog/top-questions-on-server-configuration-management-tools-chef-puppet-and-ansible-2

As a quick recap, configuration management tools enable companies to standardize and automate their infrastructure. Through standardization, you can build systems that are platform independent (i.e. instead of relying on AMIs or provider specific toolsets). These tools also make it easy reproduce servers for scaling or testing, and recover from disaster quickly by defining a proper application state. For example, if servers are not in that defined state when each server is checked, they are restored to their proper state. In addition, this standardization makes it easy to onboard new developers.

While the language across configuration management tools is different, the concepts are the same. At the fundamental level in each configuration tool, a resource represents a part of the system and its desired state, such as a package that should be installed, a service that should be running, or a file that should be generated.

In Chef, a recipe is a collection of resources that describes a particular configuration or policy. These collections are called playbooks in Ansible, and manifests in Puppet. These collections describe everything that is required to configure part of a system. Collections install and configure software components, manage files, deploy applications, and execute other recipes. We go into more detail in our blog post here.

Here are the top questions we got from the community:

How is the concept of master/agent configuration better (or not) than agentless, when it comes to infrastructure as code?

Chef and Puppet are master/agent configuration systems, while Ansible is an agentless system. The historic argument is that the agent-based installation process is difficult –  you have to set up the master, and then set up the agents on your nodes so that they know about the master. If you’ve got servers with diverse linux distros, on different versions of Windows, etc., installation can get tricky. Though, because they’re logging every few minutes, agent-based systems are powerful for advanced monitoring. At the end of the day this really is based on personal preference and what company requires. If your infrastructure is beefy and heavily standardized, installation on nodes isn’t complicated so use agent-based systems. If you have servers that run Python, try agentless.

Are these configuration management systems like MicroSoft System Center Configuration Manager (SCCM) but used for local and cloud?

This is like MS SCCM, but open-source and paid for per node. For those who haven’t used it, MicroSoft System Center Configuration Manager (SCCM) is used for infrastructure provisioning, monitoring, and automating workflow processes (usually sysadmin stuff). SCCM is a powerhouse in the enterprise space. While it can manage end clients on non-Windows servers, the server console portion of SCCM must be hosted and run on a Windows server machine. The reason other orchestration/configuration systems win here is that you pay on a per-node basis and you’re not totally tied into Windows Server’s licensing agreements. In other words, open-source vs proprietary. And with Chef/Puppet/Ansible the thinking is more in resources as opposed to SCCM, which is more in files and terminal commands.

An attendee commented on using SCCM:

 We really like Ansible because of the none-agent requirement. For Windows patching we utilize System Center Configuration Manager, and even though System Center can provide patching to Linux we have run into issues with SCCM agent staying healthy and running on our Linux systems. We have also run into when the SCCM admins have made changes it broke SCCM agent on a majority of our Linux servers. Our Linux patching process has been highly manual up to this point but we are seeking to automate this to free up staff time to be better directed at other support tasks, which is why were are reviewing several solutions. The non-agent aspect is highly desirable in our situation because of past experience with SCCM agent. I just wanted to provide that feedback so others that have not experienced agent issues with other deployment solutions may want to keep that in mind.”

If we have to pick a tool dependent on whether we deploy on cloud or on-premise – which of these tools would be a better choice?

We would recommend looking into network access requirements for each tool. If you have an agent that checks in periodically with a central master management piece, that is likely to work better then SSH which requires direct path / path through lots of proxies. 

One attendee mentioned in the comments: “[In regards to] SSH vs Agent – Agent is more secure where SSH not an option.

What happened to cfengine? This tool used to be mentioned alongside Chef and Puppet. 
Version 3 of cfengine is a complete revamp, but it compared to other configuration management tools the brand and community outreach isn’t strong, and does little the others don’t do better.

How does StackStorm compare to the other orchestrators being reviewed?
StackStorm labels itself more of an automation platform, or a DevOps workflow tool that handles provisioning and configuring servers but also leans on automatic and event driven services that plugs into Jenkins and other CI/CD workflows.

From one attendee that had used all three: “For us, getting the Server engineers to adopt Chef has been very difficult. It grew organically on the Dev side of the house. Ansible appears to be something that guys without Dev skills could pick up more easily. Just [my] perception.”

Can I run tasks in parallel with Ansible rather than running it serially (say 50 servers being updated with a patch)?

The default method is to run each task across all servers in parallel, meaning that it will run the first task (e.g. installing Git) on all servers in a group, and once all servers respond with a success, failure, or unchanged response, Ansible will move to the next task on all servers. It doesn’t run on a server, wait, move on to the next, it will run on all servers at once over SSH. If you want to deploy updates in batches, you can run a percentage of servers in a group (e.g. 50%, by listing it in the playbook as serial: 50%).

An attendee made this comment as we mentioned Ansible:

I have attended a presentation from RedHat regarding Ansible that states [that Ansible scales well]. They have large scale hosting companies that on the fly spin up servers and perform patching for their servers via Ansible. The one mentioned had over 50,000 servers and it seemed to handle the volume / scale fine. I of course don’t know everything about Puppet or Chef or Salt, but one thing I find really nice about Ansible is the ability to perform rolling updates / tasks. So if you say had 1000 servers you can say you want to run 10% or 100 at a time and keep it rolling until all 1000 are done. It can be stated by percentage or defined number…I am sure I sound a bit biased but one of the main reasons Ansible is high on our list right now is the fact that it is agentless and does not really consume resources.”

With Ansible, how can we handle the security implications about allowing passwordless ssh to a root account on all systems? What mechanisms are there for access control and auditing?

There are definitely security implications if you are going to allow passwordless ssh. So it’s on the company to ensure that security groups or NSGs are well defined. We should also mention that the passwordless ssh is only enabled on the machine you are running Ansible commands and playbooks from, so if anything consider that workstation to be your weak point. Make sure SSH access is only permissible through your IP. As an alternative solution to connecting via SSH, if you use docker, Ansible allows you to deploy playbooks directly into Docker containers using the local Docker client. All you need is a user inside that container.

Does ansible run single-threaded or is it addressing multiple servers in a group asynchronously?
Ansible runs on each host in parallel. This means that it attempts to run your tasks on all servers defined at the top of the playbook before moving on to the next task.

One user said in regards to all three tools: “Ansible seems better for “orchestration” and Puppet/Chef are really good for “Configuration Management”.  Ansible can be used to stop applications and databases and then run Puppet and then start applications and databases.

Lastly, we got a surprise question from the audience on Jenkins, a CI/CD pipeline tool that can be used in conjunction with tools like Chef to completely automate the infrastructure behind your applications.

What is the alternative of Jenkins?
While we recommend Jenkins, If you’re a Ruby shop, Capistrano is geared towards your deployments. If you live in the AWS world, you can try using the CodeCommit/CodeDeploy/CodePipeline toolset. If you’re looking for a provider agnostic solution, CircleCI is great. If your workflows revolve around Atlassian, try Bamboo. 

If you are unsure of what CI/CD pipeline tool to use, or how they work, we will be hosting a webinar on Jenkins as part of our on-going series on infrastructure-as-code.

Tagged : / / / / / / /

What is the significance of the default directory under chef cookbook /templates?

 

What is the significance of the default directory under chef cookbook /templates?
A cookbook is frequently designed to work across many platforms and is often required to distribute a specific template to a specific platform. This is a New in Chef Client 12.0. A cookbook can be designed to support the distribution of templates across platforms, while ensuring that the correct template ends up on each system.

 

The pattern for template specificity depends on two things: the lookup path and the source. The first pattern that matches is used:
/host-$fqdn/$source
/$platform-$platform_version/$source
/$platform/$source
/default/$source
/$source

 

Use an array with the source property to define an explicit lookup path. For example:
template ‘/test’ do
  source [“#{node.chef_environment}.erb”, ‘default.erb’]
end

 

The following example emulates the entire file specificity pattern by defining it as an explicit path:
template ‘/test’ do
  source %W{
    host-#{node[‘fqdn’]}/test.erb
    #{node[‘platform’]}-#{node[‘platform_version’]}/test.erb
    #{node[‘platform’]}/test.erb
    default/test.erb
  }
end

 

A cookbook may have a /templates directory structure like this:
/templates/
  windows-6.2
  windows-6.1
  windows-6.0
  windows
  default

 

and a resource that looks something like the following:
template ‘C:\path\to\file\text_file.txt’ do
  source ‘text_file.txt’
  mode ‘0755’
  owner ‘root’
  group ‘root’
end

 

This resource would be matched in the same order as the /templates directory structure. For a node named host-node-desktop that is running Windows 7, the second item would be the matching item and the location:
/templates
  windows-6.2/text_file.txt
  windows-6.1/text_file.txt
  windows-6.0/text_file.txt
  windows/text_file.txt

  default/text_file.txt

Reference
https://docs.chef.io/resource_template.html

Tagged : / / / / / /

Top 10 Scripting Languages in DevOps | List of Best Scripting Languages

top-10-scripting-languages-in-devops
This is the time of DevOps in software industry and DevOps uses different different languages for deployment automation and for software development. This is the reason if you are a DevOps professional and want to be succeed in DevOps role than command on scripting languages is must. But, one can not be a master of all. Right? Therefore, In this article I am going to share a list of top 10 scripting languages which will be useful for your DevOps journey.
But before that let’s have a quick look on Scripting language.
Scripting languages are programming languages that communicate and integrate with other programming languages. In other words, scripting languages controlls interactive programs operations by giving it sequence of work to execute by one command at a time.
Now, let’s look on to the list of top 10 scripting languages

1. Microsoft PowerShell

Microsoft PowerShell

Microsoft powershell or powershell is belongs to Microsoft and an open source cross platform scripting language. If you have application infrastructure with windows than powershell is must for you. This scripting language is designed for system admins.
2. Puppet

Puppet

Puppet is a configuration management tool and it has it’s own declarative language to describe system configuration. It runs on Linux, Unix-like and also on Windows. This one is available under Apache 2.7.0 and General Pubic license.  Puppet uses a custom declarative language, it just needs to specify ‘what’ action needs to be performed on the resources.
3. Chef

Chef

Chef is basically known as configuration management which belongs to chef is also a scripting language which is designed by David Morgan. It makes programs look like cooking any food.
4. Bash

Bash

Bash is basically a command language which is available in open source and written by Brian Fox in the year 1989. It can read scripts and Bash is the most commonly used Unix shell. Bash supports Linux, Windows and Mac OS.
5. Ruby

Ruby

Ruby is amongst one of the best programming language but it is also a scripting language which is written by Yukihiro Matsumoto in the year 1995. Ruby supports cross platforms and it is available under GPL and BSD license. It supports multiple programming paradigms, including functional, object-oriented, and imperative.
6. Ansible

Ansible

Ansible is known as configuration management and application deployment tool but it is also amongst top scripting languages. This language is belongs to Ansible Inc. and written by their community members. It supports Linux, Unix-like and Windows operating system.
7. Perl

Perl

Perl is a scripting language which is used for advanced web applications development. Perl is written by Larry Wall and first released in the year 1987. Perl supports cross platforms. Perl is available under general public license.
8. Python

Python

Python is also amongst the top scripting languages which is used for high level of programming. It was first released in the year 1991 by Guido van Rossum. python is available under Python Software Foundation License. It’s supports Cross-platform.
9. Go language

Go language

Go scripting language belongs to the Internet giant Google. This scripting language is written by Robert Griesemer, Rob Pike and Ken Thompson and it was released in the year 2009. It supports  Linux, macOS, FreeBSD, NetBSD, OpenBSD, Windows, Plan 9, DragonFly BSD and Solaris operating systems. It is available in open source.
10. Groovy

Groovy

Groovy can be used as a scripting language and it is also consider as a top scripting languages for DevOps professionals. It was designed by James Strachan and developed by Guillaume Laforge, Jochen Theodorou, Paul King and Cedric Champeau. It was first released in the year 2003 and available under Apache license. It supports Java platform.
Do you agree with this list? If not than feel free to respond in the comment box with your own take on the most essential scripting languages. One more thing, I would like to add here, if you need help to learn all these scripting languages and DevOps courses than scmGalaxy can help you in this. scmGalaxy is a community of DevOps professionals who are well experienced in this domain.
Tagged : / / / / / / / / / / / / / / / / / / /

Top 10 DevOps Tools which is mostly used by DevOps Engineers | scmGalaxy

top-10-devops-tools
DevOps is an important component for software industry today. Developing and implementing a DevOps culture helps to focus IT results and to save time and money as the gap between developers and IT operations teams closes. Just as the term and culture are new, so are many of the best DevOps tools these DevOps engineers use to do their jobs efficiently and productively. To help you in your DevOps process, we have searched and created this list of DevOps tools which is mostly used by DevOps Engineers in their projects.

1. Chef

devops-tool-chef

Chef is an extremely popular tool among DevOps engineers. From IT automation to configuration management, Chef relies on recipes and resources so you can manage unique configurations and feel secure knowing Chef is checking your nodes and bringing them up to date for you.
Key Features:
  • Manage nodes from a single server
  • Cross-platform management for Linux, Windows, Mac OS, and more
  • Integrates with major cloud providers
  • Premium features available

2. Jenkins

devops-tool-jenkins

 

An extensible continuous integration engine, Jenkins is a top tool for DevOps engineers who want to monitor executions of repeated jobs. With Jenkins, DevOps engineers have an easier time integrating changes to projects and have access to outputs to easily notice when something goes wrong.
Key Features:
  • Permanent links
  • RSS/email/IM integration
  • After-the-fact tagging
  • JUnit/TestNG test reporting
  • Distributed builds
3. Puppet

devops-tool-puppet

Puppet is an open-source configuration management tool. It runs on many Unix-like systems as well as on Microsoft Windows, and includes its own declarative language to describe system configuration. DevOps engineers often rely on Puppet for IT automation. Get a handle on configuration management and software while making rapid, repeatable changes with Puppet.
Key Features:
  • Automatically enforce consistency of environments
  • Works across physical and virtual machines
  • A common tool-chain
  • Support key DevOps best practices, including continuous delivery

4. Ant

 

devops-tool-ant

A Java library and command-line tool, Apache Ant looks “to drive processes described in build files as targets and extension points dependent upon each other.” This build automation tool is one that saves DevOps engineers a great deal of time.
Key Features:
  • Supplies a number of built-in tasks for compiling, assembling, testing, and running Java applications
  • Builds non-Java applications, such as C or C++ applications
  • Pilot any type of process which can be described in terms of targets and tasks
  • Extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool

5. Apache Maven

devops-tool-apache-maven

DevOps engineers can manage a project’s build, reporting, and documentation from a central piece of information with Apache Maven. A software project management and comprehension tool, Maven has been a reliable tool for DevOps engineers.
Key Features:
  • Simple project setup follows best practices
  • Easily work with multiple projects at one time
  • Large repository of libraries and metadata that continue to grow
  • Extensible, with the ability to write plugins in Java or scripting languages
6. Logstash

devops-tool-logstash

For open source log processing, search, and analytics, Logstash is a popular tool among DevOps engineers. Because Logstash is licensed under Apache 2.0, you can use it in the way that best suits your needs.

Key Features:
  • Collects, parses, and stores logs for later use
  • Includes a web interface for searching and drilling into all of your logs
  • Ship logs from any source, parse them, timestamp them correctly, index them, and search them

7. Docker

devops-tool-docker

 

An open platform for distributed applications, Docker is an application for DevOps engineers who want to “build, ship, and run any app, anywhere.” With Docker, you can quickly assemble apps from components and work collaboratively.
Key Features:
  • Assemble multi-container apps and run on any infrastructure
  • Compose an app using both proprietary containers and Docker Hub Official Repos
  • Manage all containers of an app as a single group
  • Cluster an app’s containers to optimize resources and provide high-availability
8. New Relic

devops-tool-new-relic

With New Relic APM, DevOps engineers spend less time monitoring applications and more time on building and deploying. A popular, reliable tool, New Relic APM is a great choice for DevOps engineers.
Key Features:
  • Helps in the build, deployment, and maintenance of web software
  • Application monitoring in one place
  • Cross application and transaction tracing
  • Database and availability and error monitoring
9. Gradle

devops-tool-gradle

 

Gradle is a robust tool for automating building, testing, publishing, and deploying software packages and other projects. With the combined power and flexibility of Ant and Maven, Gradle is an open source build automation system which is perfect and very useful for DevOps engineers.
Key Features:
  • Declarative builds and build-by-convention
  • Language for dependency-based programming
  • Structure your build
  • Deep API
  • Multi-project builds
  • Ease of migration
10. Git 

devops-tool-git 

 

Git is a mature, actively maintained open source project originally developed in 2005 by Linus Torvalds, the famous creator of the Linux operating system kernel. Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Key Features:
  • Working offline
  • Fast to Work With
  • Repositories Are Smaller
  • Moving or Adding files
  • Ignore Certain Files
  • Branches
  • Check the Status of Your Changes
  • Stash Branches
  • Cherry Pick Changes from Branches
  • Find version that Introduced a bug using Binary Search
These are the most popular DevOps tools which are used by DevOps engineers or practitioners these days. But to make most out of these tools you need to have proper knowledge of these tools like installation process, implementation process, where to you use, how to use, troubleshooting and much more. So, if you think you need help or training for these tools or for DevOps related helps than we are here to assist you with our industry expertise professionals.
Tagged : / / / / / / / / / / / / / / / / / / / /

Write 10 Chef Cookbooks to test your chef programming skills

chef-cookbooks-to-test-your-chef-programming-skills

  1. Write a cookbook using you can install apache http server in CentOs and Ubuntu, enable the services and start the service.

  2. Write a recipe using template resources to create a file, but only if an attribute has a specific value.

  3. Write a recipe to create a file using a string, but not if “/etc/passwd” exists?

  4. Write a cookbook to unzip a file, and then move a files from one location to another using batch, bash chef resources?

  5. Create a role and assign any two cookbooks to role and setup a 2 nodes assigned to role and conerse the role.

  6. Write a cookbook using install version of latest tomcat and deploy jenkins.war files into war.

  7. Write a 4 cookbooks php, mysql, apache and webapp respectively and map a dependency between them and install a sample web application.

  8. Write a cookbook to install git, wget, zip in RHEL and Ubuntu.

  9. Write a cookbook in which create a file using a string, but only if “/etc/passwd” exists

  10. Write a coobook to run a batch file that unzips and then moves files from one location to another.

Tagged : / / / / / / / / / /

Write 10 Chef Cookbooks to test your chef programming skills

chef-cookbooks

  1. Write a cookbook using you can install apache http server in CentOs and Ubuntu, enable the services and start the service.
  2. Write a recipe using template resources to create a file, but only if an attribute has a specific value.
    1. Write a recipe to create a file using a string, but not if “/etc/passwd” exists?
  3. Write a cookbook to unzip a file, and then move a files from one location to another using batch, bash chef resources?
  4. Create a role and assign any two cookbooks to role and setup a 2 nodes assigned to role and conerse the role.
  5. Write a cookbook using install version of latest tomcat and deploy jenkins.war files into war.
  6. Write a 4 cookbooks php, mysql, apache and webapp respectively and map a dependency between them and install a sample web application.
  7. Write a cookbook to install git, wget, zip in RHEL and Ubuntu.
  8. Write a cookbook in which create a file using a string, but only if “/etc/passwd” exists
  9. Write a coobook to run a batch file that unzips and then moves files from one location to another.
Tagged : / / / / / / / / / /

Configure the Knife Command – Chef

configure-the-knife-command

We now have to configure the knife command. This command is the central way of communicating with our server and the nodes that we will be configuring. We need to tell it how to authenticate and then generate a user to access the Chef server.

Luckily, we’ve been laying the groundwork for this step by acquiring the appropriate credential files. We can start the configuration by typing:

knife configure --initial 

This will ask you a series of questions. We will go through them one by one:

WARNING: No knife configuration file found Where should I put the config file? [/home/your_user/.chef/knife.rb]

The values in the brackets ([]) are the default values that knife will use if we do not select a value.

We want to place our knife configuration file in the hidden directory we have been using:

/home/your_user/chef-repo/.chef/knife.rb

In the next question, type in the domain name or IP address you use to access the Chef server. This should begin with https:// and end with :443:

https://server_domain_or_IP:443

You will be asked for a name for the new user you will be creating. Choose something descriptive:

Please enter a name for the new user: [root] station1

It will then ask you for the admin name. This you can just press enter on to accept the default value (we didn’t change the admin name).

It will then ask you for the location of the existing administrators key. This should be:

/home/your_user/chef-repo/.chef/admin.pem

It will ask a similar set of questions about the validator. We haven’t changed the validator’s name either, so we can keep that as chef-validator. Press enter to accept this value.

It will then ask you for the location of the validation key. It should be something like this:

/home/your_user/chef-repo/.chef/chef-validator.pem

Next, it will ask for the path to the repository. This is the chef-repo folder we have been operating in:

/home/your_user/chef-repo

Finally, it will ask you to select a password for your new user. Select anything you would like.

This should complete our knife configuration. If we look in our chef-repo/.chef directory, we should see a knife configuration file and the credentials of our new user:

ls ~/chef-repo/.chef 
admin.pem  chef-validator.pem  knife.rb  station1.pem
Tagged : / / / / / / / / / / / /

Chef Training | Chef Course | Online | Classroom | scmGalaxy

chef-training

The basic course program is outlined here

Configuration Management
  • What Is Configuration Management?
  • Why You Need a Configuration Management Tool to Automate IT
  • What Is Chef?
  • Why Chef Might Be a Good Tool for Your Enterprise
  • Where Do We Go From Here?
  • Chef Development Tools
My Program in Chef
  • Chef Syntax and Examples
  • Working with Knife
  • Writing First Chef Recipe
  • Chef and Its Terminology
Cookbooks
  • Using Cookbooks
  • Introducing Vagrant & Virtualbox
  • Introducing Test Kitchen
  • Spinning up your first Virtual Machine
  • Introducing OpsCode
  • Developing a Cookbooks
  • Developing Your First Cookbook
  • Writing a Recipe
  • Creating the Index File
  • Changing the Metadata
  • Uploading the Cookbook
  • Running the Cookbook
  • Add an Attribute
  • Add a Resource to the Default Recipe
  • Add the Template File
  • Uploading and Running the Cookbook
  • Using Environments
Modeling your infrastructure
  • Roles
  • Implementing a role
  • Determining which recipes you need
  • Applying recipes to roles
  • Mapping your roles to nodes
  • Environments
  • Organizing your configuration data
Cloud Provisioning Using Chef
  • Provisioning Using Vagrant and Chef
  • Providers and Provisioners
  • Installing Vagrant
  • Configuring Vagrant
  • Vagrant Provisioning Using Chef
  • AWS and Chef Provisioning Using Vagrant
  • Provisioning Using Knife
Troubleshooting and Debugging
  • Chef Troubleshooting and Debugging
  • Debugging Chef Client Run
  • Debugging Recipes Using Logs
  • Debugging Recipes Using Chef Shell
  • Troubleshooting Chef Client
Advance Chef
  • Recipe Inclusion
  • Data Bags
  • Search Roles
  • Configuring Services like Apache
Deployment using chef
  • Looking at your application deployment cookbook
  • Deployment using zip/tar files. E.g: Apache Tomcat deployment and configured as service.
  • Windows – Configuring Services like IIS
  • Dependencies Management
Integrating with the Cloud
  • Amazon EC2
  • Rackspace Cloud
Tagged : / / / / / / / / / /

Chef solo | Chef solo Tutorial | Chef solo Guide

chef-solo
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 web.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/web.json
Confirm ntp is installed
========================
> yum info ntp
Tagged : / / / / / /