SlideShare a Scribd company logo
1 of 41
Capistrano, Puppet,
        and Chef
Automating App Deployment & Config Management
These tools have to do with

• Application Deployment
• Configuration Management
These are different.

Discuss.
In the beginning there was


 scp : application deployment


 ssh : configuration management

before things got complicated
Let's talk about


 Application Deployment
simplest application deployment


 1. scp app to production box.


 2. Restart server. (optional)


 3. Profit!
But there are always complications, like

“unpack app into a particular directory”

“scrub lock files or workspace directories”

“run database upgrade/tweak scripts”
These additional bits were usually done


 a) by hand (ssh)


 b) with deploy scripts living on the servers


 c) or not done at all (oops!)
Capistrano
www.capify.org

Introduced around 2006
by Jamis Buck of 37Signals

written in Ruby, initally for Rails projects.
Mainly because ruby on rails, particularly in
production settings, had to use a ruby server
called "mongrel" which was fast, but an
absolute pain to restart. PAIN.
Simplest Explanation

• Lets you to write scripts that say "ssh
  onto this machine and do this thing."
• You don't have to have magic scripts living
  on your servers, they can be source.
• You can start being clever, and
  programming your deployment actions.
Simple "capfile" example
Simple "capfile" with "roles", you get the idea
Nice things Capistrano introduced:


 Automate deploys with ONE set of files


 The files DON’T have to live on the
production server


 The language (Ruby) allows some abstraction
and finesse not available in blunt force shell
scripting
Now the application deployment step can be
coded and tested like the rest of the project.
And the deployment scripts can be
strengthened, we all happy. Example:
Unfortunately, Capistrano's future looks a little
uncertain (in 2011). The project page redirects to
a github page, which points to stale
documentation. It seems widely used, but not well
supported.

May be a bit like CruiseControl (the early
awesome build server) the tool may have hit its
"use by" date.

Not sure what the successor is. Vlad The
Deployer? (http://rubyhitsquad.com/
Vlad_the_Deployer.html)
OK
Let's talk about


 Configuration Management
This is where, on a new machine, you make sure


   your apache's got mods


   your ruby's got gems


   your php's got pears


   your java's got...version

All those things you remember, or forget, and then...
This happens a lot:


 One person knows how all the servers get configured. One
awesome person.


   or


 Each server gets set up differently depending on who set them
up. Awesomeness not a requirement. Medication helps.


   and


 Server setups are build by hand (ssh, ssh, ssh) from memory (or
checklists written on forearms).
This (sort of ) worked a little OK when
servers were physical, so setting them up
was a special magic ceremony.
But when servers became virtual, the magic
wore off, and the underlying dumbness shone
through.
Even for small projects, why can't we have:

• 
 Configurations defined in source.
• 
 Repeatable, consistent configs through
  test, stage, & production.

• 
 Smart configurations that, say, enforce
  version levels and don't forget libraries.

  Why?
Puppet

http://www.puppetlabs.com

written in Ruby, evolved from cfengine
"Puppet is typically (but not always) used in a
client/server formation, with all of your
clients talking to one or more central
servers. Each client contacts the server
periodically (every half hour, by default),
downloads the latest configuration, and
makes sure it is in sync with that
configuration. Once done, the client can send
a report back to the server indicating if
anything needed to change."
The server is called the "Puppet Master".
Creepy, but cool.
idempotent                             |ˈīdemˌpōtənt| Mathematics

adjective

denoting an element of a set that is unchanged in value when multiplied or otherwise
operated on by itself.

noun

an element of this type.

ORIGIN late 19th cent.: from Latin idem ‘same’ + potent 1 .

The term can also be used to describe an initialisation subroutine that is arranged to
perform some critical action exactly once, even if the routine is called several times.

[ Jargon File]
Simple example of a Puppet class

class ntp {
    package { "ntp":
        ensure => installed
    }
    service { "ntp":
        ensure => running,
    }
}
Simple example of a node description

node myserver {
    include ntp
}

This instructs puppet to make sure ntp is installed
and running on "myserver"

(I left out the definition of "ntp" as a "resource". A
big part of the Puppet DSL is a rich ability to define
resources, their files, locations, permissions, just
about everything about them.)
Puppet manifests are declarative, as opposed
to imperative.

The DSL is not Ruby, as you're not writing
scripts, you're writing definitions.

Install order is determined through
dependencies.
And being idempotent, the puppet master
will make sure the systems match the
definitions.

This is kind of cool, in that you can
implement changes across machines
automatically just by updating the manifext in
the puppet master.

Kind of scary, kind of cool.
Chef

http://www.opscode.com/chef/

written in ruby, evolved from Puppet
Chef is built around a chef server, which
  contains

• 
 deployment scripts (called cookbooks and
  recipes)

• 
 config instructions for machines (called
  nodes)

• 
 security details for all (pem pem pem)
You start with an empty machine

install enough stuff to run chef-client (ruby,
chef)

and then run...chef-client
As with Puppet, it is idempotent, so you can
re-run it again and again to confirm or update
config.

Chef recipes are imperitive, as opposed to
declarative.

The DSL is extended Ruby, so you can write
scripts, as well as definitions.

Install order is determined through script
order, no dependency checking.
Chef vs Puppet
(This appears to be a big debate, like we
need that)
“Chef vs. Puppet”

"Declarative" vs "Imperative"... oh, shoot me now.

(IMHO) Devs like Chef, because they can script it

(IMHO) Ops like Puppet, because its a set of
rules

Both sides claim the other is "too complicated".

Go figure.
What next?

There are a number of other tools in the space:

App Deploy: Capistrano, ControlTier, Fabric, Func, mCollective

SysConfig: Bcfg2, Chef, Puppet, cfengine, Smart Frog

Cloud/VM: Xen, Ixc, openVZ, Eucalyptus, KVM

OS Install: Kickstart, Jumpstart, Cobbler, OpenQRM, xCAT

Hard for them to get momentum & critical mass?

We may get further definition, hopefully simplification.
Summing up

Application Deployment.

Configuration Management

Its nice to know these can be described in
code, checked into source code control,
tested, and then deployed.

I mean it is really nice!
Questions?
Thanks!

More Related Content

What's hot

Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 

What's hot (20)

Capistrano
CapistranoCapistrano
Capistrano
 
Capistrano - Deployment Tool
Capistrano - Deployment ToolCapistrano - Deployment Tool
Capistrano - Deployment Tool
 
Jenkins and Docker for native Linux packages
Jenkins and Docker for native Linux packagesJenkins and Docker for native Linux packages
Jenkins and Docker for native Linux packages
 
A quick intro to Ansible
A quick intro to AnsibleA quick intro to Ansible
A quick intro to Ansible
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Deploy your Python code on Azure Functions
Deploy your Python code on Azure FunctionsDeploy your Python code on Azure Functions
Deploy your Python code on Azure Functions
 
Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistrano
 
Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11Capifony. Minsk PHP MeetUp #11
Capifony. Minsk PHP MeetUp #11
 
Basics of Ansible - Sahil Davawala
Basics of Ansible - Sahil DavawalaBasics of Ansible - Sahil Davawala
Basics of Ansible - Sahil Davawala
 
Continuous Deployment at Spreaker
Continuous Deployment at SpreakerContinuous Deployment at Spreaker
Continuous Deployment at Spreaker
 
Testing Ansible with Jenkins and Docker
Testing Ansible with Jenkins and DockerTesting Ansible with Jenkins and Docker
Testing Ansible with Jenkins and Docker
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Managing Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with AnsibleManaging Your Cisco Datacenter Network with Ansible
Managing Your Cisco Datacenter Network with Ansible
 
Painless Deployment with Capistrano
Painless Deployment with CapistranoPainless Deployment with Capistrano
Painless Deployment with Capistrano
 
Ansible with AWS
Ansible with AWSAnsible with AWS
Ansible with AWS
 
Ansible 2.2
Ansible 2.2Ansible 2.2
Ansible 2.2
 
Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)Composer Tutorial (PHP Hampshire Sept 2013)
Composer Tutorial (PHP Hampshire Sept 2013)
 
Ansible on AWS
Ansible on AWSAnsible on AWS
Ansible on AWS
 
Big data and hadoop training - Session 5
Big data and hadoop training - Session 5Big data and hadoop training - Session 5
Big data and hadoop training - Session 5
 
Using filesystem capabilities with rsync
Using filesystem capabilities with rsyncUsing filesystem capabilities with rsync
Using filesystem capabilities with rsync
 

Similar to Capistrano, Puppet, and Chef

Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)
Puppet
 
Automated shutdown
Automated shutdownAutomated shutdown
Automated shutdown
Mario Berend
 

Similar to Capistrano, Puppet, and Chef (20)

Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Cloudops fundamentals management, tdd, test driven design, continuous integra...
Cloudops fundamentals management, tdd, test driven design, continuous integra...Cloudops fundamentals management, tdd, test driven design, continuous integra...
Cloudops fundamentals management, tdd, test driven design, continuous integra...
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Using Puppet in Small Infrastructures
Using Puppet in Small InfrastructuresUsing Puppet in Small Infrastructures
Using Puppet in Small Infrastructures
 
Automated Deployment using Open Source
Automated Deployment using Open SourceAutomated Deployment using Open Source
Automated Deployment using Open Source
 
Kubernetes for the PHP developer
Kubernetes for the PHP developerKubernetes for the PHP developer
Kubernetes for the PHP developer
 
Introduction to LAVA Workload Scheduler
Introduction to LAVA Workload SchedulerIntroduction to LAVA Workload Scheduler
Introduction to LAVA Workload Scheduler
 
Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)Getting started with puppet and vagrant (1)
Getting started with puppet and vagrant (1)
 
Automating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and AnsibleAutomating the Cloud with Terraform, and Ansible
Automating the Cloud with Terraform, and Ansible
 
Migraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sitesMigraine Drupal - syncing your staging and live sites
Migraine Drupal - syncing your staging and live sites
 
Automated shutdown
Automated shutdownAutomated shutdown
Automated shutdown
 
Fabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymoreFabric8 - Being devOps doesn't suck anymore
Fabric8 - Being devOps doesn't suck anymore
 
Austin Web Architecture
Austin Web ArchitectureAustin Web Architecture
Austin Web Architecture
 
Aucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricksAucklug slides - desktop tips and tricks
Aucklug slides - desktop tips and tricks
 
Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2Configuring Your First Hadoop Cluster On EC2
Configuring Your First Hadoop Cluster On EC2
 
A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)A Tale of a Server Architecture (Frozen Rails 2012)
A Tale of a Server Architecture (Frozen Rails 2012)
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Advanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutesAdvanced technic for OS upgrading in 3 minutes
Advanced technic for OS upgrading in 3 minutes
 
Ansible & Salt - Vincent Boon
Ansible & Salt - Vincent BoonAnsible & Salt - Vincent Boon
Ansible & Salt - Vincent Boon
 

Recently uploaded

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Capistrano, Puppet, and Chef

  • 1. Capistrano, Puppet, and Chef Automating App Deployment & Config Management
  • 2. These tools have to do with • Application Deployment • Configuration Management These are different. Discuss.
  • 3. In the beginning there was scp : application deployment ssh : configuration management before things got complicated
  • 4. Let's talk about Application Deployment
  • 5. simplest application deployment 1. scp app to production box. 2. Restart server. (optional) 3. Profit!
  • 6. But there are always complications, like “unpack app into a particular directory” “scrub lock files or workspace directories” “run database upgrade/tweak scripts”
  • 7. These additional bits were usually done a) by hand (ssh) b) with deploy scripts living on the servers c) or not done at all (oops!)
  • 8. Capistrano www.capify.org Introduced around 2006 by Jamis Buck of 37Signals written in Ruby, initally for Rails projects.
  • 9. Mainly because ruby on rails, particularly in production settings, had to use a ruby server called "mongrel" which was fast, but an absolute pain to restart. PAIN.
  • 10. Simplest Explanation • Lets you to write scripts that say "ssh onto this machine and do this thing." • You don't have to have magic scripts living on your servers, they can be source. • You can start being clever, and programming your deployment actions.
  • 12. Simple "capfile" with "roles", you get the idea
  • 13. Nice things Capistrano introduced: Automate deploys with ONE set of files The files DON’T have to live on the production server The language (Ruby) allows some abstraction and finesse not available in blunt force shell scripting
  • 14. Now the application deployment step can be coded and tested like the rest of the project.
  • 15. And the deployment scripts can be strengthened, we all happy. Example:
  • 16. Unfortunately, Capistrano's future looks a little uncertain (in 2011). The project page redirects to a github page, which points to stale documentation. It seems widely used, but not well supported. May be a bit like CruiseControl (the early awesome build server) the tool may have hit its "use by" date. Not sure what the successor is. Vlad The Deployer? (http://rubyhitsquad.com/ Vlad_the_Deployer.html)
  • 17. OK
  • 18. Let's talk about Configuration Management
  • 19. This is where, on a new machine, you make sure your apache's got mods your ruby's got gems your php's got pears your java's got...version All those things you remember, or forget, and then...
  • 20. This happens a lot: One person knows how all the servers get configured. One awesome person. or Each server gets set up differently depending on who set them up. Awesomeness not a requirement. Medication helps. and Server setups are build by hand (ssh, ssh, ssh) from memory (or checklists written on forearms).
  • 21. This (sort of ) worked a little OK when servers were physical, so setting them up was a special magic ceremony.
  • 22. But when servers became virtual, the magic wore off, and the underlying dumbness shone through.
  • 23. Even for small projects, why can't we have: • Configurations defined in source. • Repeatable, consistent configs through test, stage, & production. • Smart configurations that, say, enforce version levels and don't forget libraries. Why?
  • 25. "Puppet is typically (but not always) used in a client/server formation, with all of your clients talking to one or more central servers. Each client contacts the server periodically (every half hour, by default), downloads the latest configuration, and makes sure it is in sync with that configuration. Once done, the client can send a report back to the server indicating if anything needed to change."
  • 26. The server is called the "Puppet Master". Creepy, but cool.
  • 27. idempotent |ˈīdemˌpōtənt| Mathematics adjective denoting an element of a set that is unchanged in value when multiplied or otherwise operated on by itself. noun an element of this type. ORIGIN late 19th cent.: from Latin idem ‘same’ + potent 1 . The term can also be used to describe an initialisation subroutine that is arranged to perform some critical action exactly once, even if the routine is called several times. [ Jargon File]
  • 28. Simple example of a Puppet class class ntp { package { "ntp": ensure => installed } service { "ntp": ensure => running, } }
  • 29. Simple example of a node description node myserver { include ntp } This instructs puppet to make sure ntp is installed and running on "myserver" (I left out the definition of "ntp" as a "resource". A big part of the Puppet DSL is a rich ability to define resources, their files, locations, permissions, just about everything about them.)
  • 30. Puppet manifests are declarative, as opposed to imperative. The DSL is not Ruby, as you're not writing scripts, you're writing definitions. Install order is determined through dependencies.
  • 31. And being idempotent, the puppet master will make sure the systems match the definitions. This is kind of cool, in that you can implement changes across machines automatically just by updating the manifext in the puppet master. Kind of scary, kind of cool.
  • 33. Chef is built around a chef server, which contains • deployment scripts (called cookbooks and recipes) • config instructions for machines (called nodes) • security details for all (pem pem pem)
  • 34. You start with an empty machine install enough stuff to run chef-client (ruby, chef) and then run...chef-client
  • 35. As with Puppet, it is idempotent, so you can re-run it again and again to confirm or update config. Chef recipes are imperitive, as opposed to declarative. The DSL is extended Ruby, so you can write scripts, as well as definitions. Install order is determined through script order, no dependency checking.
  • 36. Chef vs Puppet (This appears to be a big debate, like we need that)
  • 37. “Chef vs. Puppet” "Declarative" vs "Imperative"... oh, shoot me now. (IMHO) Devs like Chef, because they can script it (IMHO) Ops like Puppet, because its a set of rules Both sides claim the other is "too complicated". Go figure.
  • 38. What next? There are a number of other tools in the space: App Deploy: Capistrano, ControlTier, Fabric, Func, mCollective SysConfig: Bcfg2, Chef, Puppet, cfengine, Smart Frog Cloud/VM: Xen, Ixc, openVZ, Eucalyptus, KVM OS Install: Kickstart, Jumpstart, Cobbler, OpenQRM, xCAT Hard for them to get momentum & critical mass? We may get further definition, hopefully simplification.
  • 39. Summing up Application Deployment. Configuration Management Its nice to know these can be described in code, checked into source code control, tested, and then deployed. I mean it is really nice!