SlideShare a Scribd company logo
CHEF, VAGRANT
AND FRIENDS
AUTOMATING YOUR ENVIRONMENTS
@benmcrae
• Software engineer
• CompareTheMarket.com
• Travelling & listening to music
• Coffee / real ale drinker
YOU?
MASTER CHEFS
SOFTWARE!
CONFIGURATION
MANAGEMENT
Chef can automate how you
configure, deploy and scale
your servers and applications.
GETTING
STARTED
Installing Chef 11
!
Chef Omnibus (Linux, OS X, Windows)
Chef DK (April 2014, v0.1.0) (Bundled software)
Gem (Ruby 1.9.3 recommended)
Chef CLI tools
ohai (node attributes)
chef-apply (execute a single recipe from the command line)
chef-solo (execute run lists and cookbooks on a node)
chef-client (retrieves & executes run lists & cookbooks on nodes)
knife (interact with chef server)
INFRASTRUCTURE
AS CODE
Resources
Resources represent a piece of the system and its
desired state. Some resources available:!
• Directories
• Users
• Groups
• Services
• Packages
Resource Syntax
A resource is a Ruby block with four components:
• A type
• A name
• One (or more) attributes (with values)
• One (or more) actions
Recipe
Recipes are what you write to install and configure
things on your machine.!
• Authored using a Ruby DSL
• Made from multiple resources
• Can include other recipes
• Single responsibility in purpose
• Belongs to a Cookbook
Recipe DSL
A Ruby DSL, with specific methods to write
chef recipes and resource blocks.
Common Ruby syntax can be used with the
Recipe DSL methods. if / case statements…
FIRST RECIPE
Ingredients
• Using chef-apply and a single recipe
• Create a new developer user on the system
• Install Git using the OS package manager
• Create a .gitconfig file for the developer user
stage-1
https://github.com/benmcrae/ddd-chef-examples/tree/master/stage-1
Chef Run
• Recipe loaded
• Resources are arranged in an ordered queue
• Each resource is mapped to a Provider!
• The node Converges by executing each provider
Providers
Providers define steps that are needed to
bring a piece of the system from its current
state into the desired state.
Idempotent
A recipe can run multiple times on the
same system and the results will always be
identical.
RETROSPECTIVE
Outcomes
• Poor single responsibility
• Use better suited resources e.g. template / file
• Fixed values could be swapped for attributes
Next Steps
1. Create cookbook from existing recipe
2. Refactor outcomes from retrospective
FIRST COOKBOOK
Cookbook
A cookbook defines a scenario, such as
everything needed to install and configure
Apache and the resources that support it.
Cookbook Folders
• attributes - attribute files, loaded in alphabetical order!
• files - stored files for file and directory resources!
• libraries - arbitrary ruby libraries, used in recipes!
• providers - custom providers (LWRP)!
• recipes - recipe files!
• resources - custom resources (LWRP)!
• templates - erb files for the template resource
Cookbook Generators
• knife cookbook create ‘cookbook name’
• berks cookbook ‘cookbook name’
Metadata File
• The metadata.rb sits in the cookbook root directory
• Defines cookbook name, version, and description
• Can declare dependencies on other cookbooks
• List supported operating systems
REFACTOR
Template Resource
• Uses ERB (Embedded Ruby) files
• Supports variables and hashes in templates
• Multi nested folders designed to support
distributing files across platforms
• Best practice: set variables using attributes
Node Object
• Attributes - An attribute is a specific piece of data
about the node!
• Run list - A run-list is an ordered list of recipes
and/or roles that are run in an exact order
Attributes
!
• Attributes can be defined by the node, recipes,
cookbooks, roles and environments!
• Node information. i.e. IP / MAC addresses, OS info
• Recipe information. i.e. directory paths, users,
application data
Overriding Attributes
Ohai
Ohai is a CLI tool that is used to detect attributes on a node!
• Platform details
• Network usage
• Memory usage
• Processor usage
Run List
• A run-list defines all of the configuration settings
that are necessary for a node to converge
• An ordered list of roles and/or recipes that are run
in an exact order
chef-solo
• chef-solo allows using cookbooks on nodes without
using Chef server
• Cookbooks & dependencies must be on the node
• Limited in functionality compared to chef-server
• Requires configuration; run-list and attributes
stage-2
https://github.com/benmcrae/ddd-chef-examples/tree/master/stage-2
Chef Run
• Builds node object!
• Expands run-list
• Compiles Resources in an ordered queue
• Each resource is mapped to a Provider!
• The node Converges by executing each provider
RETROSPECTIVE
Outcomes
• A single cookbook to manage our developer user
• A cookbook that can be used with both chef-solo
and chef-client (Chef Server)
Next Steps
• Introduce community cookbooks and Berkshelf
• Install Ruby 2.1.2, using Berkshelf
COMMUNITY
COOKBOOKS
Community Cookbooks
• An online Open Source cookbook repository,
maintained and used by the chef community.
• Trusted cookbooks can be downloaded from -
http://community.opscode.com
• Cookbook dependencies are not automatically
downloaded. This must be done by looking through
the cookbook metadata file, and manually
downloading listed cookbooks.
Berkshelf
• The cookbook dependency manager
• gem install berkshelf
• Used to maintain cookbooks on your Chef Server
• Written by Jamie Windsor, and Seth Vargo
Berksfile
• Lives in the root directory of the Cookbook
• Lists each cookbook name, and version (optional)
which your cookbook depends on
• Ability to read cookbook dependencies from
metadata.rb file
• Traverses over other cookbook dependencies
stage-3
https://github.com/benmcrae/ddd-chef-examples/tree/master/stage-3
RETROSPECTIVE
Outcomes
• Implemented a community cookbook with the aid of
Berkshelf.
• Applied our knowledge of attributes to other
cookbooks.
Next Steps
• Provision the node automatically with chef-solo and
Vagrant.
• Create a new recipe to git clone our ruby app into
the developer home directory.
• Create and configure lightweight, reproducible,
and portable development environments.
• Vagrant stands on the shoulders of giants.
Machines are provisioned on top of VirtualBox,
VMware, AWS, or any other provider.
• Provision machines with, shell scripts, Chef, or
Puppet.
Commands
• vagrant init hashicorp/precise32
• vagrant up
• vagrant provision
• vagrant halt
• vagrant destroy
Vagrant Provision
• Move the run list and attributes into the Vagrantfile
• Vagrant will run chef-solo on VM start, or by running
the provision command
Git Resource
• Manage source control resources that exist in a git
repository
• Functionality for revision and branching control
• Offers both export and syncing abilities
stage-4
https://github.com/benmcrae/ddd-chef-examples/tree/master/stage-4
RETROSPECTIVE
Outcomes
• Used Vagrant to run chef-solo and setup our node
• Established our cookbook development workflow
• Finished cookbook
VAGRANT CONT.
More Features
• Full support for both Linux and Windows guest’s
• Mount directories using either NFS, SMB or Rsync
• Multi machine environments
• Network support - port forwarding, private networks
Vagrant Cloud
• Share a link to your web server to a teammate
across the country
• Community collection of fully baked box images
• Distribute versionable private environments to your
team
Share / Connect
• Share SSH access to other vagrant users
• Share the whole machine as a local entity to other
vagrant users
Vagrant Plugins
• vagrant plugin install <plugin_name>
• vagrant-sahara (operate in a sandbox environment)
• vagrant-proxy (define http and https proxies)
Chef Reading
• Test-Driven Infrastructure with Chef, 2nd Edition

- Steven Nelson-Smith
• Chef Infrastructure Automation Cookbook 

- Matthias Marschall
• Learning Chef (Released Sep 2014)

- Seth Vargo, Mischa Taylor
• https://learnchef.opscode.com/
Vagrant Reading
• Vagrant: Up and Running - Mitchell Hashimoto
• http://docs.vagrantup.com/
• http://www.vagrantup.com/blog.html
THANK YOU

More Related Content

What's hot

Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Software, Inc.
 
Chef Patterns at Bloomberg Scale
Chef Patterns at Bloomberg ScaleChef Patterns at Bloomberg Scale
Chef Patterns at Bloomberg Scale
Chef
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)Puppet
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott Russel
Kangaroot
 
Chef
ChefChef
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Software, Inc.
 
Chef - managing yours servers with Code
Chef - managing yours servers with CodeChef - managing yours servers with Code
Chef - managing yours servers with Code
m_richardson
 
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsCLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
Zachary Stevens
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
Pravin Mishra
 
Chef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupChef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetup
mdxp
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
Jonathan Weiss
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Software, Inc.
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
Juan Vicente Herrera Ruiz de Alejo
 
Growing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large OrganizationGrowing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large Organization
Chef Software, Inc.
 
Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!
Vinícius Batista de Souza
 
Building a Better Mousetrap for the Cloud
Building a Better Mousetrap for the CloudBuilding a Better Mousetrap for the Cloud
Building a Better Mousetrap for the Cloudelliando dias
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with ChefJoe Kepley
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
Matt Ray
 

What's hot (20)

Chef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation SetupChef Fundamentals Training Series Module 2: Workstation Setup
Chef Fundamentals Training Series Module 2: Workstation Setup
 
Chef Patterns at Bloomberg Scale
Chef Patterns at Bloomberg ScaleChef Patterns at Bloomberg Scale
Chef Patterns at Bloomberg Scale
 
Puppet camp london nov 2014 slides (1)
Puppet camp london nov 2014   slides (1)Puppet camp london nov 2014   slides (1)
Puppet camp london nov 2014 slides (1)
 
CHEF - by Scott Russel
CHEF - by Scott RusselCHEF - by Scott Russel
CHEF - by Scott Russel
 
Cooking with Chef
Cooking with ChefCooking with Chef
Cooking with Chef
 
Chef
ChefChef
Chef
 
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
Chef Fundamentals Training Series Module 6: Roles, Environments, Community Co...
 
Chef in a nutshell
Chef in a nutshellChef in a nutshell
Chef in a nutshell
 
Chef - managing yours servers with Code
Chef - managing yours servers with CodeChef - managing yours servers with Code
Chef - managing yours servers with Code
 
CLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with JenkinsCLUG 2014-10 - Cookbook CI with Jenkins
CLUG 2014-10 - Cookbook CI with Jenkins
 
Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )Overview of chef ( Infrastructure as a Code )
Overview of chef ( Infrastructure as a Code )
 
Chef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupChef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetup
 
Infrastructure Automation with Chef
Infrastructure Automation with ChefInfrastructure Automation with Chef
Infrastructure Automation with Chef
 
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
Chef Fundamentals Training Series Module 4: The Chef Client Run and Expanding...
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Growing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large OrganizationGrowing Pains with Chef – a Tale of DevOps in a Large Organization
Growing Pains with Chef – a Tale of DevOps in a Large Organization
 
Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!Sim a Microsoft Utiliza OpenSource em DevOps!
Sim a Microsoft Utiliza OpenSource em DevOps!
 
Building a Better Mousetrap for the Cloud
Building a Better Mousetrap for the CloudBuilding a Better Mousetrap for the Cloud
Building a Better Mousetrap for the Cloud
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with Chef
 
Compliance as Code
Compliance as CodeCompliance as Code
Compliance as Code
 

Similar to Chef, Vagrant and Friends

Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for OpenstackMohit Sethi
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Chef Software, Inc.
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetup
Suresh Paulraj
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
Ygor Nascimento
 
Chef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupChef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupPromet Source
 
Velocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopVelocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack Workshop
Chef Software, Inc.
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
Sai Perchard
 
Chef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scaleChef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scale
Biju Nair
 
Learning chef
Learning chefLearning chef
Learning chef
Jonathan Carrillo
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Software, Inc.
 
Chef + AWS + CodeIgniter
Chef + AWS + CodeIgniterChef + AWS + CodeIgniter
Chef + AWS + CodeIgniterciconf
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
Jennifer Davis
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and Docker
Mandi Walls
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
Hamza Waqas
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
Chef
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
ICF CIRCUIT
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
morgoth
 
Automate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef Michael Lihs
 
Sim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsSim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOps
Danilo Bordini
 

Similar to Chef, Vagrant and Friends (20)

Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
 
Opscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with ChefOpscode Webinar: Managing Your VMware Infrastructure with Chef
Opscode Webinar: Managing Your VMware Infrastructure with Chef
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetup
 
Chef fundamentals
Chef fundamentalsChef fundamentals
Chef fundamentals
 
Chef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetupChef Intro @ SF Bay Area LSPE meetup
Chef Intro @ SF Bay Area LSPE meetup
 
Velocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack WorkshopVelocity 2011 Chef OpenStack Workshop
Velocity 2011 Chef OpenStack Workshop
 
Chef - Infrastructure Automation for the Masses
Chef - Infrastructure Automation for the Masses�Chef - Infrastructure Automation for the Masses�
Chef - Infrastructure Automation for the Masses
 
Chef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scaleChef conf-2015-chef-patterns-at-bloomberg-scale
Chef conf-2015-chef-patterns-at-bloomberg-scale
 
Learning chef
Learning chefLearning chef
Learning chef
 
Chef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of ChefChef Fundamentals Training Series Module 1: Overview of Chef
Chef Fundamentals Training Series Module 1: Overview of Chef
 
Chef + AWS + CodeIgniter
Chef + AWS + CodeIgniterChef + AWS + CodeIgniter
Chef + AWS + CodeIgniter
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Testable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and DockerTestable Infrastructure with Chef, Test Kitchen, and Docker
Testable Infrastructure with Chef, Test Kitchen, and Docker
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
 
Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3Node object and roles - Fundamentals Webinar Series Part 3
Node object and roles - Fundamentals Webinar Series Part 3
 
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef CookbooksCIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
CIRCUIT 2015 - AEM Infrastructure Automation with Chef Cookbooks
 
Introduction to chef framework
Introduction to chef frameworkIntroduction to chef framework
Introduction to chef framework
 
Automate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & ChefAutomate your Development Environment with Vagrant & Chef
Automate your Development Environment with Vagrant & Chef
 
Sim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOpsSim, a Microsoft usa Open Source em DevOps
Sim, a Microsoft usa Open Source em DevOps
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
Srikant77
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
SOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar Research Team: Latest Activities of IntelBroker
SOCRadar Research Team: Latest Activities of IntelBroker
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
RISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent EnterpriseRISE with SAP and Journey to the Intelligent Enterprise
RISE with SAP and Journey to the Intelligent Enterprise
 

Chef, Vagrant and Friends

  • 2. @benmcrae • Software engineer • CompareTheMarket.com • Travelling & listening to music • Coffee / real ale drinker
  • 6.
  • 7. Chef can automate how you configure, deploy and scale your servers and applications.
  • 8.
  • 10. Installing Chef 11 ! Chef Omnibus (Linux, OS X, Windows) Chef DK (April 2014, v0.1.0) (Bundled software) Gem (Ruby 1.9.3 recommended)
  • 11. Chef CLI tools ohai (node attributes) chef-apply (execute a single recipe from the command line) chef-solo (execute run lists and cookbooks on a node) chef-client (retrieves & executes run lists & cookbooks on nodes) knife (interact with chef server)
  • 13. Resources Resources represent a piece of the system and its desired state. Some resources available:! • Directories • Users • Groups • Services • Packages
  • 14.
  • 15. Resource Syntax A resource is a Ruby block with four components: • A type • A name • One (or more) attributes (with values) • One (or more) actions
  • 16. Recipe Recipes are what you write to install and configure things on your machine.! • Authored using a Ruby DSL • Made from multiple resources • Can include other recipes • Single responsibility in purpose • Belongs to a Cookbook
  • 17. Recipe DSL A Ruby DSL, with specific methods to write chef recipes and resource blocks. Common Ruby syntax can be used with the Recipe DSL methods. if / case statements…
  • 19. Ingredients • Using chef-apply and a single recipe • Create a new developer user on the system • Install Git using the OS package manager • Create a .gitconfig file for the developer user
  • 21. Chef Run • Recipe loaded • Resources are arranged in an ordered queue • Each resource is mapped to a Provider! • The node Converges by executing each provider
  • 22. Providers Providers define steps that are needed to bring a piece of the system from its current state into the desired state.
  • 23. Idempotent A recipe can run multiple times on the same system and the results will always be identical.
  • 25. Outcomes • Poor single responsibility • Use better suited resources e.g. template / file • Fixed values could be swapped for attributes
  • 26. Next Steps 1. Create cookbook from existing recipe 2. Refactor outcomes from retrospective
  • 28. Cookbook A cookbook defines a scenario, such as everything needed to install and configure Apache and the resources that support it.
  • 29.
  • 30. Cookbook Folders • attributes - attribute files, loaded in alphabetical order! • files - stored files for file and directory resources! • libraries - arbitrary ruby libraries, used in recipes! • providers - custom providers (LWRP)! • recipes - recipe files! • resources - custom resources (LWRP)! • templates - erb files for the template resource
  • 31. Cookbook Generators • knife cookbook create ‘cookbook name’ • berks cookbook ‘cookbook name’
  • 32. Metadata File • The metadata.rb sits in the cookbook root directory • Defines cookbook name, version, and description • Can declare dependencies on other cookbooks • List supported operating systems
  • 33.
  • 35. Template Resource • Uses ERB (Embedded Ruby) files • Supports variables and hashes in templates • Multi nested folders designed to support distributing files across platforms • Best practice: set variables using attributes
  • 36.
  • 37. Node Object • Attributes - An attribute is a specific piece of data about the node! • Run list - A run-list is an ordered list of recipes and/or roles that are run in an exact order
  • 38. Attributes ! • Attributes can be defined by the node, recipes, cookbooks, roles and environments! • Node information. i.e. IP / MAC addresses, OS info • Recipe information. i.e. directory paths, users, application data
  • 39.
  • 41. Ohai Ohai is a CLI tool that is used to detect attributes on a node! • Platform details • Network usage • Memory usage • Processor usage
  • 42. Run List • A run-list defines all of the configuration settings that are necessary for a node to converge • An ordered list of roles and/or recipes that are run in an exact order
  • 43. chef-solo • chef-solo allows using cookbooks on nodes without using Chef server • Cookbooks & dependencies must be on the node • Limited in functionality compared to chef-server • Requires configuration; run-list and attributes
  • 45. Chef Run • Builds node object! • Expands run-list • Compiles Resources in an ordered queue • Each resource is mapped to a Provider! • The node Converges by executing each provider
  • 47. Outcomes • A single cookbook to manage our developer user • A cookbook that can be used with both chef-solo and chef-client (Chef Server)
  • 48. Next Steps • Introduce community cookbooks and Berkshelf • Install Ruby 2.1.2, using Berkshelf
  • 50. Community Cookbooks • An online Open Source cookbook repository, maintained and used by the chef community. • Trusted cookbooks can be downloaded from - http://community.opscode.com • Cookbook dependencies are not automatically downloaded. This must be done by looking through the cookbook metadata file, and manually downloading listed cookbooks.
  • 51. Berkshelf • The cookbook dependency manager • gem install berkshelf • Used to maintain cookbooks on your Chef Server • Written by Jamie Windsor, and Seth Vargo
  • 52. Berksfile • Lives in the root directory of the Cookbook • Lists each cookbook name, and version (optional) which your cookbook depends on • Ability to read cookbook dependencies from metadata.rb file • Traverses over other cookbook dependencies
  • 53.
  • 56. Outcomes • Implemented a community cookbook with the aid of Berkshelf. • Applied our knowledge of attributes to other cookbooks.
  • 57. Next Steps • Provision the node automatically with chef-solo and Vagrant. • Create a new recipe to git clone our ruby app into the developer home directory.
  • 58.
  • 59. • Create and configure lightweight, reproducible, and portable development environments. • Vagrant stands on the shoulders of giants. Machines are provisioned on top of VirtualBox, VMware, AWS, or any other provider. • Provision machines with, shell scripts, Chef, or Puppet.
  • 60. Commands • vagrant init hashicorp/precise32 • vagrant up • vagrant provision • vagrant halt • vagrant destroy
  • 61.
  • 62. Vagrant Provision • Move the run list and attributes into the Vagrantfile • Vagrant will run chef-solo on VM start, or by running the provision command
  • 63. Git Resource • Manage source control resources that exist in a git repository • Functionality for revision and branching control • Offers both export and syncing abilities
  • 66. Outcomes • Used Vagrant to run chef-solo and setup our node • Established our cookbook development workflow • Finished cookbook
  • 68. More Features • Full support for both Linux and Windows guest’s • Mount directories using either NFS, SMB or Rsync • Multi machine environments • Network support - port forwarding, private networks
  • 69. Vagrant Cloud • Share a link to your web server to a teammate across the country • Community collection of fully baked box images • Distribute versionable private environments to your team
  • 70. Share / Connect • Share SSH access to other vagrant users • Share the whole machine as a local entity to other vagrant users
  • 71. Vagrant Plugins • vagrant plugin install <plugin_name> • vagrant-sahara (operate in a sandbox environment) • vagrant-proxy (define http and https proxies)
  • 72. Chef Reading • Test-Driven Infrastructure with Chef, 2nd Edition
 - Steven Nelson-Smith • Chef Infrastructure Automation Cookbook 
 - Matthias Marschall • Learning Chef (Released Sep 2014)
 - Seth Vargo, Mischa Taylor • https://learnchef.opscode.com/
  • 73. Vagrant Reading • Vagrant: Up and Running - Mitchell Hashimoto • http://docs.vagrantup.com/ • http://www.vagrantup.com/blog.html