Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

Chef

What is Chef?
• Open Source
• Uses Ruby
• Chef is used to deploy, manage servers and applications in-house and
on the cloud.
Features
• Builds upon Ruby language to create a domain-specific language DSL

• No assumptions made for current status of a node.

• It uses its mechanisms to get the current status of machine.

• Chef is used to deploy and also manage user’s cloud server, user
storage, and software.
• Easy to learn − Ruby language is easy to implement and run easy
configuration and scriptable.

• Easily integrate with cloud services. Easy tool to manage and


distribute infrastructure on multiple cloud environment.
Chef Terminology
• Recipe

Attribute collection that can be used to manage infrastructure nodes.

Loaded when the chef client runs. It then gets to the status which is
defined in the node resource of the recipe.

Can be called as the main component of a cookbook.


• Cookbook

Combination of recipes is called a cookbook

User can upload cookbook to Chef server

When user does a Chef run the recopies get a infrastructure to the
required state that is mentioned in recipe.
• Attribute
They are a key value combined pair that can be used in cookbook.

• File
A subdirectory which can have any file within it and can be used by the
nodes.
Architecture
• Chef has a 3 tier client –server based architecture

• Cookbooks are developed on the users chef system.

• Uploaded to chef server via knife


• Chef Workstation
• The computer system on which the configurations are being
continuously developed.
• Chef Server

• Can be called as the brain of the system.

• It is a central unit where one uploads the developed configuration


files.
• Chef Nodes
• Systems on which chef server controls as managed nodes.

• They are known for their heterogenous setup depending on the user
requirement.
Puppet
• Open Source
• Uses Ruby
• Can be usedto configure infrastructure on user physical machine or
virtual machine.
• Puppet uses client-server model
• Anyone system can acts as the server thereby acting as a puppet
master
• Rest systems automatically become slaves clients
Puppet − Components
• Puppet Resources

• Main components to model a machine.

• These resources have their own implementation model. Puppet uses


the same model to get any particular resource in the desired state.
• Providers
• Used to download any particular resource.

• Operating system based package manager are valid providers.

• Each platform has a default provider to install resources.


• Manifest

A group of resources that are bundled within function or classes to


configure any target system.

Usually consists of Ruby scripts.


• Modules
• Primary component of puppet.
• Bundle of resources, files, templates, etc.
• Provide reusability to user.
Ansible
• Open source software to automate

• application deploying which

• Orchestration between multiple services

• Provisioning of cloud resources


• It support configuration management with examples as below.
• Configuration of servers
• Application deployment
• Continuous testing of already install application
• Provisioning
• Orchestration
• Automation of tasks
• Ansible connects to nodes without any agent.

• It pushes Ansible modules to these nodes. The modules have the


desired resource models within them.

• The modules are then executed via ssh and later deleted.
PLAYBOOKS
• Automation language used by Ansible.

• Playbooks can orchestrate infrastructure topology.

• Example
----
hosts: webservers
serial: 5 # update 5 machines at a time
roles:
- Common
- webapp
• Configuration management in terms of Ansible means that it
maintains configuration of the product performance by keeping a
record and updating detailed information which describes an
enterprise’s hardware and software.
How does Ansible works?

Source:https://www.tutorialspoint.com/ansible/images/ansible_works.jpg
Ansible Machine Terminology

• Control machine (server) systems that are used to manage and


orchestrate other nodes.

• Remote machine these are the nodes that are getting managed by
Ansible itself.
Installation
• Latest instruction available on website always

• For installing Ansible you have to configure PPA on your machine. For this,
you have to run the following line of code −

$ sudo apt-get update


$ sudo apt-get install software-properties-common
$ sudo apt-add-repository ppa:ansible/ansible
$ sudo apt-get update
$ sudo apt-get install ansible
Sample Playbooks
name: install and configure DB
hosts: testServer
become: yes

vars:
oracle_db_port_value : 1521

tasks:
-name: Install the Oracle DB
yum: <code to install the DB>

-name: Ensure the installed service is enabled and running


service:
name: <your service name>

You might also like