<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Grmenon</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Grmenon"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Grmenon"/>
	<updated>2026-06-03T13:31:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_SocialMediaFeeds&amp;diff=81737</id>
		<title>CSC/ECE 517 Fall 2013/oss SocialMediaFeeds</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_SocialMediaFeeds&amp;diff=81737"/>
		<updated>2013-10-31T00:51:42Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Search Added Queries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Eden ==&lt;br /&gt;
&lt;br /&gt;
Sahana Eden is an Open Source Humanitarian Platform which has been built specifically for Disaster Management,Development, and Environmental Management sectors. It is highly configurable so that it can be used in a wide variety of different contexts and is easy to modify to build custom solutions.&amp;lt;ref&amp;gt;Tressel, Pat, Fran Boon, Shikhar Kohli, Dominic Koenig, Belinda Lopez, Eli Lev, Michael Howden, and Anne Goldenberg(2011, October) ''Sahana Eden'' Lulu.com, Retrieved from  &amp;lt;http://en.flossmanuals.net/sahana-eden/index/&amp;gt; &amp;lt;/ref&amp;gt;&lt;br /&gt;
Sahana Eden can be accessed from the web or locally from a flash drive, allowing it to be used in environments with poor internet. Local &amp;amp; Web versions can be configured to synchronize to allow data to be shared between them. This helps to keep data synchronized to receive updates regularly and help in responding and recovering from disasters more effectively and efficiently.&lt;br /&gt;
&lt;br /&gt;
Sahana Eden's modular design allows different pieces of functionality to be enabled and disabled as required providing flexible solutions for changing contexts.&lt;br /&gt;
&lt;br /&gt;
The application can be configured to secure sensitive information, while also making data which needs to be shared available in a variety of different formats including Microsoft Excel and PDF. To ensure that Sahana Eden is accessible to every country, it can be translated into multiple languages.&lt;br /&gt;
&lt;br /&gt;
== Framework - Web2py ==&lt;br /&gt;
Web2py is an enterprise framework for agile development of secure database-driven web-based applications, written and programmable in Python.web2py is a full-stack framework, meaning that it contains all the components you need to build fully functional web applications.&amp;lt;ref&amp;gt; Massimo Di Pierro, ''Complete Reference Manual, 6th Edition (pre-release)'' Retrieved from &amp;lt;http://www.web2py.com/init/default/documentation&amp;gt; &amp;lt;/ref&amp;gt;&lt;br /&gt;
=== Features of Web2py: &amp;lt;ref name = &amp;quot;name&amp;quot;&amp;gt; web2py.com &amp;lt;/ref&amp;gt; ===&lt;br /&gt;
web2py includes a Database Abstraction Layer (DAL) that writes SQL dynamically so that you, the developer, don't have to. The DAL knows how to generate SQL transparently for SQLite, MySQL, PostgreSQL, MSSQL, FireBird, Oracle, IBM DB2, Informix and Ingres.&lt;br /&gt;
* The DAL can also generate function calls for the Google Datastore when running on the Google App Engine. &lt;br /&gt;
* web2py differs from other web frameworks in that it is the only framework to fully embrace the Web 2.0 paradigm, where the web is the computer.web2py does not require installation or configuration; it runs on any architecture that can run Python (Windows, Windows CE, Mac OS X, iOS, and Unix/Linux), and the development, deployment, and maintenance phases for the applications can be done via a local or remote web interface. web2py runs with CPython (the C implementation) and PyPy (Python written in Python), on Python versions 2.5, 2.6, and 2.7.&lt;br /&gt;
* web2py provides a ticketing system for error events. If an error occurs, a ticket is issued to the user, and the error is logged for the administrator.&lt;br /&gt;
* web2py is open source and released under the LGPL version 3 license.&lt;br /&gt;
&lt;br /&gt;
=== Why Web2Py? &amp;lt;ref name=&amp;quot;name&amp;quot;&amp;gt; Massimo Di Pierro, ''Complete Reference Manual, 6th Edition (pre-release)'' Retrieved from &amp;lt;http://web2py.com/books/default/chapter/29/01/introduction&amp;gt; &amp;lt;/ref&amp;gt;===&lt;br /&gt;
web2py is one of many web application frameworks, but it has compelling and unique features. web2py was originally developed as a teaching tool, with the following primary motivations:&lt;br /&gt;
* Easy for users to learn server-side web development without compromising functionality. For this reason, web2py requires no installation and no configuration, has no dependencies (except for the source code distribution, which requires Python 2.5 and its standard library modules), and exposes most of its functionality via a Web interface, including an Integrated Development Environment with Debugger and database interface.&lt;br /&gt;
* web2py has been stable from day one because it follows a top-down design; i.e., its API was designed before it was implemented. Even as new functionality has been added, web2py has never broken backwards compatibility, and it will not break compatibility when additional functionality is added in the future.&lt;br /&gt;
* web2py proactively addresses the most important security issues which plague many modern web applications, as determined by OWASP[owasp] below.&lt;br /&gt;
* web2py is lightweight. Its core libraries, including the Database Abstraction Layer, the template language, and all the helpers amount to 1.4MB. The entire source code including sample applications and images amounts to 10.4MB.&lt;br /&gt;
* web2py has a small footprint and is very fast. It uses the Rocket[rocket] WSGI web server developed by Timothy Farrell. It is as fast as Apache with mod_wsgi, and supports SSL and IPv6.&lt;br /&gt;
* web2py uses Python syntax for models, controllers, and views, but does not import models and controllers (as all the other Python frameworks do) - instead it executes them. This means that apps can be installed, uninstalled, and modified without having to restart the web server (even in production), and different apps can coexist without their modules interfering with one another.&lt;br /&gt;
* web2py uses a Database Abstraction Layer (DAL) instead of an Object Relational Mapper (ORM). From a conceptual point of view, this means that different database tables are mapped into different instances of one Table class and not into different classes, while records are mapped into instances of one Row class, not into instances of the corresponding table class. From a practical point of view, it means that SQL syntax maps almost one-to-one into DAL syntax, and there is no complex metaclass programming going on under the hood as in popular ORMs, which would add latency.&lt;br /&gt;
&lt;br /&gt;
== S3==&lt;br /&gt;
The Sahana Eden framework (S3) is built on Web2Py and It is used for RAD(Papid Application Development) in all the sahana applications. Eden’s custom CRUD framework.  &lt;br /&gt;
S3 Framework includes pre configured Filters and Reports that allow the data analysis and report generation a simple task to be performed by directly.&amp;lt;ref&amp;gt;Tressel, Pat, Fran Boon, Shikhar Kohli, Dominic Koenig, Belinda Lopez, Eli Lev, Michael Howden, and Anne Goldenberg(2011, October) &amp;quot;Sahana Eden.&amp;quot; Lulu.com, . Web. Oct. 2013. Retrieved from  &amp;lt;http://en.flossmanuals.net/sahana-eden/technical-overview/&amp;gt; &amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
S3 Filter forms allow the user to apply filters to interactive views (e.g. data tables, data lists, reports etc.). S3CRUD has filter forms integrated in the standard list view (=multi-record request w/o URL method). Filter forms can be rendered by any method handler. Since filter forms will never be submitted, the method handler does not need to handle any subsequent POSTs related to the filter form, but just insert the filter form HTML into the page.&lt;br /&gt;
&lt;br /&gt;
S3 Framework also includes S3Report which is a REST method handler for data analysis. S3Report generates a full page which includes a set of S3Search widgets, a pivot table (a.k.a. contingency table) from S3Resources and graphs based on the Pivot Tables. S3Report responds to the /report URL method. S3Report supports a number of aggregation functions. The functions like list,count,sun and avg have been tested so far.&lt;br /&gt;
&lt;br /&gt;
Table configurations can contain a report_options item, which is a Storage object. This object is used to configure reports and report options form.&lt;br /&gt;
The rows, cols, facts and aggregate items are lists of available values for the user to select from.&lt;br /&gt;
The defaults property is a Storage object that contains the default values for the report. It can contain a value for rows, cols, fact, aggregate and totals (as described in URL Methods).&lt;br /&gt;
The search property is a list of S3Search widgets that will allow the report to be filtered. If no search property is specified, no filter form will be available.&lt;br /&gt;
&lt;br /&gt;
== Openshift Deployment ==&lt;br /&gt;
&lt;br /&gt;
OpenShift is a cloud computing platform which offers &amp;quot;Platform As a Service&amp;quot; cloud. It is based on hosting platform provided by RedHat. It supports Ruby, it is really easy to install and start working on it.  OpenShift takes care of maintaining the services underlying the application and scaling the application as needed. OpenShift supports web-application frameworks by supporting each language's preferred web-integration API, with no required changes to the actual framework code. web2py works unmodified on OpenShift.&lt;br /&gt;
&lt;br /&gt;
Since the software is open source, it is available on GitHub. Development can be started after deploying different web applications in different languages on the platform using [http://en.wikipedia.org/wiki/Git_(software) Git].Making Changes to your Application on OpenShift, you make code changes on your local machine, check those changes in locally, and then &amp;quot;push&amp;quot; those changes to OpenShift. One of the primary advantages of Git is that it does not require a continuous online presence in order to run. You can easily check in (in Git terminology, 'commit') and revert changes locally before deciding to upload those changes to OpenShift.&lt;br /&gt;
&lt;br /&gt;
== Configuration - Twitter ==&lt;br /&gt;
The Sahana Eden’s social media feeds requires the user to configure the twitter settings. This is done by providing the twitter login ID, and the OAuth credentials in the Twitter Settings page&lt;br /&gt;
&lt;br /&gt;
:[[File:Configure.png]]&lt;br /&gt;
&lt;br /&gt;
Once the twitter settings are configured, we are all set to search twitter feeds.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Twitter Search After Save ==&lt;br /&gt;
&lt;br /&gt;
Twitter search after save allows Sahana Eden to perform a search immediately after the search query is added.Search queries can be added in Sahana Eden by clicking on the Add query button in the Twitter Queries page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:[[File:Addquery1.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The keyword to search is entered. Checking the &amp;quot;Search After Save?&amp;quot; will redirect the user to the results page once the search query is added. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:[[File:Addquery2.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:[[File:Addquery3.png]]&lt;br /&gt;
&lt;br /&gt;
== Twitter Search Results Filter ==&lt;br /&gt;
The twitter search results for the search queries can be found in the Twitter Search Results page. The search filters on the Results page allow searching of feeds by &amp;quot;Tweeted date&amp;quot; and &amp;quot;Tweeted by&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
: [[File:New-tweeted-by.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:[[File:New-tweetedby.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Twitter Search Results Report ==&lt;br /&gt;
&lt;br /&gt;
The Reports page generates Reports based on date filters and &amp;quot;tweeted by&amp;quot;. The report contains the total number of records, search queries, Tweeted on and language that can further be grouped by search query, tweeted on or language.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:[[ File:Report1.png]]&lt;br /&gt;
&lt;br /&gt;
:[[ File:Report2.png]]&lt;br /&gt;
&lt;br /&gt;
== Further Work (wrt to OSS Final Project) ==&lt;br /&gt;
The further work in the OSS project is listed below: &lt;br /&gt;
*Integration with Parsers&lt;br /&gt;
*rewire the 'parse_twitter' Parser&lt;br /&gt;
*Run Parsers on the list&lt;br /&gt;
*Extract Documents Parser&lt;br /&gt;
*Parser should run on any Message&lt;br /&gt;
*Parser should read attachments&lt;br /&gt;
*Parser should add all URLs as documents&lt;br /&gt;
*Parser should parse link types to see if there are Images&lt;br /&gt;
*optionally parser should be able to download linked images/documents into local store&lt;br /&gt;
*Train these parsers&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
*The twitter search is currently hard coded. The search accesses the msg_twitter_search table and use the keywords stored by the user through the eden portal to search and display twitter feeds on the map.&lt;br /&gt;
*Display the twitter icon for twitter search instead of the usual bubble&lt;br /&gt;
*Work on twitter links and message which would pop up contents like photos,URL etc.  This work is doing the part within the tweet parsing of following embedded URLs to identify if they're Media would be really useful addition to the parser (there is a commented-out stub).&lt;br /&gt;
*Create a cron job for searching tweets periodically instead of manual searches as per user’s request.&lt;br /&gt;
*Current implementation includes integration of Sahana with Twitter. The future enhancements of the eden project includes allow Sahana Eden to be configured to have a Facebook updates in it&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
The Sahana Eden Foundation developed for Disaster Management provides a web platform to provide solution for the relief effort. The project provides a solution to manage organizations, people, projects, inventory and assets as well as collecting information through assessments and providing situational awareness through maps.&lt;br /&gt;
Hence, enhancing the searches and reports will provide great help to Disaster Management.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Further Reading ==&lt;br /&gt;
# ''Getting Started''. Retrieved from https://dev.twitter.com/start&lt;br /&gt;
#''Sahana Eden Project''. Retrieved from http://eden.sahanafoundation.org/wiki/WikiStart&lt;br /&gt;
#''Installation Guidelines''. Retrieved from http://eden.sahanafoundation.org/wiki/InstallationGuidelines&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
* All references and further reading links are in the APA6 style&lt;br /&gt;
* All the content on this page is from websites that have a Attribution-NonCommercial-NoDerivs 3.0 or similar license that allows us to use their content.&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_SocialMediaFeeds&amp;diff=80536</id>
		<title>CSC/ECE 517 Fall 2013/oss SocialMediaFeeds</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_SocialMediaFeeds&amp;diff=80536"/>
		<updated>2013-10-30T04:58:04Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: Created page with &amp;quot;== Introduction to Eden ==  == Framework - Web2py ==  == S3 ==  == Openshift Deployment ==  == Confgiuration - Twitter ==  == Twitter Search Results Filter ==  == Twitter Search ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction to Eden ==&lt;br /&gt;
&lt;br /&gt;
== Framework - Web2py ==&lt;br /&gt;
&lt;br /&gt;
== S3 ==&lt;br /&gt;
&lt;br /&gt;
== Openshift Deployment ==&lt;br /&gt;
&lt;br /&gt;
== Confgiuration - Twitter ==&lt;br /&gt;
&lt;br /&gt;
== Twitter Search Results Filter ==&lt;br /&gt;
&lt;br /&gt;
== Twitter Search After Save ==&lt;br /&gt;
&lt;br /&gt;
== Twitter Search Results Report ==&lt;br /&gt;
&lt;br /&gt;
== Further Work ==&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77876</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77876"/>
		<updated>2013-09-18T16:57:12Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Further Reading/References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
[[File:Puppet1.png]]&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The server manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / [http://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] of the node&lt;br /&gt;
&lt;br /&gt;
Run the [http://docs.opscode.com/install_bootstrap.html knife bootstrap command]&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for [https://learnchef.opscode.com/screencasts/manage-pem-files/ .pem] files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
'''Similarities'''&lt;br /&gt;
&lt;br /&gt;
* Both support integration with cloud service providers like Amazon to support direct setup and configuration of a fresh instance.&lt;br /&gt;
* Both need client software - the Puppet Agent and Chef Client respectively to be installed first to complete the configuration process&lt;br /&gt;
&lt;br /&gt;
'''Differences'''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses node-groups and classes while initializing nodes whereas Chef directly uses roles and cookbooks.&lt;br /&gt;
* Puppet has Forge which contains a collection of resources whereas Chef has Community Cookbooks for the same task.&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using [http://docs.opscode.com/manage_server_hosted_nodes.html Management Console] or the command line tool [http://docs.opscode.com/knife_node.html Knife]. &lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/knife_node.html Knife command] the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple interface to manage nodes using simple command or a service running in the background.&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Chef enlists the details while doing the required operation whereas puppet does not. It uses command -test to enlist details.&lt;br /&gt;
&lt;br /&gt;
== Config Files Templatization ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/resource_deploy.html Deploy] is one of the [http://docs.opscode.com/resource.html Resource] which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by [http://docs.opscode.com/resource.html Providers] which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both use Embedded Ruby for templatizing config files&lt;br /&gt;
* Both allow files to be specified as the Ruby executed version of an erb&lt;br /&gt;
* Both allow variables to be included in the templates to be replaced by actual files when the config file is deployed&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Puppet the template is specified explicitly as part of the resource type file ( and other similar resource types) whereas in Chef it can be specified anywhere.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
# [http://docs.opscode.com/knife_node.html About Knife]&lt;br /&gt;
# [http://www.aosabook.org/en/puppet.html Puppet Master Agent Architecture]&lt;br /&gt;
# [http://docs.puppetlabs.com/learning/ral.html Puppet RAL]&lt;br /&gt;
# [http://docs.puppetlabs.com/learning/manifests.html Puppet Manifest]&lt;br /&gt;
# [http://docs.puppetlabs.com/learning/modules1.html Puppet Modules and Classes]&lt;br /&gt;
# [http://docs.puppetlabs.com/learning/templates.html Puppet Templates]&lt;br /&gt;
# [http://jeff.robbins.ws/articles/nfs-tutorial NFS Mounting]&lt;br /&gt;
# [http://theforeman.org/ Foreman]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77865</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77865"/>
		<updated>2013-09-18T16:44:22Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Master / Agent Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
[[File:Puppet1.png]]&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The server manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / [http://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] of the node&lt;br /&gt;
&lt;br /&gt;
Run the [http://docs.opscode.com/install_bootstrap.html knife bootstrap command]&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for [https://learnchef.opscode.com/screencasts/manage-pem-files/ .pem] files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
'''Similarities'''&lt;br /&gt;
&lt;br /&gt;
* Both support integration with cloud service providers like Amazon to support direct setup and configuration of a fresh instance.&lt;br /&gt;
* Both need client software - the Puppet Agent and Chef Client respectively to be installed first to complete the configuration process&lt;br /&gt;
&lt;br /&gt;
'''Differences'''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses node-groups and classes while initializing nodes whereas Chef directly uses roles and cookbooks.&lt;br /&gt;
* Puppet has Forge which contains a collection of resources whereas Chef has Community Cookbooks for the same task.&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using [http://docs.opscode.com/manage_server_hosted_nodes.html Management Console] or the command line tool [http://docs.opscode.com/knife_node.html Knife]. &lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/knife_node.html Knife command] the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple interface to manage nodes using simple command or a service running in the background.&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Chef enlists the details while doing the required operation whereas puppet does not. It uses command -test to enlist details.&lt;br /&gt;
&lt;br /&gt;
== Config Files Templatization ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/resource_deploy.html Deploy] is one of the [http://docs.opscode.com/resource.html Resource] which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by [http://docs.opscode.com/resource.html Providers] which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both use Embedded Ruby for templatizing config files&lt;br /&gt;
* Both allow files to be specified as the Ruby executed version of an erb&lt;br /&gt;
* Both allow variables to be included in the templates to be replaced by actual files when the config file is deployed&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Puppet the template is specified explicitly as part of the resource type file ( and other similar resource types) whereas in Chef it can be specified anywhere.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
1. [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://docs.opscode.com/knife_node.html About Knife]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Puppet1.png&amp;diff=77864</id>
		<title>File:Puppet1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Puppet1.png&amp;diff=77864"/>
		<updated>2013-09-18T16:44:02Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77859</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77859"/>
		<updated>2013-09-18T16:42:14Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Master / Agent Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
[[File:puppet.png]]&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The server manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / [http://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] of the node&lt;br /&gt;
&lt;br /&gt;
Run the [http://docs.opscode.com/install_bootstrap.html knife bootstrap command]&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for [https://learnchef.opscode.com/screencasts/manage-pem-files/ .pem] files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
'''Similarities'''&lt;br /&gt;
&lt;br /&gt;
* Both support integration with cloud service providers like Amazon to support direct setup and configuration of a fresh instance.&lt;br /&gt;
* Both need client software - the Puppet Agent and Chef Client respectively to be installed first to complete the configuration process&lt;br /&gt;
&lt;br /&gt;
'''Differences'''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses node-groups and classes while initializing nodes whereas Chef directly uses roles and cookbooks.&lt;br /&gt;
* Puppet has Forge which contains a collection of resources whereas Chef has Community Cookbooks for the same task.&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using [http://docs.opscode.com/manage_server_hosted_nodes.html Management Console] or the command line tool [http://docs.opscode.com/knife_node.html Knife]. &lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/knife_node.html Knife command] the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple interface to manage nodes using simple command or a service running in the background.&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Chef enlists the details while doing the required operation whereas puppet does not. It uses command -test to enlist details.&lt;br /&gt;
&lt;br /&gt;
== Config Files Templatization ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/resource_deploy.html Deploy] is one of the [http://docs.opscode.com/resource.html Resource] which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by [http://docs.opscode.com/resource.html Providers] which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both use Embedded Ruby for templatizing config files&lt;br /&gt;
* Both allow files to be specified as the Ruby executed version of an erb&lt;br /&gt;
* Both allow variables to be included in the templates to be replaced by actual files when the config file is deployed&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Puppet the template is specified explicitly as part of the resource type file ( and other similar resource types) whereas in Chef it can be specified anywhere.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
1. [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://docs.opscode.com/knife_node.html About Knife]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Puppet.png&amp;diff=77856</id>
		<title>File:Puppet.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Puppet.png&amp;diff=77856"/>
		<updated>2013-09-18T16:41:35Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77842</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77842"/>
		<updated>2013-09-18T16:26:22Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Compare */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The server manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / [http://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] of the node&lt;br /&gt;
&lt;br /&gt;
Run the [http://docs.opscode.com/install_bootstrap.html knife bootstrap command]&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for [https://learnchef.opscode.com/screencasts/manage-pem-files/ .pem] files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
'''Similarities'''&lt;br /&gt;
&lt;br /&gt;
* Both support integration with cloud service providers like Amazon to support direct setup and configuration of a fresh instance.&lt;br /&gt;
* Both need client software - the Puppet Agent and Chef Client respectively to be installed first to complete the configuration process&lt;br /&gt;
&lt;br /&gt;
'''Differences'''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses node-groups and classes while initializing nodes whereas Chef directly uses roles and cookbooks.&lt;br /&gt;
* Puppet has Forge which contains a collection of resources whereas Chef has Community Cookbooks for the same task.&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using [http://docs.opscode.com/manage_server_hosted_nodes.html Management Console] or the command line tool [http://docs.opscode.com/knife_node.html Knife]. &lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/knife_node.html Knife command] the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple interface to manage nodes using simple command or a service running in the background.&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Chef enlists the details while doing the required operation whereas puppet does not. It uses command -test to enlist details.&lt;br /&gt;
&lt;br /&gt;
== Config Files Templatization ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/resource_deploy.html Deploy] is one of the [http://docs.opscode.com/resource.html Resource] which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by [http://docs.opscode.com/resource.html Providers] which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both use Embedded Ruby for templatizing config files&lt;br /&gt;
* Both allow files to be specified as the Ruby executed version of an erb&lt;br /&gt;
* Both allow variables to be included in the templates to be replaced by actual files when the config file is deployed&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Puppet the template is specified explicitly as part of the resource type file ( and other similar resource types) whereas in Chef it can be specified anywhere.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
1. [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://docs.opscode.com/knife_node.html About Knife]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77829</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77829"/>
		<updated>2013-09-18T16:14:38Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Config Files Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The server manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / [http://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] of the node&lt;br /&gt;
&lt;br /&gt;
Run the [http://docs.opscode.com/install_bootstrap.html knife bootstrap command]&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for [https://learnchef.opscode.com/screencasts/manage-pem-files/ .pem] files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
'''Similarities'''&lt;br /&gt;
&lt;br /&gt;
* Both support integration with cloud service providers like Amazon to support direct setup and configuration of a fresh instance.&lt;br /&gt;
* Both need client software - the Puppet Agent and Chef Client respectively to be installed first to complete the configuration process&lt;br /&gt;
&lt;br /&gt;
'''Differences'''&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using [http://docs.opscode.com/manage_server_hosted_nodes.html Management Console] or the command line tool [http://docs.opscode.com/knife_node.html Knife]. &lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/knife_node.html Knife command] the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple interface to manage nodes using simple command or a service running in the background.&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Chef enlists the details while doing the required operation whereas puppet does not. It uses command -test to enlist details.&lt;br /&gt;
&lt;br /&gt;
== Config Files Templatization ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/resource_deploy.html Deploy] is one of the [http://docs.opscode.com/resource.html Resource] which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by [http://docs.opscode.com/resource.html Providers] which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both use Embedded Ruby for templatizing config files&lt;br /&gt;
* Both allow files to be specified as the Ruby executed version of an erb&lt;br /&gt;
* Both allow variables to be included in the templates to be replaced by actual files when the config file is deployed&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Puppet the template is specified explicitly as part of the resource type file ( and other similar resource types) whereas in Chef it can be specified anywhere.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
1. [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://docs.opscode.com/knife_node.html About Knife]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77828</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77828"/>
		<updated>2013-09-18T16:14:11Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Compare */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The server manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / [http://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] of the node&lt;br /&gt;
&lt;br /&gt;
Run the [http://docs.opscode.com/install_bootstrap.html knife bootstrap command]&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for [https://learnchef.opscode.com/screencasts/manage-pem-files/ .pem] files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
'''Similarities'''&lt;br /&gt;
&lt;br /&gt;
* Both support integration with cloud service providers like Amazon to support direct setup and configuration of a fresh instance.&lt;br /&gt;
* Both need client software - the Puppet Agent and Chef Client respectively to be installed first to complete the configuration process&lt;br /&gt;
&lt;br /&gt;
'''Differences'''&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using [http://docs.opscode.com/manage_server_hosted_nodes.html Management Console] or the command line tool [http://docs.opscode.com/knife_node.html Knife]. &lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/knife_node.html Knife command] the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple interface to manage nodes using simple command or a service running in the background.&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Chef enlists the details while doing the required operation whereas puppet does not. It uses command -test to enlist details.&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/resource_deploy.html Deploy] is one of the [http://docs.opscode.com/resource.html Resource] which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by [http://docs.opscode.com/resource.html Providers] which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both use Embedded Ruby for templatizing config files&lt;br /&gt;
* Both allow files to be specified as the Ruby executed version of an erb&lt;br /&gt;
* Both allow variables to be included in the templates to be replaced by actual files when the config file is deployed&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Puppet the template is specified explicitly as part of the resource type file ( and other similar resource types) whereas in Chef it can be specified anywhere.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
1. [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://docs.opscode.com/knife_node.html About Knife]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77826</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77826"/>
		<updated>2013-09-18T16:11:45Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Compare */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The server manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / [http://en.wikipedia.org/wiki/Fully_qualified_domain_name FQDN] of the node&lt;br /&gt;
&lt;br /&gt;
Run the [http://docs.opscode.com/install_bootstrap.html knife bootstrap command]&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for [https://learnchef.opscode.com/screencasts/manage-pem-files/ .pem] files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using [http://docs.opscode.com/manage_server_hosted_nodes.html Management Console] or the command line tool [http://docs.opscode.com/knife_node.html Knife]. &lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/knife_node.html Knife command] the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple interface to manage nodes using simple command or a service running in the background.&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Chef enlists the details while doing the required operation whereas puppet does not. It uses command -test to enlist details.&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/resource_deploy.html Deploy] is one of the [http://docs.opscode.com/resource.html Resource] which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by [http://docs.opscode.com/resource.html Providers] which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both use Embedded Ruby for templatizing config files&lt;br /&gt;
* Both allow files to be specified as the Ruby executed version of an erb&lt;br /&gt;
* Both allow variables to be included in the templates to be replaced by actual files when the config file is deployed&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Puppet the template is specified explicitly as part of the resource type file ( and other similar resource types) whereas in Chef it can be specified anywhere.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
1. [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://docs.opscode.com/knife_node.html About Knife]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77795</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=77795"/>
		<updated>2013-09-18T15:32:33Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Compare */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
[http://www.opscode.com/chef/ Opscode Chef] is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# [http://docs.opscode.com/essentials_node_object.html Node] : Any physical, virtual server is referred to as node.&lt;br /&gt;
# [http://docs.opscode.com/knife.html Knife] : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# [http://docs.opscode.com/chef_overview.html#workstations Workstation] : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#repository Repository] : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#the-hosted-server Hoster server]: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# [http://docs.opscode.com/essentials_chef_client.html Chef-client] : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# [http://docs.opscode.com/chef_quick_overview.html#cookbooks Cookbook] : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[http://docs.opscode.com/install_server.html Install chef server] on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/workstation-setup/ Setup workstation]:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a [https://www.virtualbox.org/wiki/Downloads Virtual box] , [http://downloads.vagrantup.com/ Vagrant](command line interface tool), [http://git-scm.com/ Git]( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup [https://learnchef.opscode.com/quickstart/chef-repo/ chef-repo] in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;[https://learnchef.opscode.com/quickstart/chef-repo/ Create Cookbooks]:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;[http://www.opscode.com/chef/install/ Setup chef client]: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
[http://docs.opscode.com/essentials_roles.html Configuration in Chef] is done by defining [http://docs.opscode.com/essentials_roles.html# Role]. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to [https://learnchef.opscode.com/starter-use-cases/wordpress/ configure] a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during [http://docs.opscode.com/install_bootstrap.html bootstrap] using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Puppet and Chef both abstract the configuration of an instance in their own way - using Resources and Recipes respectively&lt;br /&gt;
* Both of them take care of the issue of setting up instances of different OS's - they handle the lower level details of actually installing and setting up packages etc&lt;br /&gt;
* Puppet and Chef both classify or group similar configurations using Classes/Modules and Roles respectively&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* In Chef recipes and other specifications are done in Ruby whereas Puppet has it's own language with it's own file extension - .pp&lt;br /&gt;
* In normal/daily use the Puppet command is sufficient but for Chef the knife tool is more frequently used.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using Management Console or the command line tool Knife. &lt;br /&gt;
&lt;br /&gt;
Knife command the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Both provide a simple and user friendly interface to manage nodes&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses the concept of templatization for reuse of scripts in order to create node. Chef create node page enlists all the recipes and roles in the organization which can be used to create a node.&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Deploy is one of the resource which manages and controls deployment of configuration files on the nodes. It specifies action to be taken during deployment phase. These actions are then put into action by Providers which is mapped to resource deploy. &lt;br /&gt;
&lt;br /&gt;
  deploy &amp;quot;name&amp;quot; do # deploy directs chef client to the provider to be used for this resource,default being Chef::Provider::Deploy::Revision.  &lt;br /&gt;
  # name is the location in which the deployment steps will occur.&lt;br /&gt;
  attribute &amp;quot;value&amp;quot; # this represents the attributes available for this resource.&lt;br /&gt;
  ...&lt;br /&gt;
  callback do &lt;br /&gt;
    # callback represents additional block or link to a file to provide additional information during deployment process.&lt;br /&gt;
  end&lt;br /&gt;
  ...&lt;br /&gt;
  purge_before_symlink&lt;br /&gt;
  create_dirs_before_symlink&lt;br /&gt;
  symlink # These commands are used to create directories, link configuration files, remove directories or map them.&lt;br /&gt;
  action :action # this specifies the action to be taken by the provider.&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;br /&gt;
1. [http://docs.opscode.com/chef_overview.html Opscode Chef]&amp;lt;br&amp;gt;&lt;br /&gt;
2. [http://docs.opscode.com/knife_node.html About Knife]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76522</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76522"/>
		<updated>2013-09-17T01:38:41Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Conclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
Node management in Chef includes users to create, read, update and delete nodes. This can be done either by using Management Console or the command line tool Knife. &lt;br /&gt;
&lt;br /&gt;
Knife command the following syntax in order to manage the nodes :&lt;br /&gt;
&lt;br /&gt;
  $ knife node  [ARGUMENT] (options)&lt;br /&gt;
 &lt;br /&gt;
where ARGUMENT could be any one of the management options like bulk delete, create, edit, delete,list. &lt;br /&gt;
&lt;br /&gt;
For example: to perform a bulk delete, a regular expression is prepared to identify the nodes to be deleted. This is then passed as the option.&lt;br /&gt;
&lt;br /&gt;
  $ knife node bulk delete &amp;quot;node^[0-3]{6}$&amp;quot;&lt;br /&gt;
&lt;br /&gt;
User needs to have specific user level permission in order to do the specific task. For eg: You need create permissions on the global nodes level to create a node.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
&lt;br /&gt;
This comparison was not meant to tout one of the tools - Puppet or Chef - over the other but merely to introduce and contrast both of them and see how they can be used with standard Infrastructure Management scenarios.&lt;br /&gt;
&lt;br /&gt;
It is up to the reader to judge his/her needs and apply the tool for the job.&lt;br /&gt;
&lt;br /&gt;
= Further Reading/References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76510</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76510"/>
		<updated>2013-09-17T01:25:55Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Further Reading */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading/References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76508</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76508"/>
		<updated>2013-09-17T01:25:43Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76507</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76507"/>
		<updated>2013-09-17T01:23:25Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Other Infrastructure Management Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.com Cfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76505</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76505"/>
		<updated>2013-09-17T01:23:03Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Other Infrastructure Management Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/ Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [http://cfengine.comCfengine] is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [http://saltstack.com/community.html SaltStack] - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76502</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76502"/>
		<updated>2013-09-17T01:21:19Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Other Infrastructure Management Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [https://juju.ubuntu.com/|Juju] - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [Cfengine]http://cfengine.com is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [SaltStack]http://saltstack.com/community.html - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76500</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76500"/>
		<updated>2013-09-17T01:19:47Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Other Infrastructure Management Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# [Juju]https://juju.ubuntu.com/ - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# [Cfengine]http://cfengine.com is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# [SaltStack]http://saltstack.com/community.html - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76499</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76499"/>
		<updated>2013-09-17T01:18:43Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Other Infrastructure Management Tools */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Install chef server on the server machine&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Setup workstation:&amp;lt;/li&amp;gt; &lt;br /&gt;
:* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
&amp;lt;li&amp;gt;Create Cookbooks:&amp;lt;/li&amp;gt;&lt;br /&gt;
:* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
   Example: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
   Syntax : knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
&amp;lt;li&amp;gt;Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Configuration in Chef is done by defining Role. Role helps in setting required attributes and tasks for a node. A node can have 0 or more roles assigned to it. Also a role can be assigned to many nodes. Roles thus helps in defining processes for a particular node.&lt;br /&gt;
&lt;br /&gt;
Let us  consider to configure a role for mongoDb server for a application:&lt;br /&gt;
&amp;lt;ol style=&amp;quot;margin-left: 5.2em;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;A role can be created by creating a file under roles directory for eg : roles/role_file.rb&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;This file is composed of &lt;br /&gt;
:name : defines the node. &lt;br /&gt;
:description: describes about the node. &lt;br /&gt;
:attributes: attributes specific to the node which needs to be configured. &lt;br /&gt;
:run lists: tasks assigned to the node. &lt;br /&gt;
:Sample-&lt;br /&gt;
[[File:codeMongo.JPG]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;This file is then uploaded to the chef server using following command:&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife role from file roles/redis.rb&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;li&amp;gt;Role is assigned to the server during bootstrap(explained in next section) using command :&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  knife ec2 server create&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/li&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
Pre-requisites : IP address / FQDN of the node&lt;br /&gt;
&lt;br /&gt;
Run the knife bootstrap command&lt;br /&gt;
&lt;br /&gt;
The knife bootstrap command requires the FQDN or the IP address for the node in order to complete the bootstrap operation. Run the knife bootstrap command. It checks for .pem files for authentication. If not present then the node goes through the registration phase in order to establish connection between the client and the server and for exchange of authorized messages. The attributes set in the role of the node are compared against the configuration details of the node and run contents of that role’s run list are applied to the node’s configuration details.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
&lt;br /&gt;
There are many other infrastructure management tools-&lt;br /&gt;
&lt;br /&gt;
# Juju - Ubuntu juju is a tool for virtual infrastructure automation&lt;br /&gt;
# Cfengine is a much older tool that is used for large scale infrastructure automation. Puppet was originally inspired by Cfengine.&lt;br /&gt;
# SaltStack - this is another configuration management system written in Python&lt;br /&gt;
&lt;br /&gt;
This is by no means an exhaustive list and is one that is growing - reflecting the trend towards heavier and more all encompassing automation.&lt;br /&gt;
&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76414</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76414"/>
		<updated>2013-09-17T00:27:06Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Compare */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation: &lt;br /&gt;
:::* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:::* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
# Create Cookbooks:&lt;br /&gt;
:::* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
:::knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::eg: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:::Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:::* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
:::knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:::The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:::To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76404</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76404"/>
		<updated>2013-09-17T00:22:32Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Authentication Information Deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation: &lt;br /&gt;
:::* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:::* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
# Create Cookbooks:&lt;br /&gt;
:::* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
:::knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::    eg: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:::Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:::*In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
:::    knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:::The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:::To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76403</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76403"/>
		<updated>2013-09-17T00:21:13Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation: &lt;br /&gt;
:::* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:::* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
# Create Cookbooks:&lt;br /&gt;
:::* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
:::knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::    eg: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:::Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:::*In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
:::    knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:::The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:::To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76402</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76402"/>
		<updated>2013-09-17T00:20:55Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation: &lt;br /&gt;
:::* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:::* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
# Create Cookbooks:&lt;br /&gt;
:::* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
:::knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::    eg: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:::Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:::*In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
:::    knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:::The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:::To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76401</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76401"/>
		<updated>2013-09-17T00:20:03Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Chef */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation: &lt;br /&gt;
:::* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:::* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
# Create Cookbooks:&lt;br /&gt;
:::* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
:::knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::    eg: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:::Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:::*In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
:::    knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:::The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:::To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=76397</id>
		<title>CSC/ECE 517 Fall 2013/rails infrastructure management tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=76397"/>
		<updated>2013-09-17T00:18:46Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Overview of Chef */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation: &lt;br /&gt;
:::* Pre-requisites : The workstation must have a Virtual box , vagrant(command line interface tool), Git( needed for Version Control Systems)&lt;br /&gt;
:::* Use knife client command to establish an API client identity for the workstation in order to make authenticated requests to the server. Setup chef-repo in the workstation.&lt;br /&gt;
# Create Cookbooks:&lt;br /&gt;
:::* In order to use community cookbooks one can just run the following command:&lt;br /&gt;
&lt;br /&gt;
:::knife cookbook site install &amp;lt;cook_name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:::eg: knife cookbook site install apt.&lt;br /&gt;
&lt;br /&gt;
:::Note: Chef has maintained a list of community cookbooks which are commonly covered under the use cases like apache2, mysql,php. So a user can leverage the community cookbooks instead of creating their own cookbooks. &lt;br /&gt;
&lt;br /&gt;
:::* In order to create our own cookbook:&lt;br /&gt;
&lt;br /&gt;
:::knife cookbook create cookbook_name&lt;br /&gt;
&lt;br /&gt;
:::The file default.rb in the path chef-repo/cookbooks/aliases/recipes/default.rb can be edited in order to create recipes.&lt;br /&gt;
&lt;br /&gt;
:::To make these cookbooks available to the nodes, it is first uploaded in the chef server.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
== Provision and setup a node ==&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76383</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76383"/>
		<updated>2013-09-17T00:12:43Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Resources */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
    resource_type { 'resource_tile':&lt;br /&gt;
           attribute_1 =&amp;gt; value_1,&lt;br /&gt;
           attribute_2 =&amp;gt; value_2,&lt;br /&gt;
           …..&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
    service { 'rails s':&lt;br /&gt;
       ensure =&amp;gt; 'running'&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76382</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76382"/>
		<updated>2013-09-17T00:10:38Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
  include mongodb&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76381</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76381"/>
		<updated>2013-09-17T00:10:14Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
  class  { ‘mongodb’ :&lt;br /&gt;
   init =&amp;gt; ‘sysv’,  &lt;br /&gt;
   version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  include mongodb&lt;br /&gt;
&lt;br /&gt;
  # custom puppet code as per our requirments&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76378</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76378"/>
		<updated>2013-09-17T00:09:20Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Overview of Chef */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
Opscode Chef is an infrastructure automation and configuration management framework.&lt;br /&gt;
&lt;br /&gt;
Chef is used for configuration, deployment and scalability of servers and applications for eg: it can be used to deploy and manage network in cloud, on-site or a hybrid one with n number of servers. This helps organization to save time, solve mission-critical challenges, accelerate time to market, manage scale and complexity, and safeguard systems. &lt;br /&gt;
&lt;br /&gt;
Chef client works using the abstraction definitions know as cookbooks and recipes that are written in Ruby. Chef client uses this definitions to build and manage servers in an infrastructure. &lt;br /&gt;
== Elements ==&lt;br /&gt;
Basically an organization consists of following elements with chef configuration:&lt;br /&gt;
&lt;br /&gt;
# Node : Any physical, virtual server is referred to as node.&lt;br /&gt;
# Knife : An interface between the local chef-repo and the server is known as knife. It is a command line tool using which users can manage other elements of the setup.&lt;br /&gt;
# Workstation : It is a computer used to interact with the single server. It is also used by users to run the knife command.&lt;br /&gt;
# Repository : usually referred as chef repo is the location wher all data objects are stored like cookbooks, configuration files etc.&lt;br /&gt;
# Hoster server: The stores manages cookbooks and all the configuration details that need to be applied to nodes. &lt;br /&gt;
# Chef-client : Chef client acts as an interface between the node and hosted server. Node gets all the configuration details from server via the client. &lt;br /&gt;
# Cookbook : Cookbook stores the configuration details depending upon the scenario for eg: in order to install Apache Tomcat server it contains details about installation, upgradation, components needed to support the server.&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76359</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76359"/>
		<updated>2013-09-16T23:54:38Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same manifest file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76357</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76357"/>
		<updated>2013-09-16T23:54:18Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
   file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same conf file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76356</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76356"/>
		<updated>2013-09-16T23:53:50Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet files are treated as resources. So we could specify for an NFS node as follows-&lt;br /&gt;
&lt;br /&gt;
file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; &amp;quot;/some/path 192.168.100.1(rw,sync)”,&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
However the content would be different for different nodes as the environment would change.&lt;br /&gt;
&lt;br /&gt;
Instead of creating a different resource for each template Puppet supports templatization of config files using Embedded Ruby (ERB).&lt;br /&gt;
&lt;br /&gt;
We can re-write the same resource as follows-&lt;br /&gt;
&lt;br /&gt;
file {'mount_conf':&lt;br /&gt;
      path    =&amp;gt; '/etc/exports',&lt;br /&gt;
      ensure  =&amp;gt; present,&lt;br /&gt;
      mode    =&amp;gt; 0777,&lt;br /&gt;
      content =&amp;gt; template(“nfs/mount_conf.erb”),&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
where the mount_conf.erb file would contain Embedded Ruby code along with the appropriate Ruby variables which would automatically be compiled to give the right values to produce the conf file.&lt;br /&gt;
&lt;br /&gt;
We can apply this same conf file to all nodes across all the instances.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76307</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76307"/>
		<updated>2013-09-16T23:34:28Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Foreman */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:env.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Env.png&amp;diff=76303</id>
		<title>File:Env.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Env.png&amp;diff=76303"/>
		<updated>2013-09-16T23:34:07Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76282</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76282"/>
		<updated>2013-09-16T23:26:12Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Foreman */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:host_listing.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Host_listing.png&amp;diff=76279</id>
		<title>File:Host listing.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Host_listing.png&amp;diff=76279"/>
		<updated>2013-09-16T23:25:54Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76274</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76274"/>
		<updated>2013-09-16T23:24:23Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Foreman */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
Foreman is a popular tool that is used in conjunction with Puppet. It provides a Web based GUI that lets users manage Puppet nodes.&lt;br /&gt;
&lt;br /&gt;
As an example the following screenshot illustrates how Foreman can be used to manage multiple nodes across multiple environments-&lt;br /&gt;
&lt;br /&gt;
[[File:http://theforeman.org/static/images/screenshots/host_listing.png]]&lt;br /&gt;
&lt;br /&gt;
We can apply various filters here to narrow down on a particular instance or conversely modify multiple nodes at the same time.&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76177</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76177"/>
		<updated>2013-09-16T22:37:12Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Authentication and key deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication Information Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76175</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76175"/>
		<updated>2013-09-16T22:36:41Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Config files deployment */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config Files Deployment ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Work ===&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76174</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76174"/>
		<updated>2013-09-16T22:36:08Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Node management - foreman and chef */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node Management ==&lt;br /&gt;
&lt;br /&gt;
=== Foreman ===&lt;br /&gt;
&lt;br /&gt;
=== Knife ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76169</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76169"/>
		<updated>2013-09-16T22:35:02Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Overview of Puppet */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76166</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76166"/>
		<updated>2013-09-16T22:34:11Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Configure a Node */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76163</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=76163"/>
		<updated>2013-09-16T22:33:38Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Provision and setup a node */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
== Setting Up A Node ==&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
In Puppet once we have identified what will go into defining something that we will need an instance for - as we have seen above say configuring a MongoDB instance - we need to select a fresh instance and apply the manifest to it.&lt;br /&gt;
&lt;br /&gt;
As we have seen Puppet Agents will automatically sync with the Puppet Master. So the only task left for us is to &lt;br /&gt;
&lt;br /&gt;
# Provision a new instance&lt;br /&gt;
# Install Puppet on it&lt;br /&gt;
# Classify it as a particular type of node.&lt;br /&gt;
&lt;br /&gt;
The last two commands can be combined using the puppet init command-&lt;br /&gt;
&lt;br /&gt;
puppet node init \&lt;br /&gt;
--node-group=db \&lt;br /&gt;
…. ( login related options)&lt;br /&gt;
ec2-71-73-79-83.compute-1.amazonaws.com&lt;br /&gt;
&lt;br /&gt;
Here we have specified the fresh instance and initialized as belonging to the group of nodes as db.&lt;br /&gt;
&lt;br /&gt;
Once this process is done the instance will be classified as a db instance and will automatically begin syncing with the Puppet Master.&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=75731</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w10 ga</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w10_ga&amp;diff=75731"/>
		<updated>2013-09-15T21:30:57Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: Created page with &amp;quot;= Introduction =  Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size an...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
== Provision and setup a node ==&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013&amp;diff=75730</id>
		<title>CSC/ECE 517 Fall 2013</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013&amp;diff=75730"/>
		<updated>2013-09-15T21:30:11Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[ CSC/ECE 517 Fall 2012/ch1 1w23 ph ]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w30 nn]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w21 w]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w01 aj]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w24 nv]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w29 rkld]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w25 avam]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w30 ps]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w19 rj]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w18 bs]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w17 pk]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w22 ss]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w12 vn]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w14 st]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w08 cc]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w09 hs ]]&lt;br /&gt;
* [[ CSC/ECE 517 Fall 2013/ch1 1w10 ga ]]&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75644</id>
		<title>CSC/ECE 517 Fall 2013/rails infrastructure management tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75644"/>
		<updated>2013-09-15T04:56:49Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Configure a role */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a Node ==&lt;br /&gt;
&lt;br /&gt;
Our sample project will be using MongoDB. So the next task will be setting up the MongoDB instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
As we have seen in Puppet a machine’s configuration is specified in terms of resources. To tell Puppet to set up those resources on a machine we use a Manifest that consists of various resources.&lt;br /&gt;
&lt;br /&gt;
But setting up a Manifest that covers all the Resources will quickly become unwieldly.&lt;br /&gt;
&lt;br /&gt;
Which is why Puppet uses Classes and Modules.&lt;br /&gt;
&lt;br /&gt;
A Class is a named collection of resources. A Module encloses a Class and is something that can be included in other Puppet files thus enabling reuse. There is a large collection of Modules called the Puppet Forge that has been written covering different type of uses.&lt;br /&gt;
&lt;br /&gt;
Thus setting up a manifest for a MongoDB server is as simple as-&lt;br /&gt;
&lt;br /&gt;
class  { ‘mongodb’ :&lt;br /&gt;
init =&amp;gt; ‘sysv’, &lt;br /&gt;
version =&amp;gt; ‘1.1.1’ # installing a specific version of mongodb&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
include mongodb&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;# custom puppet code as per our requirments&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Thus different Classes can be written which use different Modules for different uses. We can define a different class for our web server , for our file share and so on.&lt;br /&gt;
&lt;br /&gt;
Once a Class has been defined by us that is tailor made to our uses setting up more instances is simply a question of provisioning the node and running the Puppet class on it.&lt;br /&gt;
&lt;br /&gt;
This supports quick and simple scaling up.&lt;br /&gt;
&lt;br /&gt;
== Provision and setup a node ==&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75643</id>
		<title>CSC/ECE 517 Fall 2013/rails infrastructure management tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75643"/>
		<updated>2013-09-15T04:53:52Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
Infrastructure Managment Tools are becoming more widely used today and it is a skill set that is growing rapidly in development. With systems growing in size and complexity automated tools are becoming the norm as opposed to the exception.&lt;br /&gt;
&lt;br /&gt;
Here we shall compare two popular Infrastructure Management Tools-&lt;br /&gt;
&lt;br /&gt;
* Puppet&lt;br /&gt;
* Chef&lt;br /&gt;
&lt;br /&gt;
We shall begin with an initial overview of both tools to familiarize the reader. We will then take a hypothetical scenarion and try and solve the problems in those scenario using Puppet and Chef.&lt;br /&gt;
&lt;br /&gt;
We will then compare the solutions and compare how each tool handles the same problem. We do not intend to categorically state the superiority or suitability of one tool over the other but to illustrate their usage and let the reader choose them as per her/his need.&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a role ==&lt;br /&gt;
== Provision and setup a node ==&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75642</id>
		<title>CSC/ECE 517 Fall 2013/rails infrastructure management tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75642"/>
		<updated>2013-09-15T04:45:16Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* Headline text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a role ==&lt;br /&gt;
== Provision and setup a node ==&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Other Infrastructure Management Tools =&lt;br /&gt;
= Conclusion =&lt;br /&gt;
= Further Reading =&lt;br /&gt;
= References =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75641</id>
		<title>CSC/ECE 517 Fall 2013/rails infrastructure management tools</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/rails_infrastructure_management_tools&amp;diff=75641"/>
		<updated>2013-09-15T04:42:39Z</updated>

		<summary type="html">&lt;p&gt;Grmenon: /* How They Compare */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
= Overview of Puppet =&lt;br /&gt;
&lt;br /&gt;
Puppet is a Infrastructure Management tool written in Ruby. It's primary use is to manage the setup and configurations of machines or instances. For this reason it is widely used by system administrators and DevOps personnel to setup and maintain systems.&lt;br /&gt;
&lt;br /&gt;
Puppet works in two fundamental modes - &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Serverless Puppet ==&lt;br /&gt;
&lt;br /&gt;
In Serverless Puppet each instance with Puppet installed is standalone i.e is independent and running without external supervision.&lt;br /&gt;
&lt;br /&gt;
Effectively there are two processes-&lt;br /&gt;
&lt;br /&gt;
# A master process&lt;br /&gt;
# An agent process&lt;br /&gt;
&lt;br /&gt;
The master process consumes the configuration requirements fed it via Puppet and the agent applies it. Here the particular instance running Puppet has complete access to it's own configuration information.&lt;br /&gt;
&lt;br /&gt;
== Master / Agent Puppet ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is a typical client server pattern.&lt;br /&gt;
&lt;br /&gt;
Here there is a central Master Puppet instance. This master instance contains the configuration information for all the Agent Puppet instances.&lt;br /&gt;
&lt;br /&gt;
The Agent puppets are configured to periodically inform the Master with “Facts” which is basically information about the current state of the Puppet configuration.&lt;br /&gt;
&lt;br /&gt;
The Master Puppet compares the state of each Agent with what it actually should be and sends it a “Catalog” which tells the Agent how it should configure itself.&lt;br /&gt;
&lt;br /&gt;
After the Agent receives the Catalog and does the required changes it Reports back to the Master informing it of the status of the changes.&lt;br /&gt;
&lt;br /&gt;
A point here to note is that no Agent can see the configuration information of other Agents except it's own which it receives via the Catalog from the Master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
INSERT DIAGRAM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
Up till now we have been discussing the “configuration” a machine in abstract terms. This is where one of the key features of Puppet comes up.&lt;br /&gt;
&lt;br /&gt;
Puppet treats the configuration of each machine as being made up of atomic units called Resources.&lt;br /&gt;
&lt;br /&gt;
A resource can be -&lt;br /&gt;
&lt;br /&gt;
*A file that needs to present at a particular location, with particular permissions, having some  content etc&lt;br /&gt;
*A package that needs to be     installed    &lt;br /&gt;
*A service that needs to be running&lt;br /&gt;
&lt;br /&gt;
and so on.&lt;br /&gt;
&lt;br /&gt;
Puppet has a declarative DSL wherein a resource can be described which is in the following format-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;resource_type { 'resource_tile':&lt;br /&gt;
    attribute_1 =&amp;gt; value_1,&lt;br /&gt;
    attribute_2 =&amp;gt; value_2,&lt;br /&gt;
    …..&lt;br /&gt;
}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example would be -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;service { 'rails s':&lt;br /&gt;
    ensure =&amp;gt; 'running'&lt;br /&gt;
    }&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We would include this resource as part of our Rails server configuration to ensure that our server is always running.&lt;br /&gt;
&lt;br /&gt;
The attributes vary depending on the type of the resource and the values belong to range depending on the attribute and the resource type.&lt;br /&gt;
&lt;br /&gt;
A very key feature to be noted here that Puppet focuses on the WHAT instead of the HOW.&lt;br /&gt;
&lt;br /&gt;
What does this mean? Let us take the above example – the command to start a process would be different depending on the OS. But Puppet abstracts that complexity for us – we need only tell it HOW we want the machine to be i.e we want a particular process running and Puppet handles the rest – we tell it the state we want it to be and Puppet makes it so.&lt;br /&gt;
&lt;br /&gt;
= Overview of Chef =&lt;br /&gt;
&lt;br /&gt;
= The Scenario =&lt;br /&gt;
&lt;br /&gt;
The scenario we will be using for the purposes of this comparison will be one that is a very prevalent one - a large scale web application infrastructure. We shall assume that the web application under discussion is being developed used Rails though this does not overly affect the infrastructure management - it is equally applicable to other frameworks.&lt;br /&gt;
&lt;br /&gt;
The specific requirements of this sample project are as follows-&lt;br /&gt;
&lt;br /&gt;
* Zero downtime - the website's operation is a critical part of the client's business model. They require that the website should have zero downtime which means the infrastrucutre must handle failures, deployment and maintenance without interrupting the site's operation.&lt;br /&gt;
&lt;br /&gt;
* Large scale - The client anticipates a very high and dynamic load on the site which means the site should adapt to user demand and the infrastructure should be able to handle the required performance.&lt;br /&gt;
&lt;br /&gt;
* System Integration - The project is being built to be integrated with the client's legacy systems and need to integrate with them. The infrastructure must support the connection between these systems.&lt;br /&gt;
&lt;br /&gt;
= Tasks: Use Cases =&lt;br /&gt;
&lt;br /&gt;
To achieve the above goals various tasks need to be accomplished. We shall look at each of these tasks in turn and see how they can be accomplished using Puppet and Chef and compare them in each use case.&lt;br /&gt;
&lt;br /&gt;
== Installation and Setup ==&lt;br /&gt;
&lt;br /&gt;
As part of our example scenario we shall assume that our environment consists of a collection of Amazon Web Services (AWS) instances.&lt;br /&gt;
&lt;br /&gt;
=== Puppet ===&lt;br /&gt;
&lt;br /&gt;
Puppet can be installed via packages for debian and yum based systems. The package source need only be configured the normal way and the package to be installed.&lt;br /&gt;
&lt;br /&gt;
A particular instance needs to be chosen as the Puppet Master and the puppet-server package needs to be installed on it.&lt;br /&gt;
&lt;br /&gt;
The remaining instances need to have the puppet package installed on it.&lt;br /&gt;
&lt;br /&gt;
Once that is the Puppet Master needs to be configured with a valid host name. Then the agent nodes need to be configured to point to the host name of the server.&lt;br /&gt;
&lt;br /&gt;
Finally the Puppet Master needs to sign of on the certificate of each Puppet Agent that will communicate with it as all the communication between the Puppet nodes is encrypted and the services of the master and agent nodes need to be started&lt;br /&gt;
&lt;br /&gt;
=== Chef ===&lt;br /&gt;
&lt;br /&gt;
# Install chef server on the server machine&lt;br /&gt;
# Setup workstation:&lt;br /&gt;
## Setup chef-repo in the workstation.&lt;br /&gt;
## The machine needs to have access to the server, as well one of the chef clients machine which can act as the first node.&lt;br /&gt;
# Setup chef client: Using knife tool in workstation, chef clients are setup on nodes.&lt;br /&gt;
&lt;br /&gt;
=== How They Compare ===&lt;br /&gt;
&lt;br /&gt;
''Similarities''&lt;br /&gt;
&lt;br /&gt;
* Separate packages need to be installed for the client/agent and server/master for Chef and Puppet respectively&lt;br /&gt;
* Both use SSL encryption to communicate&lt;br /&gt;
&lt;br /&gt;
''Differences''&lt;br /&gt;
&lt;br /&gt;
* Puppet uses hostnames to uniquely identify whereas Chef uses Fully Qualified Domain Names&lt;br /&gt;
* With Puppet each individual node has to be accessed for the installation.However with Chef installation of an agent node can be done remotely&lt;br /&gt;
* With Chef a chef-repo needs to be installed on a workstation to use various Chef tools but with Puppet the puppet package is sufficient&lt;br /&gt;
&lt;br /&gt;
== Configure a role ==&lt;br /&gt;
== Provision and setup a node ==&lt;br /&gt;
== Node management - foreman and chef ==&lt;br /&gt;
== Config files deployment ==&lt;br /&gt;
&lt;br /&gt;
- NFS mounting,network, security-configuration of netowrk restrictions and Ip restrictions.&lt;br /&gt;
&lt;br /&gt;
== Authentication and key deployment ==&lt;br /&gt;
&lt;br /&gt;
Environment setup&lt;br /&gt;
&lt;br /&gt;
= Headline text =&lt;/div&gt;</summary>
		<author><name>Grmenon</name></author>
	</entry>
</feed>