Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Chef Solo Introduction

Chef Solo Introduction

A quickstart on chef-solo

Lincoln Lee

July 10, 2013
Tweet

More Decks by Lincoln Lee

Other Decks in Programming

Transcript

  1. WHAT IS CHEF? WHAT IS CHEF? Cloud Infrastructure Automation Framework

    Infrastructure as code Write your infrastructure in Ruby
  2. WHY USE CHEF? WHY USE CHEF? Versioning on infrastructure Replicate

    server on different providers (AWS, Linode, VirtualBox) so on...
  3. WHAT IS CHEF-SOLO WHAT IS CHEF-SOLO Chef use a server/client

    model Chef-solo remove the server part
  4. DEPENDENCIES ON LOCAL MACHINE DEPENDENCIES ON LOCAL MACHINE # A

    c h e f - d e m o G e m f i l e s o u r c e " h t t p s : / / r u b y g e m s . o r g " g e m " k n i f e - s o l o " g e m " l i b r a r i a n "
  5. INITIALIZE LIBRARIAN INITIALIZE LIBRARIAN $ l i b r a

    r i a n - c h e f i n i t It will create a Cheffile.
  6. INSIDE CHEFFILE INSIDE CHEFFILE # ! / u s r

    / b i n / e n v r u b y # ^ s y n t a x d e t e c t i o n s i t e ' h t t p : / / c o m m u n i t y . o p s c o d e . c o m / a p i / v 1 ' # c o o k b o o k ' c h e f - c l i e n t ' # c o o k b o o k ' a p a c h e 2 ' , ' > = 1 . 0 . 0 ' # c o o k b o o k ' r v m ' , # : g i t = > ' h t t p s : / / g i t h u b . c o m / f n i c h o l / c h e f - r v m ' # c o o k b o o k ' p o s t g r e s q l ' , # : g i t = > ' h t t p s : / / g i t h u b . c o m / f i n d s y o u / c o o k b o o k s ' , # : r e f = > ' p o s t g r e s q l - i m p r o v e m e n t s '
  7. PREPARE THE REMOTE MACHINE PREPARE THE REMOTE MACHINE $ k

    n i f e s o l o p r e p a r e r o o t @ 1 9 2 . 1 6 8 . 5 . 1 6 4 It will do 2 things: SSH to the remote server and install chef Create a json file in nodes dir
  8. ADD COOKBOOK IN CHEFFILE ADD COOKBOOK IN CHEFFILE # !

    / u s r / b i n / e n v r u b y # ^ s y n t a x d e t e c t i o n s i t e ' h t t p : / / c o m m u n i t y . o p s c o d e . c o m / a p i / v 1 ' c o o k b o o k " n g i n x "
  9. DEMO FOR INSTALLING NGINX DEMO FOR INSTALLING NGINX Add to

    runlist in nodes json Nginx IN NODES/192.168.5.164.JSON: IN NODES/192.168.5.164.JSON: { " r u n _ l i s t " : [ " r e c i p e [ n g i n x : : s o u r c e ] " ] }
  10. TIME TO COOK! TIME TO COOK! $ k n i

    f e s o l o c o o k r o o t @ 1 9 2 . 1 6 8 . 5 . 1 6 4