This document provides an overview of organizing recipes and using version control with Chef cookbooks. It begins by outlining the learning objectives, then asks and answers some common questions about modifying recipes, packaging recipes into cookbooks, and using version control. It introduces the basics of Git version control and walks through exercises to generate a sample cookbook, add recipes, and initialize the cookbook as a Git repository. The document demonstrates how to create, apply, and verify a sample Apache web server recipe to install and configure Apache.
chef is an automation tool that describe your infrastructure with code. The purpose of cookbook is automation the system configuration. Cookbook created on the workstation and uploaded to the chef server. Then testing the cookbook by using opennebula. Test kitchen is test hardness tool o execute your configured code on one or more platforms in isolation. Then install the test kitchen and opennebula driver.finally run the cookbook.
chef is an automation tool that describe your infrastructure with code. The purpose of cookbook is automation the system configuration. Cookbook created on the workstation and uploaded to the chef server. Then testing the cookbook by using opennebula. Test kitchen is test hardness tool o execute your configured code on one or more platforms in isolation. Then install the test kitchen and opennebula driver.finally run the cookbook.
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Patrick McDonnell
Talk by Patrick McDonnell (@mcdonnps) at #ChefConf 2012
Chef makes it so easy to change configuration en masse that it can be dangerous if not used with certain precautions and in accordance with a well thought out testing workflow. In our use of Chef at Etsy, we have devised many in-house best practices in response to failures which have helped greatly in avoiding catastrophic outages. This talk will focus on mistakes we've made and how we've avoided repeating them by enforcing standards in cookbooks, testing changes before rollout through the use of environments and in conjunction with the Spork plugin for Knife, and linting cookbooks with Foodcritic. I'll also talk about using handlers intelligently to monitor Chef runs and how to generate reports from the myriad data available in CouchDB.
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Chef
Part 6 of a 6 part series introducing you to the fundamentals of Chef.
This session includes an introducing Community Cookbooks and some additional resources.
After viewing this webinar you will be able to:
- Find, preview, and download cookbooks from the Chef Community site
- Use knife to work with the Community Site API
- Download, extract, examine and implement cookbooks from the Community site
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=ovTIeS3kx4g&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
How to do Test Driven Development to write Chef cookbooks?
This slide-deck explains how to use TDD and tools of the trade, to develop cookbooks, Unit Tests and Integration Tests.
Source code is available on GitHub: https://github.com/siso/cheftdd-cookbook
Lessons from Etsy: Avoiding Kitchen Nightmares - #ChefConf 2012Patrick McDonnell
Talk by Patrick McDonnell (@mcdonnps) at #ChefConf 2012
Chef makes it so easy to change configuration en masse that it can be dangerous if not used with certain precautions and in accordance with a well thought out testing workflow. In our use of Chef at Etsy, we have devised many in-house best practices in response to failures which have helped greatly in avoiding catastrophic outages. This talk will focus on mistakes we've made and how we've avoided repeating them by enforcing standards in cookbooks, testing changes before rollout through the use of environments and in conjunction with the Spork plugin for Knife, and linting cookbooks with Foodcritic. I'll also talk about using handlers intelligently to monitor Chef runs and how to generate reports from the myriad data available in CouchDB.
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Chef
Part 6 of a 6 part series introducing you to the fundamentals of Chef.
This session includes an introducing Community Cookbooks and some additional resources.
After viewing this webinar you will be able to:
- Find, preview, and download cookbooks from the Chef Community site
- Use knife to work with the Community Site API
- Download, extract, examine and implement cookbooks from the Community site
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=ovTIeS3kx4g&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
How to do Test Driven Development to write Chef cookbooks?
This slide-deck explains how to use TDD and tools of the trade, to develop cookbooks, Unit Tests and Integration Tests.
Source code is available on GitHub: https://github.com/siso/cheftdd-cookbook
Cooking Perl with Chef: Real World Tutorial with JitterbugDavid Golden
This tutorial provides a command-by-command walk-through for deploying the Jitterbug continuous integration application using the Chef configuration management tool
The guide helps you understand how Chef works. It will also demonstrate about the primary usage and getting started with installing Chef-Solo over your workstations.
However, it will also help you to figure out how to configure Chef Server, Knife and Chef-Client at your stack making it possible to let them all communicate together.
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Chef
Part 2 of a 6 part series introducing you to the fundamentals of Chef.
This session includes:
* Node Setup
* Chef Resources and Recipes
After viewing this webinar you will be able to:
- Login to the node in your Chef Training Lab
- Install Chef nodes using "knife bootstrap"
- Explain how knife bootstrap configures a node to use the - Organization created in the previous section
- Explain the basic configuration needed to run chef-client
- Describe in detail what a cookbook is
- Create a new cookbook
- Explain what a recipe is
- Describe how to use the package, service, and template - resources
- Upload a cookbook to the Chef Server
- Explain what a run list is, and how to set it for a node - via knife
- Explain the output of a chef-client run
Video of this webinar can be found at the following URL
https://www.youtube.com/watch?v=S5lHUpzoCYo&list=PL11cZfNdwNyPnZA9D1MbVqldGuOWqbumZ
Continuous Integration Testing in DjangoKevin Harvey
Continuous Integration is like having a robot that cleans up after you: it installs your dependencies, builds your project, run your tests, and reports back to you. This presentation outlines two methods for CI: Travis and Jenkins.
Vous avez besoin d'une stratégie pour déployer votre infrastructure ? Je vais vous donner une méthode qui vient du monde du développement. Dans le but d'avoir une plate-forme stable.
Décrivez ce dont vous avez besoin dans votre future recette "Je veux un serveur HTTP" est testez avec un outil du type BDD (Développement Piloté par les Fonctionnalités).
Maintenant, vous allez devoir de décrire (avec un langage de plus bas niveau) les prérequis dont vous avez besoin pour cette fonctionnalité (vérifier si NGINX est installé).
Vous basculez donc dans le mode TDD (Développement Piloté par les Tests). Quand votre recette est prête, vous allez l'ajouter à votre gestionnaire de sources. Et votre système d'Intégration Continue va tester votre recette à chaque mise à jour.
Comme pour un système de développement. Je vous l'ai dit “Infrastructure as code”
***** DevOps Training : https://www.edureka.co/devops *****
This DevOps Tutorial on DevOps Interview Questions and Answers ( DevOps Interview Blog : https://goo.gl/mfTAVJ ) will help you to prepare yourself for DevOps interviews. Learn about the most important DevOps Engineer interview questions and answers and know what will set you apart in the interview process. Below are the topics covered in this DevOps Interview Questions and Answers Tutorial:
1) Basic DevOps Interview Questions
2) Source Code Management Interview Questions
3) Continuous Integration Interview Questions
4) Continuous Deployment Interview Questions
5) Continuous Monitoring Interview Questions
DevOps playlist here: http://goo.gl/O2vo13
DevOps Podcast: https://castbox.fm/channel/id1684800
Upgrading MySQL databases do not come without risk. There is no guarantee that no problems will happen if you move to a new major MySQL version.
Should we just upgrade and rollback immediately if problems occur? But what if these problems only happen a few days after migrating to this new version?
You might have a database environment that is risk-adverse, where you really have to be sure that this new MySQL version will handle the workload properly.
Examples:
- Both MySQL 5.6 and 5.7 have a lot of changes in the MySQL Optimizer. It is expected that this improves performance of my queries, but is it really the case? What if there is a performance regression? How will this affect my database performance?
- Also, there are a lot of incompatible changes which are documented in the release notes, how do I know if I'm affected by this in my workload? It's a lot to read..
- Can I go immediately from MySQL 5.5 to 5.7 and skip MySQL 5.6 even though the MySQL documentation states that this is not supported?
- Many companies have staging environments, but is there a QA team and do they really test all functionality, under a similar workload?
This presentation will show you a process, using open source tools, of these types of migrations with a focus on assessing risk and fixing any problems you might run into prior to the migration.
This process can then be used for various changes:
- MySQL upgrades for major version upgrades
- Switching storage engines
- Changing hardware architecture
Additionally, we will describe ways to do the actual migration and rollback with the least amount of downtime.
Habitat-managed Chef with Policyfiles: Learn how to leverage the power of Habitat, chef-client and Policyfiles to produce an immutable application containing all of your chef cookbooks that can be locally tested and provides a consistent and guaranteed picture of desired configuration state across all target environments.
Microservice Teststrategie mit Symfony2Per Bernhardt
Was teste ich in einer Symfony2-Anwendung eigentlich wie? Sollte ich einen klassichen PHPUnit-Test, einen funktionalen Symfony2-WebTestCase oder vielleicht einen Behat-Test schreiben? Das Infodeck "Testing Strategies in a Microservice Architecture" von ThoughtWorks beschreibt eine sehr sinnvolle Strategie zum Testen von Microservice-Anwendungen, bietet aber auch gute Entscheidungshilfen zum Testen von Anwendungen im Allgemeinen. Mit diesem Vortrag möchte ich unseren Ansatz bei Chefkoch.de zeigen, die allgemeine Strategie von ThoughtWorks auf ein konkretes Symfony2 Projekt anzuwenden.
Design Summit - Migrating to Ruby 2 - Joe RafanielloManageIQ
ManageIQ currently runs on Ruby 1.9.3. This presentation is about the effort to move ManageIQ to Ruby 2.x to take advantage of new features and performance in the language and runtime engine.
For more on ManageIQ, see http://manageiq.org/
DevOps Hackathon: Session 3 - Test Driven InfrastructureAntons Kranga
We will assume that you already familiar with Vagrant and Chef fundamentals described in session 1 and 2. Today we will go through TestKitchen and ServerSpec. While chef-dk is not stable, this is most reliable path.
Practical activities can be found here:
https://github.com/akranga/devops-hackathon-3
This talk is an in-depth look at all we, at Chef, have learned and what we love and what could be better about Configuration Management, Continuous Delivery and DevOps. We'll explore the pain points that still exist, especially as teams try to bring containers and microservices into production. We’ll then explore how to ensure the apps you build, deploy, and manage behave consistently in any runtime — metal, VMs, containers, and PaaS. You'll spend less time on the environment and more time building features.
Presented by Simon Fisher at DevOps World London November 2016
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
E-commerce Application Development Company.pdfHornet Dynamics
Your business can reach new heights with our assistance as we design solutions that are specifically appropriate for your goals and vision. Our eCommerce application solutions can digitally coordinate all retail operations processes to meet the demands of the marketplace while maintaining business continuity.
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
GraphSummit Paris - The art of the possible with Graph TechnologyNeo4j
Sudhir Hasbe, Chief Product Officer, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Takashi Kobayashi and Hironori Washizaki, "SWEBOK Guide and Future of SE Education," First International Symposium on the Future of Software Engineering (FUSE), June 3-6, 2024, Okinawa, Japan
Zoom is a comprehensive platform designed to connect individuals and teams efficiently. With its user-friendly interface and powerful features, Zoom has become a go-to solution for virtual communication and collaboration. It offers a range of tools, including virtual meetings, team chat, VoIP phone systems, online whiteboards, and AI companions, to streamline workflows and enhance productivity.
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Transform Your Communication with Cloud-Based IVR SolutionsTheSMSPoint
Discover the power of Cloud-Based IVR Solutions to streamline communication processes. Embrace scalability and cost-efficiency while enhancing customer experiences with features like automated call routing and voice recognition. Accessible from anywhere, these solutions integrate seamlessly with existing systems, providing real-time analytics for continuous improvement. Revolutionize your communication strategy today with Cloud-Based IVR Solutions. Learn more at: https://thesmspoint.com/channel/cloud-telephony
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...kalichargn70th171
A dynamic process unfolds in the intricate realm of software development, dedicated to crafting and sustaining products that effortlessly address user needs. Amidst vital stages like market analysis and requirement assessments, the heart of software development lies in the meticulous creation and upkeep of source code. Code alterations are inherent, challenging code quality, particularly under stringent deadlines.
2. After completing this module, you should be able to:
Modify a recipe
Use version control
Generate a Chef cookbook
Define a Chef recipe that sets up a web server
Objectives
Slide 2 of 57
4. Thinking about the workstation recipe, could we do
something like that for a web server?
Questions You May Have
Slide 4 of 57
5. Thinking about the workstation recipe, could we do
something like that for a web server?
Is there a way to package up recipes you create with a
version number (and maybe a README)?
Questions You May Have
Slide 5 of 57
6. Thinking about the workstation recipe, could we do
something like that for a web server?
Is there a way to package up recipes you create with a
version number (and maybe a README)?
I think Chef is able to generate something called a
cookbook. Shouldn't we start thinking about some
version control so we don't lose all our hard work?
Questions You May Have
Slide 6 of 57
9. Versioning Pros and Cons
Saving a copy of the original file as another filename.
$cpsetup.rbsetup.rb.bak
Slide 9 of 57
10. Versioning Pros and Cons
Saving a copy of the original file as another filename.
$cpsetup.rbsetup.rb.bak
or
$cpsetup.rb{,.`date+%Y%m%d%H%M`}
Slide 10 of 57
11. Versioning Pros and Cons
Saving a copy of the original file as another filename.
$cpsetup.rbsetup.rb.bak
or
$cpsetup.rb{,.`date+%Y%m%d%H%M`}
or
$cpsetup.rb{,.`date+%Y%m%d%H%M-$USER`}
Slide 11 of 57
12. Git Version Control
git is a distributed revision control system with an emphasis on speed, data
integrity, and support for distributed, non-linear workflows.
We will be using git throughout the rest of this workshop.
Slide 12 of 57
13. Add the additional policy to setup.rb:
The package named git is installed.
Then apply this recipe with chef-apply.
Lab Exercise: Install git
Slide 13 of 57
14. Lab Exercise: Adding the git Package
~/setup.rb
package'nano'
package'vim'
package'emacs'
package'tree'
package'git'
file'/etc/motd'do
content'Propertyof...'
end
Slide 14 of 57
15. Lab Exercise: Re-apply the Setup Recipe
$sudochef-applysetup.rb
Recipe:(chef-applycookbook)::(chef-applyrecipe)
*yum_package[nano]actioninstall(uptodate)
*yum_package[vim]actioninstall(uptodate)
*yum_package[emacs]actioninstall(uptodate)
*yum_package[tree]actioninstall(uptodate)
*yum_package[git]actioninstall
-installversion1.7.1-4.el6_7.1ofpackagegit
*file[/etc/motd]actioncreate(uptodate)
Slide 15 of 57
16. How are we going to manage this file?
Does it need a README?
Group Exercise: Create a Cookbook
Slide 16 of 57
17. How are we going to manage this file?
Does it need a README?
Objective:
☐ Use chef (CLI) to generate a cookbook to store our setup
recipe.
☐ Add the workstation cookbook to version control.
Group Exercise: Create a Cookbook
Slide 17 of 57
18. What is chef?
An executable program that allows you generate cookbooks and cookbook
components.
Slide 18 of 57
19. What can chef do?
$chef--help
Usage:
chef-h/--help
chef-v/--version
chefcommand[arguments...][options...]
AvailableCommands:
exec Runsthecommandincontextoftheembeddedruby
env PrintsenvironmentvariablesusedbyChefDK
gem Runsthegemcommandincontextoftheembeddedruby
generate Generateanewapp,cookbook,orcomponent
shell-init InitializeyourshelltouseChefDKasyourprimaryruby
install InstallcookbooksfromaPolicyfileandgeneratealockedcookbookset
update UpdatesaPolicyfile.lock.jsonwithlatestrun_listandcookbooks
...
undelete Undoadeletecommand
verify TesttheembeddedChefDKapplications
Slide 19 of 57
21. A Chef Cookbook is the fundamental unit of
configuration and policy distribution.
Cookbooks
What is a Chef Cookbook?
Slide 21 of 57
22. A Chef Cookbook is the fundamental unit of
configuration and policy distribution.
Each cookbook defines a scenario, such as everything
needed to install and configure MySQL, and then it
contains all of the components that are required to
support that scenario.
Cookbooks
What is a Chef Cookbook?
Slide 22 of 57
23. A Chef Cookbook is the fundamental unit of
configuration and policy distribution.
Each cookbook defines a scenario, such as everything
needed to install and configure MySQL, and then it
contains all of the components that are required to
support that scenario.
Read the first three paragraphs here:
http://docs.chef.io/cookbooks.html
Cookbooks
What is a Chef Cookbook?
Slide 23 of 57
24. What Can chef generate Do?
$chefgenerate--help
Usage:chefgenerateGENERATOR[options]
Availablegenerators:
app Generateanapplicationrepo
cookbook Generateasinglecookbook
recipe Generateanewrecipe
attribute Generateanattributesfile
template Generateafiletemplate
file Generateacookbookfile
lwrp Generatealightweightresource/provider
repo GenerateaChefpolicyrepository
policyfile GenerateaPolicyfileforusewiththeinstall/pushcommands
generator CopyChefDK'sgeneratorcookbooksoyoucancustomizeit
Slide 24 of 57
25. What Can chef generate cookbook Do?
$chefgeneratecookbook--help
Usage:chefgeneratecookbookNAME[options]
-C,--copyrightCOPYRIGHT Nameofthecopyrightholder-default...
-m,--emailEMAIL Emailaddressoftheauthor-defaults...
-a,--generator-argKEY=VALUE UsetosetarbitraryattributeKEYto...
-I,--licenseLICENSE all_rights,httpd,mit,gplv2,gplv3-...
-gGENERATOR_COOKBOOK_PATH, UseGENERATOR_COOKBOOK_PATHforthe...
--generator-cookbook
Slide 25 of 57
31. Every cookbook requires a small amount of metadata.
Metadata is stored in a file called metadata.rbthat
lives at the top of each cookbook’s directory.
metadata.rb
http://docs.chef.io/config_rb_metadata.html
Slide 31 of 57
32. Group Exercise: Let's Take a Look at the Metadata
$catworkstation/metadata.rb
name 'workstation'
maintainer 'TheAuthors'
maintainer_email'you@example.com'
license 'all_rights'
description 'Installs/Configuresworkstation'
long_description'Installs/Configuresworkstation'
version '0.1.0'
Slide 32 of 57
33. Group Exercise: The Cookbook Has a Folder for Recipes
$treeworkstation
workstation
├──Berksfile
├──chefignore
├──metadata.rb
├──README.md
├──recipes
│ └──default.rb
├──spec
│ ├──spec_helper.rb
│ └──unit
│ └──recipes
│ └──default_spec.rb
10directories,9files
Slide 33 of 57
34. Group Exercise: The Cookbook Has a Default Recipe
$catworkstation/recipes/default.rb
#CookbookName::workstation
#Recipe::default
#
#Copyright(c)2015TheAuthors,AllRightsReserved.
Slide 34 of 57
35. Group Exercise: Move our setup.rb Recipe into the Cookbook
$mv-vsetup.rbworkstation/recipes/
`setup.rb'->`workstation/recipes/setup.rb'
Slide 35 of 57
36. This is a probably a good point to capture the initial state
of our cookbook.
Objective:
☑ Use chef (CLI) to generate a cookbook to store our setup
recipe.
☐ Add the workstation cookbook to version control.
Group Exercise: Version Control
Slide 36 of 57
38. Group Exercise: Initialize the Directory as a git Repository
$gitinit
ReinitializedexistingGitrepositoryin/home/chef/workstation/.git/
Slide 38 of 57
39. Group Exercise: Use git add to Stage Files to be Committed
$gitadd.
Slide 39 of 57
40. The staging area has a file, generally contained in
your Git directory, that stores information about what
will go into your next commit.
It’s sometimes referred to as the “index”, but it’s also
common to refer to it as the staging area.
Staging Area
http://git-scm.com/book/en/v2/Getting-Started-Git-Basics
Slide 40 of 57
42. Group Exercise: Use git commit to Save the Staged Changes
$gitcommit-m"Initialworkstationcookbook"
[master(root-commit)ae6968b]Initialworkstationcookbook
Committer:ChefDKUser<chef@ip-172-31-11-224.ec2.internal>
Yournameandemailaddresswereconfiguredautomaticallybased
onyourusernameandhostname.Pleasecheckthattheyareaccurate.
Youcansuppressthismessagebysettingthemexplicitly:
gitconfig--globaluser.name"YourName"
gitconfig--globaluser.emailyou@example.com
Iftheidentityusedforthiscommitiswrong,youcanfixitwith:
gitcommit--amend--author='YourName<you@example.com>'
12fileschanged,207insertions(+),0deletions(-)
createmode100644.gitignore
createmode100644.kitchen.yml
createmode100644Berksfile
createmode100644README.md
createmode100644chefignore
createmode100644metadata.rb
createmode100644recipes/default.rb
createmode100644recipes/setup.rb
...
Slide 42 of 57
43. If you use git versioning you should ultimately push
the local git repository to a shared remote git
repository.
In this way others could collaborate with you from a
centralized location.
Git Version Control
Slide 43 of 57
45. Use chef generate to create a cookbook named apache.
Write and apply a recipe named server.rbwith the
policy:
The package named httpd is installed.
The file named /var/www/html/index.htmlis
created with the content <h1>Hello,world!</h1>
The service named httpd is started and enabled.
Apply the recipe with chef-apply.
Verify the site is available by running curl
http://localhost.
Lab Exercise: Setting up a Web Server
Slide 45 of 57
48. Lab Exercise: Create the Server Recipe
~/apache/recipes/server.rb
package'httpd'
file'/var/www/html/index.html'do
content'<h1>Hello,world!</h1>'
end
service'httpd'do
action[:enable,:start]
end
Slide 48 of 57
49. Lab Exercise: Apply the Server Recipe
$sudochef-applyapache/recipes/server.rb
Recipe:(chef-applycookbook)::(chef-applyrecipe)
*yum_package[httpd]actioninstall
-installversion2.4.6-40.el7.centosofpackagehttpd
*file[/var/www/html/index.html]actioncreate
-createnewfile/var/www/html/index.html
-updatecontentinfile/var/www/html/index.htmlfromnoneto17d291
---/var/www/html/index.html 2016-04-0409:50:59.758483838-0500
+++/var/www/html/.chef-index.html20160404-21732-1o44k9g 2016-04-0409:50:59.758483838-0500
@@-1+1,2@@
+<h1>Hello,world!</h1>
*service[httpd]actionenable
-enableserviceservice[httpd]
*service[httpd]actionstart
-startserviceservice[httpd]
Slide 49 of 57
50. Lab Exercise: Verify Website is Available
$curllocalhost
<h1>Hello,world!</h1>
Slide 50 of 57
51. Group Exercise: Commit Your Work
$cdapache
$gitinit
$gitadd.
$gitcommit-m"InitialApacheCookbook"
Slide 51 of 57
52. What file would you read first when examining a
cookbook?
Discussion
Slide 52 of 57
53. What file would you read first when examining a
cookbook?
What other recipes might you include in the apache or
workstation cookbook?
Discussion
Slide 53 of 57
54. What file would you read first when examining a
cookbook?
What other recipes might you include in the apache or
workstation cookbook?
Can resources accept multiple actions?
Discussion
Slide 54 of 57
55. What file would you read first when examining a
cookbook?
What other recipes might you include in the apache or
workstation cookbook?
Can resources accept multiple actions?
How often would you commit changes with version
control?
Discussion
Slide 55 of 57