SlideShare a Scribd company logo
Learning ChefInfrastructure Automation With Chef
Learning Chef
	
  
	
  
A#er	
  this	
  course	
  you	
  will	
  be	
  able	
  to:	
  
	
  
§  Understand	
  DevOps	
  and	
  what	
  Chef	
  is	
  
§  Know	
  the	
  role	
  of	
  worksta>ons,	
  nodes,	
  and	
  Chef	
  server	
  
§  Deploy	
  and	
  automate	
  configura>ons	
  of	
  nodes	
  	
  
§  Understanding	
  of	
  wri>ng	
  Recipes	
  and	
  Cookbooks	
  
§  Understand	
  the	
  Chef	
  work	
  flow	
  
§  Use	
  Chef	
  to	
  automate	
  the	
  deployment	
  your	
  infrastructure	
  	
  
	
  
Learning Chef
	
  
	
  
How	
  this	
  course	
  is	
  laid	
  out:	
  
	
  
§  Will	
  learn	
  Chef	
  by	
  working	
  with	
  single	
  nodes	
  to	
  start	
  
§  Learning	
  to	
  build	
  cookbooks	
  will	
  follow	
  a	
  theme	
  such	
  as	
  installing	
  LAMP	
  
§  Addi>onal	
  exercises	
  will	
  be	
  found	
  at	
  the	
  end	
  of	
  the	
  course	
  
§  Need	
  access	
  to	
  LinuxAcademy.com	
  lab	
  servers	
  or	
  your	
  own	
  VM	
  environment	
  
§  VirtualBox	
  
§  VMWare	
  worksta>on	
  
§  Parallels	
  
§  Have	
  at	
  least	
  one	
  “node”	
  (server)	
  available	
  to	
  connect	
  to	
  
Learning Chef
	
  
	
  
How	
  this	
  course	
  is	
  laid	
  out:	
  
	
  
§  Will	
  learn	
  Chef	
  by	
  working	
  with	
  single	
  nodes	
  to	
  start	
  
§  Need	
  access	
  to	
  LinuxAcademy.com	
  lab	
  servers	
  or	
  your	
  own	
  VM	
  environment	
  
§  VirtualBox	
  
§  VMWare	
  worksta>on	
  
§  Parallels	
  
§  Have	
  at	
  least	
  one	
  “node”	
  (server)	
  available	
  to	
  connect	
  to	
  
	
  
Learning ChefWhat Is DevOps?
Learning Chef
	
  
	
  
What	
  is	
  DevOps?	
  
	
  
§  DevOps	
  is	
  about	
  “How	
  well	
  people	
  work	
  together	
  and	
  how	
  
streamlined	
  our	
  	
  
	
  	
  	
  	
  	
  	
  Opera6ons	
  really	
  are”	
  –	
  Adam	
  Jacob	
  
§  The	
  applica>on	
  and	
  infrastructure	
  that	
  runs	
  on	
  it	
  are	
  not	
  
treated	
  as	
  separate	
  en>>es	
  to	
  each	
  other	
  and	
  neither	
  are	
  the	
  
teams	
  that	
  manage	
  each	
  
	
  
§  DevOps	
  is	
  part	
  of	
  con>nuous	
  delivery	
  where	
  all	
  aspects	
  of	
  the	
  
deployment	
  process	
  are	
  automated	
  
§  DevOps	
  is	
  infrastructure	
  as	
  code	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning ChefWhat Is Chef?
Learning Chef
	
  
	
  
What	
  is	
  Chef?	
  
	
  
“Chef	
  turns	
  infrastructure	
  into	
  code.	
  With	
  Chef,	
  you	
  can	
  automate	
  how	
  
you	
  build,	
  deploy,	
  and	
  manage	
  your	
  infrastructure.	
  Your	
  infrastructure	
  
becomes	
  as	
  versionable,	
  testable,	
  and	
  repeatable	
  as	
  applica6on	
  code.	
  
	
  
Chef	
  relies	
  on	
  reusable	
  defini6ons	
  known	
  as	
  recipes	
  to	
  automate	
  
infrastructure	
  tasks.	
  Examples	
  of	
  recipes	
  are	
  instruc6ons	
  for	
  configuring	
  
web	
  servers,	
  databases	
  and	
  load	
  balancers.	
  Together,	
  recipes	
  describe	
  
what	
  your	
  infrastructure	
  consists	
  of	
  and	
  how	
  each	
  part	
  of	
  your	
  
infrastructure	
  should	
  be	
  deployed,	
  configured	
  and	
  managed.”	
  
	
  
Getchef.com	
  
Learning Chef
	
  
	
  
What	
  is	
  Chef?	
  
	
  
§  Recipes	
  are	
  created	
  using	
  the	
  Ruby	
  language	
  and	
  while	
  learning	
  Chef	
  we	
  
will	
  learn	
  a	
  lot	
  of	
  the	
  Ruby	
  language	
  
§  Recipes	
  rely	
  primarily	
  on	
  resources,	
  resources	
  described	
  a	
  desired	
  state	
  of	
  
an	
  element	
  in	
  the	
  infrastructure.	
  
§  Packages	
  to	
  be	
  installed	
  
§  Files	
  to	
  be	
  created	
  
§  Directories	
  to	
  be	
  created	
  
§  Services	
  to	
  be	
  started	
  
§  Config	
  files	
  to	
  be	
  updated	
  
§  Commands	
  to	
  be	
  executed	
  
§  Essen>ally	
  anything	
  we	
  need	
  to	
  do	
  on	
  our	
  Linux	
  nodes	
  
Learning Chef
	
  
	
  
What	
  is	
  Chef?	
  
	
  
§  Chef	
  relies	
  on	
  either	
  OpenSource	
  Chef	
  server	
  or	
  Chef	
  enterprise	
  to	
  
host	
  configura>on	
  recipes,	
  cookbooks,	
  and	
  node	
  authen>ca>on	
  for	
  
your	
  infrastructure	
  
	
  
§  Nodes	
  when	
  performing	
  a	
  convergence	
  will	
  check	
  in	
  with	
  the	
  Chef	
  
server,	
  download	
  the	
  required	
  configura>on,	
  then	
  execu>on	
  the	
  
recipe	
  instruc>ons	
  	
  
	
  
	
  
Learning Chef
	
  
	
  
	
  
	
  
Learning ChefCommon Chef Terminology
Learning Chef
	
  
	
  
Common	
  Chef	
  Terminology	
  
	
  
Recipes:	
  	
  
Fundamental	
  configura>on	
  element	
  within	
  an	
  organiza>on	
  
Cookbook:	
  
	
  Defines	
  a	
  scenario	
  and	
  is	
  the	
  fundamental	
  unit	
  of	
  configura>on	
  and	
  policy	
  distribu>on	
  
Chef-­‐Client:	
  
	
  Agent	
  that	
  runs	
  locally	
  on	
  the	
  node	
  that	
  is	
  registered	
  with	
  the	
  chef	
  server	
  	
  
Convergence:	
  
	
  Occurs	
  when	
  chef-­‐client	
  configures	
  the	
  system/node	
  based	
  off	
  the	
  informa>on	
  collected	
  from	
  chef-­‐
server	
  
Configura9on	
  Dri;:	
  
	
  Occurs	
  when	
  the	
  node	
  state	
  does	
  not	
  reflect	
  the	
  updated	
  state	
  of	
  polices/configura>ons	
  on	
  the	
  chef	
  
server	
  
Resources:	
  
A	
  statement	
  of	
  configura>on	
  policy	
  within	
  a	
  recipe	
  
Describes	
  the	
  desired	
  state	
  of	
  an	
  element	
  in	
  the	
  infrastructure	
  and	
  steps	
  needed	
  to	
  configure	
  
	
  
	
  
Learning Chef
	
  
	
  
Common	
  Chef	
  Terminology	
  
	
  
Provider:	
  
	
  Defines	
  the	
  steps	
  that	
  are	
  needed	
  to	
  bring	
  the	
  piece	
  of	
  the	
  system	
  from	
  its	
  current	
  state	
  to	
  the	
   	
  desired	
  state	
  
A?ributes:	
  
	
  Specific	
  details	
  about	
  the	
  node,	
  used	
  by	
  chef-­‐client	
  to	
  understand	
  current	
  state	
  of	
  the	
  node,	
  the	
  state	
  of	
  the	
  
	
  node	
  on	
  the	
  previous	
  chef-­‐client	
  run,	
  and	
  the	
  state	
  of	
  the	
  node	
  at	
  the	
  end	
  of	
  the	
  client	
  run	
  
Data-­‐bags:	
  
	
  A	
  global	
  variables	
  stored	
  as	
  JSON	
  data	
  and	
  is	
  accessible	
  from	
  the	
  Chef	
  server	
  
Worksta9on:	
  
	
  A	
  computer	
  configured	
  with	
  Knife	
  and	
  used	
  to	
  synchronize	
  with	
  chef-­‐repo	
  and	
  interact	
  with	
  chef	
  server	
  
Chef	
  Server:	
  
	
  Chef	
  server	
  is	
  the	
  hub	
  for	
  all	
  configura>on	
  data,	
  stores	
  cookbooks,	
  and	
  the	
  policies	
  applied	
  to	
  the	
  node	
  
Knife:	
  
	
  Command	
  line	
  tool	
  which	
  provides	
  an	
  interface	
  between	
  the	
  local	
  chef-­‐repo	
  and	
  chef-­‐server	
  
client.rb:	
  
	
  	
  Configura>on	
  file	
  for	
  chef-­‐client	
  located	
  at	
  /etc/chef/client.rb	
  on	
  each	
  node 	
  	
  
Ohai:	
  
	
  Tool	
  used	
  to	
  detect	
  a_ributes	
  on	
  a	
  node	
  and	
  then	
  provide	
  a_ributes	
  to	
  chef-­‐client	
  at	
  the	
  start	
  of	
  
	
  every	
  chef-­‐client	
  run	
  	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Common	
  Chef	
  Terminology	
  
	
  
Node	
  Object:	
  	
  
	
  Consists	
  of	
  run-­‐list	
  and	
  node	
  a_ributes	
  that	
  describe	
  states	
  of	
  the	
  node	
  
Chef-­‐Repo:	
  
	
  Located	
  on	
  the	
  worksta>on	
  and	
  installed	
  with	
  the	
  starter	
  kit,	
  should	
  be	
  synchronized	
  with	
  a	
  version	
  
	
  control	
  system	
  and	
  stores	
  Cookbooks,	
  roles,	
  data	
  bags,	
  environments,	
  and	
  configura>on	
  files	
  
Organiza9on:	
  
	
  Used	
  in	
  chef	
  enterprise	
  server	
  to	
  restrict	
  access	
  to	
  objects,	
  nodes	
  environments,	
  roles,	
  data-­‐bags	
  etc	
  
Environments:	
  
	
  Used	
  to	
  organize	
  environments	
  (Prod/Staging/Dev/QA)	
  generally	
  used	
  with	
  cookbook	
  versions	
  
Idempotence:	
  
	
  Means	
  a	
  recipe	
  can	
  run	
  mul>ple	
  >mes	
  on	
  the	
  same	
  system	
  and	
  the	
  results	
  will	
  always	
  be	
  iden>cal	
  
	
  
	
  
Learning ChefChef Server
Learning Chef
	
  
	
  
Chef	
  Server	
  
	
  
Two	
  types	
  of	
  Chef-­‐server:	
  
	
  
1.  OpenSource	
  Chef-­‐server	
  
§  Free	
  version	
  of	
  Chef	
  
§  Each	
  instance	
  of	
  the	
  server	
  must	
  be	
  configured	
  and	
  managed	
  locally	
  (includes	
  all	
  aspects	
  of	
  
managing	
  the	
  server,	
  updates,	
  migra>ons,	
  scalability,	
  etc.	
  
	
  
2.  Chef-­‐server	
  enterprise	
  (hosted)	
  
§  Scalable	
  by	
  design	
  	
  
§  Available	
  organiza>ons	
  
§  Always	
  available	
  	
  
§  Resource-­‐based	
  access	
  control	
  
3.  Chef-­‐server	
  enterprise	
  (on-­‐premise)	
  
§  Scalable	
  by	
  design	
  	
  
§  Available	
  organiza>ons	
  
§  Hosted	
  on-­‐premise	
  behind	
  your	
  firewall	
  
§  Managed	
  yourself	
  
	
  	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Server:	
  Enterprise	
  
	
  
§  Allows	
  crea>on	
  of	
  organiza>ons	
  
§  Organiza>ons	
  	
  separate	
  the	
  infrastructure,	
  policies,	
  and	
  cookbooks	
  
§  Nodes	
  are	
  registered	
  in	
  organiza>ons	
  
§  Nothing	
  can	
  be	
  shared	
  between	
  organiza>ons	
  
§  Enterprise	
  chef	
  server	
  can	
  contain	
  many	
  different	
  organiza>ons	
  
§  OpenSource	
  chef	
  the	
  local	
  individual	
  server	
  acts	
  as	
  an	
  organiza>on	
  and	
  does	
  not	
  allow	
  crea>on	
  of	
  
organiza>ons	
  
§  Organiza>ons	
  can	
  represent	
  different	
  companies,	
  department,	
  infrastructures,	
  applica>ons,	
  and	
  so	
  forth	
  
§  For	
  each	
  organiza>on	
  in	
  order	
  to	
  start	
  bootstrapping	
  nodes	
  you	
  need	
  to	
  download	
  the	
  starter	
  kit	
  
§  Starter	
  kit	
  provides	
  security	
  creden>als	
  (valida>on.pem	
  keys)	
  to	
  authen>cate	
  each	
  node	
  to	
  the	
  chef	
  server 	
  	
  
§  Chef	
  enterprise	
  scales	
  by	
  design	
  to	
  handle	
  thousands	
  of	
  nodes	
  and	
  different	
  organiza>ons	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Server:	
  Role	
  of	
  the	
  server	
  
	
  
§  Stores	
  system	
  configura>on	
  informa>on	
  (policies	
  for	
  nodes)	
  
§  Authen>cates	
  worksta>ons	
  and	
  nodes	
  
§  Delivers	
  configura>ons	
  to	
  nodes	
  
§  Chef	
  server	
  holds	
  the	
  configura>on	
  and	
  the	
  node	
  checks-­‐in	
  to	
  receive	
  instruc>ons	
  on	
  its	
  desired	
  state	
  
§  The	
  node	
  downloads	
  configura>on	
  instruc>ons	
  from	
  the	
  server	
  and	
  does	
  all	
  of	
  the	
  work	
  
	
  
Learning ChefChef Workstation
Learning Chef
	
  
	
  
Chef	
  Worksta>on	
  
	
  
§  Developing	
  cookbooks	
  and	
  recipes	
  
§  Synchronizing	
  chef-­‐repo	
  with	
  git/svn	
  (source	
  control)	
  
§  Using	
  knife	
  to	
  upload	
  and	
  manage	
  node	
  and	
  chef	
  server	
  configura>ons	
  and	
  
policies	
  
§  Organiza>ons	
  
§  Nodes	
  
§  Environments	
  
§  Data	
  bags	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Organiza>on	
  Starter	
  Kit	
  
	
  
§  Each	
  organiza>on	
  has	
  a	
  starter	
  kit	
  which	
  provides	
  the	
  chef-­‐repo	
  as	
  well	
  as	
  
security	
  creden>als	
  for	
  communica>ng	
  with	
  the	
  server	
  
§  Knife.rb	
  configura>on	
  file	
  is	
  located	
  in	
  the	
  chef-­‐repo	
  (starter	
  kit)	
  
§  Starter	
  kit	
  can	
  be	
  re-­‐downloaded	
  from	
  the	
  chef-­‐server	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Organiza>on	
  Starter	
  Kit	
  
	
  
§  Each	
  >me	
  you	
  download	
  a	
  new	
  starter	
  kit	
  the	
  security	
  keys	
  for	
  that	
  repo	
  to	
  the	
  
server	
  are	
  reset	
  
§  	
  As	
  a	
  result	
  you	
  have	
  to	
  redistribute	
  the	
  security	
  keys	
  to	
  other	
  team	
  members	
  if	
  a	
  
new	
  starter	
  kit	
  for	
  the	
  organiza>on	
  is	
  downloaded	
  
	
  
§  During	
  bootstrap	
  oragniza>on-­‐validator.pem	
  is	
  copied	
  to	
  the	
  node	
  as	
  
valida>on.pem	
  
§  During	
  the	
  first	
  chef-­‐client	
  run	
  the	
  valida>on.pem	
  signs	
  the	
  client.pem	
  key	
  which	
  
is	
  used	
  to	
  authen>cate	
  the	
  node	
  against	
  the	
  chef	
  server	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Organiza>on	
  Starter	
  Kit	
  
	
  
§  Security	
  considera>ons	
  for	
  valida>on.pem	
  
§  It	
  should	
  be	
  removed	
  first	
  when	
  the	
  chef-­‐client	
  convergence	
  runs	
  
§  If	
  chef-­‐client	
  locks	
  then	
  key	
  is	
  located	
  on	
  node	
  if	
  node	
  is	
  compromised	
  
then	
  your	
  en>re	
  infrastructure	
  is	
  	
  
§  Chef-­‐client	
  (super	
  market	
  cookbook)	
  provides	
  this	
  func>onality	
  
§  Can	
  always	
  write	
  your	
  own	
  recipe	
  to	
  remove	
  valida>on.pem	
  and	
  run	
  it	
  
first	
  in	
  the	
  run_list	
  
§  file	
  "/etc/chef/valida>on.pem"	
  do	
  
§  	
   ac>on	
  :delete	
  
§  End	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Knife	
  
	
  
Knife	
  is	
  the	
  command	
  line	
  tool	
  used	
  to	
  provide	
  an	
  interface	
  between	
  your	
  local	
  
chef-­‐repo	
  and	
  the	
  chef-­‐server	
  
	
  
§  Crea>ng	
  cookbooks	
  
§  Uploading	
  cookbooks	
  to	
  chef	
  server	
  
§  Managing	
  roles	
  and	
  run_lists	
  
§  Searching	
  chef-­‐server	
  node	
  object	
  data	
  
§  Bootstrapping	
  nodes	
  
§  Essen>ally	
  everything	
  we	
  need	
  to	
  do	
  as	
  a	
  DevOps	
  admin	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Knife	
  
	
  
Chef	
  and	
  knife	
  interface	
  can	
  be	
  installed	
  to	
  OSX	
  and	
  Linux:	
  
	
  curl	
  –L	
  h_ps://www.opscode.com/chef/install.sh	
  |	
  sudo	
  bash	
  
	
  
Download	
  and	
  install	
  Chef	
  manually	
  for	
  windows:	
  
	
  h_p://www.getchef.com/chef/install/	
  
	
  
This	
  course	
  will	
  use	
  a	
  Linux	
  CentOS	
  6.5	
  Image	
  as	
  the	
  worksta>on	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Knife	
  configura>on	
  file	
  (knife.rb)	
  
	
  
§  Is	
  found	
  inside	
  the	
  chef-­‐repo	
  which	
  is	
  available	
  inside	
  the	
  starter	
  kit	
  of	
  an	
  
organiza>on	
  
§  Configure	
  proxy	
  selngs	
  here	
  if	
  worksta>on	
  is	
  behind	
  a	
  proxy	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Using	
  knife	
  to	
  bootstrap	
  a	
  node	
  
	
  
Bootstrapping	
  connects	
  the	
  worksta>on	
  to	
  the	
  node	
  to	
  install:	
  
	
  
§  Installs	
  knife	
  
§  Ohai:	
  
Used	
  to	
  detect	
  a_ributes	
  on	
  a	
  node	
  and	
  report	
  them	
  to	
  chef-­‐client	
  at	
  the	
  start	
  of	
  
every	
  client	
  run	
  it	
  is	
  required	
  for	
  chef-­‐client	
  to	
  work	
  and	
  it	
  builds	
  the	
  node	
  object	
  
	
  
§  Ruby	
  
§  Chef-­‐client	
  
§  A	
  few	
  other	
  addi>onal	
  items	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Worksta>on:	
  Using	
  knife	
  to	
  bootstrap	
  a	
  node	
  
	
  
Knife	
  bootstrap	
  <address>	
  -­‐x	
  user	
  –P	
  password	
  –N	
  nodename	
  
	
  
§  For	
  star>ng	
  in	
  this	
  course	
  we	
  will	
  define	
  a	
  node	
  name	
  
§  In	
  produc>on	
  it	
  is	
  best	
  prac>ce	
  not	
  to	
  define	
  –N	
  and	
  let	
  the	
  FQDN	
  
work	
  as	
  the	
  node	
  name	
  
Note:	
  For	
  linuxacademy.com	
  lab	
  servers	
  when	
  bootstrapping	
  use	
  your	
  
public	
  hostname	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
	
  
Learning ChefChef Server & Nodes
Learning Chef
	
  
	
  
Chef	
  Server	
  &	
  Nodes	
  
	
  
A	
  node	
  can	
  be	
  anything	
  that	
  can	
  run	
  the	
  chef-­‐client	
  agent	
  
•  Smart	
  phones	
  
•  Switches	
  
•  APIs	
  
•  FreeBSD	
  servers	
  
•  Unix	
  Servers	
  
•  Windows	
  Servers	
  
•  Linux	
  Servers	
  
•  Etc.	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Server	
  &	
  Nodes	
  
	
  
Chef	
  server	
  stores	
  all	
  policy	
  and	
  configura>on	
  informa>on	
  for	
  nodes	
  
The	
  node	
  uses	
  the	
  client.pem	
  file	
  (created	
  by	
  validator.pem)	
  during	
  the	
  chef-­‐
client	
  run	
  in	
  order	
  to	
  authen>cate	
  against	
  the	
  chef	
  server	
  
	
  
Chef-­‐client	
  run:	
  
•  Authen>cate	
  against	
  the	
  chef-­‐server	
  using	
  client.pem	
  	
  
•  Builds	
  the	
  node	
  object	
  and	
  runs	
  ohai	
  
•  Syncronizes	
  with	
  the	
  chef-­‐server	
  (sends	
  node	
  object	
  informa>on	
  and	
  receives	
  
cookbooks/policies)	
  
•  Executes/compiles	
  the	
  desired	
  policies	
  
•  Runs	
  the	
  node	
  object	
  
•  Completes	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
Learning ChefChef Configuration Concepts
Learning Chef
	
  
	
  
Chef	
  Configura>on	
  Concepts	
  
	
  
Policy:	
  
§  A	
  collec>on	
  of	
  system	
  configura>ons	
  that	
  you	
  define	
  (roles/data	
  bags/
environments)	
  
§  The	
  policy	
  states	
  the	
  state	
  that	
  each	
  resources	
  should	
  be	
  in	
  but	
  not	
  how	
  to	
  get	
  
there	
  
§  Chef-­‐client	
  will	
  pull	
  the	
  policy	
  and	
  configure	
  the	
  node	
  so	
  that	
  it	
  matches	
  the	
  
state	
  of	
  the	
  policy	
  
§  Policy	
  concept	
  examples:	
  
§  If	
  it	
  should	
  be	
  installed	
  
§  If	
  it	
  is	
  not	
  installed	
  then	
  install	
  it	
  
§  If	
  it	
  is	
  already	
  installed	
  then	
  do	
  nothing	
  
§  A	
  file	
  should	
  exist	
  if	
  not	
  create	
  it	
  
§  If	
  a	
  file	
  exists	
  but	
  does	
  not	
  have	
  correct	
  content	
  
	
  
	
  
	
  
	
  
	
  	
  
Learning Chef
	
  
	
  
Chef	
  Configura>on	
  Concepts	
  
	
  
Resources:	
  Defines	
  the	
  desired	
  state	
  for	
  a	
  single	
  configura9on	
  item	
  present	
  on	
  a	
  
node	
  that	
  is	
  under	
  management	
  by	
  Chef	
  
§  Does	
  the	
  configura>on	
  on	
  a	
  node	
  and	
  maps	
  to	
  providers	
  
§  Recipes	
  are	
  stored	
  in	
  cookbooks	
  
§  Represent	
  a	
  piece	
  of	
  the	
  system	
  and	
  its	
  desired	
  state	
  
§  Building	
  blocks	
  of	
  Chef	
  configura>on	
  
§  When	
  chef-­‐client	
  is	
  run	
  on	
  a	
  node	
  the	
  resource	
  is	
  executed	
  by	
  the	
  
provider	
  which	
  is	
  handled	
  by	
  Chef	
  and	
  the	
  OS	
  itself	
  
§  Informa>on	
  as	
  to	
  what	
  provider	
  to	
  use	
  (ie	
  what	
  package	
  manager	
  to	
  use)	
  
is	
  populated	
  when	
  ohai	
  is	
  run	
  at	
  the	
  start	
  of	
  each	
  chef-­‐client	
  run	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef	
  Configura>on	
  Concepts	
  
	
  
Most	
  common	
  resources	
  in	
  configura>on	
  management	
  
	
  
Package:	
  
Used	
  to	
  manage	
  packages	
  such	
  as	
  installing	
  a	
  required	
  package	
  
Template:	
  	
  
Used	
  to	
  manage	
  the	
  contents	
  of	
  a	
  Ruby	
  template	
  in	
  the	
  cookbook	
  
Service:	
  
Manage	
  system	
  services	
  
What	
  run-­‐levels	
  to	
  start	
  the	
  service	
  in	
  
Current	
  state	
  of	
  the	
  service	
  (running/stopped/etc)	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Chef-­‐client	
  nodes	
  concepts	
  
	
  
§  Nodes	
  can	
  be	
  configured	
  to	
  automa>cally	
  running	
  chef-­‐client	
  in	
  intervals	
  
§  When	
  convergence	
  occurs	
  the	
  node	
  can	
  put	
  itself	
  back	
  into	
  compliance	
  
(desired	
  state	
  and	
  how	
  to	
  get	
  there)	
  
§  Chef	
  server	
  does	
  not	
  know	
  the	
  status	
  of	
  a	
  node	
  un>l	
  a	
  convergence	
  is	
  run	
  
§  Something	
  could	
  happen	
  to	
  cause	
  the	
  node	
  to	
  get	
  out	
  of	
  compliance	
  but	
  
a	
  convergence	
  will	
  check	
  policies/configura>on	
  and	
  put	
  the	
  node	
  back	
  
into	
  compliance	
  based	
  off	
  your	
  defined	
  configura>ons	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Key	
  concepts:	
  
	
  
Recipes	
  are	
  made	
  up	
  of	
  a	
  collec>on	
  of	
  resources	
  
	
  
Cookbooks	
  are	
  made	
  up	
  of	
  a	
  collec>on	
  of	
  recipes	
  
	
  
Nodes	
  receive	
  their	
  policy	
  based	
  off	
  of	
  roles	
  and	
  individual	
  node	
  configura>ons	
  
	
  
A	
  run	
  list	
  defines	
  the	
  order	
  in	
  which	
  you	
  want	
  your	
  recipes	
  to	
  run	
  during	
  convergence	
  
	
  
Configura>on	
  dri#	
  occurs	
  when	
  the	
  desired	
  state	
  of	
  the	
  node	
  does	
  not	
  match	
  the	
  
desired	
  state	
  as	
  defined	
  in	
  the	
  policies	
  on	
  the	
  chef	
  server	
  
	
  
Configura>on	
  dri#	
  can	
  be	
  resolved	
  by	
  automa>ng/running	
  the	
  chef-­‐client	
  agent	
  	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
Learning ChefAttribute Precedence
Learning Chef
	
  
	
  
Key	
  concepts:	
  
	
  
A_ributes	
  are	
  specific	
  details	
  about	
  a	
  node	
  	
  
	
  
A_ributes	
  describe:	
  
•  The	
  current	
  state	
  of	
  the	
  node	
  
•  What	
  the	
  sate	
  of	
  the	
  node	
  was	
  at	
  the	
  end	
  of	
  the	
  previous	
  chef-­‐client	
  run	
  
•  What	
  the	
  state	
  of	
  the	
  node	
  should	
  be	
  at	
  the	
  end	
  of	
  the	
  current	
  chef-­‐client	
  run	
  
A_ributes	
  can	
  be	
  defined	
  by:	
  
•  The	
  state	
  of	
  the	
  node	
  (ohai)	
  
•  Cookbooks	
  (Our	
  a_ribute	
  files)	
  
•  Roles	
  
•  Environments	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
A_ribute	
  Precedence	
  
	
  
A#er	
  the	
  node	
  object	
  is	
  rebuilt	
  in	
  the	
  chef	
  run,	
  all	
  a_ributes	
  loaded	
  in	
  the	
  chef-­‐client	
  are	
  
then	
  compared.	
  The	
  node	
  is	
  updated	
  based	
  on	
  a_ribute	
  precedence	
  and	
  at	
  the	
  very	
  end	
  
of	
  the	
  convergence	
  (chef-­‐client)	
  the	
  node	
  object	
  is	
  uploaded	
  to	
  the	
  chef	
  server	
  	
  
	
  
Node	
  object	
  defines	
  the	
  current	
  state	
  of	
  the	
  node	
  (made	
  up	
  of	
  a_ributes)	
  
Node	
  object	
  is	
  stored	
  on	
  the	
  chef	
  server	
  so	
  that	
  it	
  can	
  be	
  searched	
  
Node	
  object	
  is	
  updated	
  at	
  each	
  convergence	
  
	
  
If	
  there	
  are	
  a_ributes	
  with	
  the	
  same	
  names	
  then	
  a_ribute	
  precedence	
  determines	
  which	
  
a_ribute	
  is	
  applied	
  to	
  the	
  node	
  and	
  the	
  node	
  object.	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
A_ribute	
  Precedence:	
  Levels	
  of	
  precedence	
  
	
  
default:	
  
	
  Automa>cally	
  reset	
  at	
  the	
  start	
  of	
  every	
  chef	
  client	
  run	
  is	
  the	
  lowest	
  level	
  of	
  precedence	
  	
  
force_default:	
  
	
  Used	
  in	
  a	
  cookbook	
  or	
  recipe	
  to	
  override	
  an	
  exis>ng	
  “default”	
  a_ribute	
  	
  
Normal:	
  
	
  A	
  selng	
  that	
  persists	
  in	
  the	
  node	
  object	
  	
  
Override:	
  
	
  Automa>cally	
  reset	
  at	
  the	
  start	
  of	
  every	
  chef-­‐client	
  most	
  o#en	
  should	
  be	
  used	
  only	
  when	
  required	
  
force_override:	
  	
  	
  
	
  used	
  to	
  ensure	
  that	
  an	
  a_ribute	
  defined	
  in	
  a	
  cookbook	
  (by	
  an	
  a_ribute	
  file	
  or	
  by	
  a	
  recipe)	
  takes	
  
	
  precedence	
  over	
  an	
  override	
  a_ribute	
  set	
  by	
  a	
  role	
  or	
  an	
  environment	
  
Automa9c:	
  	
  
	
  Contains	
  data	
  populated	
  by	
  Ohai	
  at	
  the	
  beginning	
  of	
  every	
  chef-­‐client	
  run	
  and	
  cannot	
  be	
  modified	
  and	
  	
  	
  	
  	
  	
  	
  
	
  always	
  has	
  the	
  highest	
  a_ribute	
  precedence	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
Learning Chef
	
  
	
  
A_ribute	
  Precedence:	
  Levels	
  of	
  precedence	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning ChefNode Object
Learning Chef
	
  
	
  
Node	
  Object	
  
	
  
Node	
  object	
  is	
  made	
  up	
  of	
  the	
  run	
  lists	
  which	
  define	
  what	
  recipes	
  to	
  run	
  during	
  a	
  chef-­‐client	
  as	
  
well	
  as	
  the	
  aMributes	
  that	
  define	
  informa6on	
  about	
  the	
  node	
  
	
  
A_ributes	
  are	
  built	
  during	
  the	
  chef-­‐client	
  run	
  process:	
  
§  Data	
  about	
  the	
  node	
  is	
  collected	
  by	
  Ohai	
  
§  The	
  node	
  object	
  previously	
  saved	
  during	
  the	
  last	
  chef-­‐client	
  run	
  	
  
§  The	
  rebuilt	
  node	
  object	
  from	
  the	
  current	
  chef-­‐client	
  run	
  
	
  
Once	
  the	
  node	
  object	
  is	
  rebuilt	
  all	
  a_ributes	
  are	
  compared	
  and	
  then	
  updated	
  based	
  on	
  a_ribute	
  precedence	
  
	
  
At	
  the	
  end	
  of	
  every	
  chef-­‐client	
  run	
  the	
  node	
  object	
  that	
  defines	
  the	
  current	
  state	
  of	
  the	
  node	
  is	
  uploaded	
  to	
  
the	
  chef	
  server	
  to	
  be	
  searched.	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
Learning ChefEnvironments
Learning Chef
	
  
	
  
Environments:	
  What	
  are	
  environments?	
  
	
  
“An	
  environment	
  is	
  a	
  way	
  to	
  map	
  an	
  organiza6ons	
  real-­‐life	
  workflow	
  to	
  what	
  can	
  be	
  
configured	
  and	
  managed	
  using	
  the	
  Chef	
  server”	
  	
  
	
  
Apply	
  different	
  cookbook	
  versions	
  to	
  specific	
  environments	
  (dev/prod/staging/qa/)	
  
	
  
Define	
  Environment	
  level	
  a_ributes	
  	
  
	
  
Environments	
  allow	
  sharing	
  of	
  cookbooks	
  within	
  an	
  organiza>on	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Environments:	
  Crea>ng	
  environments	
  
	
  
•  Environment	
  informa>on	
  can	
  be	
  stored	
  in	
  JSON	
  files	
  or	
  .rb	
  files	
  
•  Environments	
  will	
  be	
  located	
  in	
  chef-­‐repo/environments	
  
•  Example	
  dev.rb	
  (development	
  environment	
  file)	
  
	
  name	
  "dev"	
  
	
  descrip>on	
  ”Development	
  environment”	
  
	
  cookbook	
  "security",	
  "=	
  0.1.0”	
  
	
  cookbook	
  ”motd",	
  "=	
  0.2.0"	
  
	
  cookbook	
  "apache",	
  "=	
  0.2.0"	
  
	
  override_a_ributes({	
  
	
  	
  	
  	
  	
  	
  	
  	
   	
  “author"	
  =>	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
   	
  	
  	
  	
  	
  	
  “name"	
  =>	
  true	
  
	
  	
  	
  	
  	
  	
   	
  	
  	
  }	
  
	
  })	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Environments:	
  A_ributes	
  
	
  
Two	
  types	
  of	
  a_ribute	
  precedence	
  can	
  be	
  set	
  on	
  the	
  environment	
  level	
  
	
  
•  default	
  a	
  default	
  a_ribute	
  defined	
  in	
  the	
  environment	
  will	
  take	
  precedence	
  over	
  a	
  
default	
  a_ribute	
  defined	
  in	
  a	
  cookbook	
  a_ribute	
  file.	
  
•  Override	
  has	
  higher	
  precedence	
  than	
  default,	
  force_default,	
  and	
  normal	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Environments:	
  Methods	
  of	
  assigning	
  a	
  node	
  to	
  an	
  environment	
  
	
  
•  Modify	
  the	
  client.rb	
  file	
  with	
  an	
  environment	
  variable	
  
•  Knife-­‐flip	
  to	
  do	
  it	
  from	
  the	
  worksta>on	
  	
  
•  Assign	
  it	
  manually	
  on	
  the	
  node	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
Learning Chef
	
  
	
  
Environments:	
  Lab	
  goals	
  
	
  
ü  Configure	
  two	
  environments:	
  Dev/Produc>on	
  
ü  Modify	
  Apache	
  cookbooks	
  with	
  newer	
  versions	
  
ü  Set	
  newer	
  versions	
  to	
  dev	
  and	
  older	
  versions	
  to	
  produc>on	
  
ü  Configure	
  Client.rb	
  to	
  look	
  at	
  proper	
  environment	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  	
  
	
  
	
  
	
  
	
  
Learning ChefSearch
Learning Chef
	
  
	
  
Search:	
  
	
  
Chef	
  search	
  allows	
  queries	
  to	
  be	
  made	
  for	
  any	
  type	
  of	
  data	
  that	
  is	
  indexed	
  by	
  the	
  chef	
  
server.	
  Search	
  queries	
  the	
  chef	
  server	
  for	
  stored	
  informa6on.	
  
	
  
Can	
  Search:	
  
	
  
§  Data	
  bags	
  
§  Environments	
  
§  Roles	
  
§  Nodes	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Search:	
  Methods	
  of	
  search	
  
	
  
Search	
  with	
  Knife:	
  
	
  Syntax:	
  knife	
  search	
  node	
  “key:pa_ern”	
  –a	
  (a_ribute)	
  
§  Search	
  nested	
  a_ributes	
  
§  “memory_total:*”	
  –a	
  memory.total	
  	
  
§  Can	
  use	
  basic	
  “wild	
  cards”	
  in	
  the	
  pa_ern	
  “ipaddress:192.168.*”	
  
§  Can	
  search	
  based	
  off	
  ranges	
  “ipaddress:[192.168.*	
  TO	
  192.172.*]”	
  
	
  
	
  
Search	
  inside	
  of	
  recipes	
  
	
  Example:	
  	
  
	
   	
  Use	
  Ruby	
  recipe	
  to	
  search	
  all	
  nodes	
  that	
  are	
  running	
  an	
  outdated	
  package	
  
	
  	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning ChefData Bags
Learning Chef
	
  
	
  
Data	
  Bags	
  
	
  
A	
  data	
  bag	
  is	
  a	
  global	
  variable	
  that	
  is	
  stored	
  in	
  JSON	
  data	
  and	
  accessible	
  from	
  the	
  chef	
  server.	
  A	
  
data	
  bag	
  is	
  indexed	
  for	
  searching	
  and	
  can	
  be	
  loaded	
  by	
  a	
  recipe	
  or	
  accessed	
  during	
  search.	
  
	
  
Types	
  of	
  data	
  stored	
  in	
  a	
  data	
  bag:	
  
	
  
ü  Users	
  to	
  be	
  added	
  to	
  a	
  system	
  
ü  Admins	
  to	
  be	
  added	
  to	
  sudo	
  
ü  API/DB	
  Creden>als	
  (More	
  secure	
  and	
  be_er	
  than	
  environment	
  a_ributes	
  for	
  creden>als)	
  
ü  Much	
  more	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Data	
  Bags	
  
	
  
{	
  
	
  "id":	
  “anthony",	
  
	
  "comment":	
  ”Anthony	
  admin	
  user",	
  
	
  "uid":	
  2005,	
  
	
  "gid":	
  0,	
  
	
  "home":	
  "/home/anthony",	
  
	
  "shell":	
  "/bin/bash"	
  
	
  
}	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning ChefRoles
Learning Chef
	
  
	
  
Roles	
  
	
  
“A	
  role	
  is	
  a	
  way	
  to	
  define	
  certain	
  paMerns	
  and	
  processes	
  that	
  exist	
  across	
  nodes	
  in	
  an	
  
organiza6on	
  as	
  belonging	
  to	
  a	
  single	
  job	
  func6on”	
  
	
  
§  Up	
  un>l	
  this	
  point	
  we	
  have	
  assigned	
  recipes	
  to	
  be	
  run	
  for	
  each	
  node	
  	
  
§  Instead	
  of	
  upda>ng	
  run_lists	
  for	
  a	
  node	
  all	
  we	
  have	
  to	
  do	
  is	
  update	
  a	
  role	
  on	
  
the	
  server	
  
§  Prevents	
  us	
  from	
  having	
  to	
  manually	
  touch	
  all	
  nodes	
  that	
  need	
  the	
  change	
  	
  
§  A	
  role	
  is	
  essen>ally	
  a	
  lis>ng	
  of	
  recipes	
  and	
  a_ributes	
  that	
  are	
  to	
  be	
  executed	
  on	
  a	
  
node	
  
§  Instead	
  of	
  assigning	
  a	
  run	
  list	
  for	
  each	
  node	
  we	
  assign	
  the	
  node	
  a	
  role	
  
§  A	
  base	
  role	
  can	
  be	
  assigned	
  inside	
  of	
  a	
  roles	
  run_list	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Roles:	
  Role	
  management	
  with	
  knife	
  
	
  
§  Knife	
  role	
  create	
  role_name	
  
§  Chef-­‐repo/roles/rolename.rb	
  
§  Knife	
  role	
  from	
  file	
  chef-­‐repo/roles/rolename.rb	
  
§  Knife	
  role	
  list	
  –w	
  (views	
  a	
  list	
  of	
  roles	
  on	
  the	
  chef	
  server)	
  
§  Knife	
  role	
  delete	
  role_name	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Roles:	
  Produc>on	
  	
  
	
  
How	
  can	
  we	
  spin	
  up	
  new	
  nodes	
  (like	
  auto	
  scaling)	
  without	
  having	
  to	
  manually	
  modify	
  
run_lists	
  in	
  a	
  node?	
  
§  Pass	
  in	
  cloud-­‐init	
  informa>on	
  about	
  the	
  node	
  
§  Create	
  Virtual	
  Machine	
  Images	
  a#er	
  a	
  node	
  has	
  been	
  bootstrapped	
  
§  Do	
  not	
  name	
  the	
  node	
  but	
  instead	
  let	
  it	
  use	
  the	
  FQDN	
  as	
  the	
  node	
  name	
  
§  Modify	
  /etc/chef/first-­‐boot.json	
  to	
  include	
  the	
  “role”	
  of	
  the	
  node	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning ChefKnife Plugins
Learning Chef
	
  
	
  
Knife	
  Plugins	
  
	
  
Knife	
  can	
  be	
  extended	
  with	
  the	
  use	
  of	
  plugins	
  
	
  
§  Knife-­‐flip:	
  Manage	
  environments	
  for	
  nodes	
  
§  Cloud	
  plazorms:	
  azure,	
  ec2,	
  google,	
  linode,	
  openstack,	
  rackspace,	
  etc	
  
§  Custom	
  plugins	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning ChefProduction Work Flow & Unattended Installs
Learning Chef
	
  
	
  
Work	
  Flow:	
  
	
  
§  Nodes	
  should	
  be	
  bootstrapped	
  and	
  managed	
  from	
  the	
  worksta>on	
  
§  Nodes	
  should	
  be	
  assigned	
  roles	
  and	
  environments	
  	
  
§  A_ributes	
  specific	
  to	
  roles/environments	
  should	
  be	
  configured	
  accordingly	
  
§  For	
  auto	
  scaling	
  environments	
  such	
  as	
  AWS	
  “una_ended”	
  bootstrapping	
  should	
  be	
  
used	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Learning Chef
	
  
	
  
Work	
  Flow:	
  Una_ended	
  Bootstrapping	
  
	
  
In	
  order	
  to	
  have	
  an	
  una_ended	
  install	
  the	
  node	
  when	
  first	
  created	
  must	
  meet	
  the	
  
following	
  criteria:	
  
	
  
§  Must	
  be	
  able	
  to	
  authen>cate	
  to	
  the	
  chef	
  server	
  
§  Must	
  be	
  able	
  to	
  configure	
  a	
  run_list	
  	
  
§  Must	
  be	
  able	
  to	
  access	
  the	
  chef-­‐validator.pem	
  so	
  that	
  it	
  may	
  create	
  a	
  new	
  
client.pem	
  and	
  iden>ty	
  on	
  the	
  chef	
  server	
  
§  Must	
  have	
  a	
  unique	
  node	
  name	
  
§  Client.rb	
  file	
  must	
  have	
  proper	
  configura>on	
  so	
  that	
  it	
  knows	
  what	
  server	
  to	
  
communicate	
  with	
  
§  Modify	
  the	
  file.json	
  in	
  /etc/chef	
  to	
  include	
  the	
  run_list	
  for	
  the	
  node	
  
§  This	
  will	
  ideally	
  include	
  a	
  way	
  to	
  automate	
  the	
  running	
  of	
  chef-­‐client	
  
	
  
	
  
	
  
	
  
AWS CSA
Certification
Example:
Simple code that when
run will create an S3
bucket.
Version control your infrastructure!
{	
  
	
  
	
  
	
  	
  "Descrip>on"	
  :	
  "This	
  template	
  will	
  create	
  an	
  s3bucket",	
  
	
  
	
  	
  "Resources"	
  :	
  {	
  
	
  	
  	
  	
  "S3Bucket"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Type"	
  :	
  "AWS::S3::Bucket",	
  
	
  	
  	
  	
  	
  	
  "Proper>es"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  	
  	
  "AccessControl"	
  :	
  "PublicRead",	
  
	
  	
  	
  	
  	
  	
  	
  	
  "BucketName"	
  :	
  "gigitygumdrops"	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  }	
  
	
  	
  },	
  
	
  
	
  	
  "Outputs"	
  :	
  {	
  
	
  	
  	
  	
  "BucketName"	
  :	
  {	
  
	
  	
  	
  	
  	
  	
  "Value"	
  :	
  {	
  "Ref"	
  :	
  "S3Bucket"	
  },	
  
	
  	
  	
  	
  	
  	
  "Descrip>on"	
  :	
  "Created	
  bucket	
  for	
  storing	
  websites"	
  
	
  	
  	
  	
  }	
  
	
  	
  }	
  
}	
  
PRESENTATION
TITLE
List Title:
Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Aenean pellentesque facilisis
felis. Suspendisse ipsum erat,
facilisis at euismod vel,
consequat vitae nulla. Curabitur
fringilla, ligula a sagittis
venenatis, odio velit ornare
ligula, non semper ligula eros
eget neque. Ut sagittis vulputate
est, in mollis libero varius eget.
Cras felis felis, feugiat a sem a,
pharetra elementum arcu.
In odio lectus, placerat ut felis
vitae, ullamcorper facilisis elit.
Nam posuere metus et velit
commodo tincidunt.
" Linux List Item Number 1
" Linux List Item Number 2
" Linux List Item Number 3
" Linux List Item Number 4
" AWS List Item Number 1
" AWS List Item Number 2
" AWS List Item Number 3
" AWS List Item Number 4
PRESENTATION
TITLE
Image Title:Content area for image description or caption. Even regular content simply
associated with the image. Content area for image description or caption. Even
regular content simply associated with the image.
	
  
PRESENTATION
TITLEChart Title: Lorem ipsum dolor sit amet,
consectetur adipiscing elit.
Aenean pellentesque facilisis
felis. Suspendisse ipsum
erat, facilisis at euismod vel,
consequat vitae nulla.
Lorem
Ipsum
Dolor

More Related Content

What's hot

Docker
DockerDocker
Docker
Michael Lihs
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
Michael Lihs
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
Jennifer Davis
 
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Simplilearn
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014
Michael Lihs
 
Codecoon - A technical Case Study
Codecoon - A technical Case StudyCodecoon - A technical Case Study
Codecoon - A technical Case Study
Michael Lihs
 
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
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
Jennifer Davis
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
Jennifer Davis
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
Raimonds Simanovskis
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Chef
 
Opscode tech festa july 2013
Opscode tech festa   july 2013Opscode tech festa   july 2013
Opscode tech festa july 2013
Chef Software, Inc.
 
Chef introduction
Chef introductionChef introduction
Chef introduction
FENG Zhichao
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation Workshop
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 Software, Inc.
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
Pubudu Suharshan Perera
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Michael Lihs
 
Understand Chef
Understand ChefUnderstand Chef
Understand Chef
devopsjourney
 
Chef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK BoxChef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK Box
Chef Software, Inc.
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
Chef Software, Inc.
 

What's hot (20)

Docker
DockerDocker
Docker
 
Test-Driven Infrastructure with Chef
Test-Driven Infrastructure with ChefTest-Driven Infrastructure with Chef
Test-Driven Infrastructure with Chef
 
Automating Infrastructure with Chef
Automating Infrastructure with ChefAutomating Infrastructure with Chef
Automating Infrastructure with Chef
 
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
Chef Tutorial | Chef Tutorial For Beginners | DevOps Chef Tutorial | DevOps T...
 
Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014Vagrant and Chef on FOSSASIA 2014
Vagrant and Chef on FOSSASIA 2014
 
Codecoon - A technical Case Study
Codecoon - A technical Case StudyCodecoon - A technical Case Study
Codecoon - A technical Case Study
 
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
 
Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015Introduction to Chef - April 22 2015
Introduction to Chef - April 22 2015
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
Server Installation and Configuration with Chef
Server Installation and Configuration with ChefServer Installation and Configuration with Chef
Server Installation and Configuration with Chef
 
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
Community Cookbooks & further resources - Fundamentals Webinar Series Part 6
 
Opscode tech festa july 2013
Opscode tech festa   july 2013Opscode tech festa   july 2013
Opscode tech festa july 2013
 
Chef introduction
Chef introductionChef introduction
Chef introduction
 
Compliance Automation Workshop
Compliance Automation WorkshopCompliance Automation Workshop
Compliance Automation Workshop
 
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...
 
Introduction to Chef
Introduction to ChefIntroduction to Chef
Introduction to Chef
 
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
Continuous Integration with Open Source Tools - PHPUgFfm 2014-11-20
 
Understand Chef
Understand ChefUnderstand Chef
Understand Chef
 
Chef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK BoxChef ignited a DevOps revolution – BK Box
Chef ignited a DevOps revolution – BK Box
 
The unintended benefits of Chef
The unintended benefits of ChefThe unintended benefits of Chef
The unintended benefits of Chef
 

Viewers also liked

It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
Carlos Perez
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
George Miranda
 
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
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an Introduction
Sanjeev Sharma
 
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
Amazon Web Services
 
AWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh VariaAWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
Amazon Web Services
 
Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud
Owain Perry
 
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
Amazon Web Services
 
AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...
AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...
AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...
Amazon Web Services
 
Automated Deployment with Capistrano
Automated Deployment with CapistranoAutomated Deployment with Capistrano
Automated Deployment with Capistrano
Sumit Chhetri
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
Chef Software, Inc.
 
AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...
AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...
AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...
Amazon Web Services
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
Lalatendu Mohanty
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
Michele Orselli
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
Kimberly Macias
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Idan Tohami
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
Amazon Web Services
 
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
Amazon Web Services
 
Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
jtyr
 
Testing Ansible with Jenkins and Docker
Testing Ansible with Jenkins and DockerTesting Ansible with Jenkins and Docker
Testing Ansible with Jenkins and Docker
Dennis Rowe
 

Viewers also liked (20)

It Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software DevelopmentIt Works On My Machine: Vagrant for Software Development
It Works On My Machine: Vagrant for Software Development
 
EC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and PackerEC2 AMI Factory with Chef, Berkshelf, and Packer
EC2 AMI Factory with Chef, Berkshelf, and Packer
 
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
 
Chef for DevOps - an Introduction
Chef for DevOps - an IntroductionChef for DevOps - an Introduction
Chef for DevOps - an Introduction
 
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
(DVO314) USA Today Uses Chef & AWS for Infrastructure Standardization
 
AWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh VariaAWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
AWS CloudFormation and Puppet at PuppetConf - Jinesh Varia
 
Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud Continuous delivery of Windows micro services in the cloud
Continuous delivery of Windows micro services in the cloud
 
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
AWS re:Invent 2016: Hybrid Architectures: Bridging the Gap to the Cloud( ARC2...
 
AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...
AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...
AWS re:Invent 2016: Getting Started with the Hybrid Cloud: Enterprise Backup ...
 
Automated Deployment with Capistrano
Automated Deployment with CapistranoAutomated Deployment with Capistrano
Automated Deployment with Capistrano
 
Multi-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and moreMulti-provider Vagrant and Chef: AWS, VMware, and more
Multi-provider Vagrant and Chef: AWS, VMware, and more
 
AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...
AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...
AWS re:Invent 2016: Hybrid Architecture Design: Connecting Your On-Premises W...
 
Vagrant For DevOps
Vagrant For DevOpsVagrant For DevOps
Vagrant For DevOps
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Vagrant to-aws-flow
Vagrant to-aws-flowVagrant to-aws-flow
Vagrant to-aws-flow
 
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.Ansible 2.0 - How to use Ansible to automate your applications in AWS.
Ansible 2.0 - How to use Ansible to automate your applications in AWS.
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
 
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
CI/CD on AWS: Deploy Everything All the Time | AWS Public Sector Summit 2016
 
Automation and Ansible
Automation and AnsibleAutomation and Ansible
Automation and Ansible
 
Testing Ansible with Jenkins and Docker
Testing Ansible with Jenkins and DockerTesting Ansible with Jenkins and Docker
Testing Ansible with Jenkins and Docker
 

Similar to Learning chef

Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
Johannes H. P. Skov Frandsen
 
Chef
ChefChef
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
John Ewart
 
Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
Mohit Sethi
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
openstackindia
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
John Osborne
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
Krishna Kishore
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
Hamza Waqas
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
Amazon Web Services
 
Introduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef AutomateIntroduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef Automate
Amazon Web Services
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
Amazon Web Services
 
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
 
Configuration Management with AWS OpsWorks for Chef Automate
Configuration Management with AWS OpsWorks for Chef AutomateConfiguration Management with AWS OpsWorks for Chef Automate
Configuration Management with AWS OpsWorks for Chef Automate
Amazon Web Services
 
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.
 
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech TalksAnnouncing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
Amazon Web Services
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetup
Suresh Paulraj
 
Cooking chef
Cooking chefCooking chef
Cooking chef
ranjithar92
 
Introduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & RemediationIntroduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & Remediation
Nicole Johnson
 
Ignite Talk on Chef
Ignite Talk on ChefIgnite Talk on Chef
Ignite Talk on Chef
Bob Nowadly
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with Chef
Joe Kepley
 

Similar to Learning chef (20)

Chef: Smart infrastructure automation
Chef: Smart infrastructure automationChef: Smart infrastructure automation
Chef: Smart infrastructure automation
 
Chef
ChefChef
Chef
 
Automating your infrastructure with Chef
Automating your infrastructure with ChefAutomating your infrastructure with Chef
Automating your infrastructure with Chef
 
Chef for Openstack
Chef for OpenstackChef for Openstack
Chef for Openstack
 
Chef for openstack
Chef for openstackChef for openstack
Chef for openstack
 
Introduction to Cooking with Chef
Introduction to Cooking with ChefIntroduction to Cooking with Chef
Introduction to Cooking with Chef
 
Introduction to chef
Introduction to chefIntroduction to chef
Introduction to chef
 
Kickstarter - Chef Opswork
Kickstarter - Chef OpsworkKickstarter - Chef Opswork
Kickstarter - Chef Opswork
 
AWS OpsWorks for Chef Automate
AWS OpsWorks for Chef AutomateAWS OpsWorks for Chef Automate
AWS OpsWorks for Chef Automate
 
Introduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef AutomateIntroduction to OpsWorks for Chef Automate
Introduction to OpsWorks for Chef Automate
 
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
AWS re:Invent 2016: Configuration Management in the Cloud (DEV305)
 
DevOps and Chef improve your life
DevOps and Chef improve your life DevOps and Chef improve your life
DevOps and Chef improve your life
 
Configuration Management with AWS OpsWorks for Chef Automate
Configuration Management with AWS OpsWorks for Chef AutomateConfiguration Management with AWS OpsWorks for Chef Automate
Configuration Management with AWS OpsWorks for Chef Automate
 
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
 
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech TalksAnnouncing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
Announcing AWS OpsWorks for Chef Automate - January 2017 AWS Online Tech Talks
 
2015 08-11-scdo-meetup
2015 08-11-scdo-meetup2015 08-11-scdo-meetup
2015 08-11-scdo-meetup
 
Cooking chef
Cooking chefCooking chef
Cooking chef
 
Introduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & RemediationIntroduction To Continuous Compliance & Remediation
Introduction To Continuous Compliance & Remediation
 
Ignite Talk on Chef
Ignite Talk on ChefIgnite Talk on Chef
Ignite Talk on Chef
 
Managing Servers with Chef
Managing Servers with ChefManaging Servers with Chef
Managing Servers with Chef
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
Wouter Lemaire
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
UI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentationUI5 Controls simplified - UI5con2024 presentation
UI5 Controls simplified - UI5con2024 presentation
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 

Learning chef

  • 2. Learning Chef     A#er  this  course  you  will  be  able  to:     §  Understand  DevOps  and  what  Chef  is   §  Know  the  role  of  worksta>ons,  nodes,  and  Chef  server   §  Deploy  and  automate  configura>ons  of  nodes     §  Understanding  of  wri>ng  Recipes  and  Cookbooks   §  Understand  the  Chef  work  flow   §  Use  Chef  to  automate  the  deployment  your  infrastructure      
  • 3. Learning Chef     How  this  course  is  laid  out:     §  Will  learn  Chef  by  working  with  single  nodes  to  start   §  Learning  to  build  cookbooks  will  follow  a  theme  such  as  installing  LAMP   §  Addi>onal  exercises  will  be  found  at  the  end  of  the  course   §  Need  access  to  LinuxAcademy.com  lab  servers  or  your  own  VM  environment   §  VirtualBox   §  VMWare  worksta>on   §  Parallels   §  Have  at  least  one  “node”  (server)  available  to  connect  to  
  • 4. Learning Chef     How  this  course  is  laid  out:     §  Will  learn  Chef  by  working  with  single  nodes  to  start   §  Need  access  to  LinuxAcademy.com  lab  servers  or  your  own  VM  environment   §  VirtualBox   §  VMWare  worksta>on   §  Parallels   §  Have  at  least  one  “node”  (server)  available  to  connect  to    
  • 6. Learning Chef     What  is  DevOps?     §  DevOps  is  about  “How  well  people  work  together  and  how   streamlined  our                Opera6ons  really  are”  –  Adam  Jacob   §  The  applica>on  and  infrastructure  that  runs  on  it  are  not   treated  as  separate  en>>es  to  each  other  and  neither  are  the   teams  that  manage  each     §  DevOps  is  part  of  con>nuous  delivery  where  all  aspects  of  the   deployment  process  are  automated   §  DevOps  is  infrastructure  as  code              
  • 8. Learning Chef     What  is  Chef?     “Chef  turns  infrastructure  into  code.  With  Chef,  you  can  automate  how   you  build,  deploy,  and  manage  your  infrastructure.  Your  infrastructure   becomes  as  versionable,  testable,  and  repeatable  as  applica6on  code.     Chef  relies  on  reusable  defini6ons  known  as  recipes  to  automate   infrastructure  tasks.  Examples  of  recipes  are  instruc6ons  for  configuring   web  servers,  databases  and  load  balancers.  Together,  recipes  describe   what  your  infrastructure  consists  of  and  how  each  part  of  your   infrastructure  should  be  deployed,  configured  and  managed.”     Getchef.com  
  • 9. Learning Chef     What  is  Chef?     §  Recipes  are  created  using  the  Ruby  language  and  while  learning  Chef  we   will  learn  a  lot  of  the  Ruby  language   §  Recipes  rely  primarily  on  resources,  resources  described  a  desired  state  of   an  element  in  the  infrastructure.   §  Packages  to  be  installed   §  Files  to  be  created   §  Directories  to  be  created   §  Services  to  be  started   §  Config  files  to  be  updated   §  Commands  to  be  executed   §  Essen>ally  anything  we  need  to  do  on  our  Linux  nodes  
  • 10. Learning Chef     What  is  Chef?     §  Chef  relies  on  either  OpenSource  Chef  server  or  Chef  enterprise  to   host  configura>on  recipes,  cookbooks,  and  node  authen>ca>on  for   your  infrastructure     §  Nodes  when  performing  a  convergence  will  check  in  with  the  Chef   server,  download  the  required  configura>on,  then  execu>on  the   recipe  instruc>ons        
  • 11. Learning Chef        
  • 13. Learning Chef     Common  Chef  Terminology     Recipes:     Fundamental  configura>on  element  within  an  organiza>on   Cookbook:    Defines  a  scenario  and  is  the  fundamental  unit  of  configura>on  and  policy  distribu>on   Chef-­‐Client:    Agent  that  runs  locally  on  the  node  that  is  registered  with  the  chef  server     Convergence:    Occurs  when  chef-­‐client  configures  the  system/node  based  off  the  informa>on  collected  from  chef-­‐ server   Configura9on  Dri;:    Occurs  when  the  node  state  does  not  reflect  the  updated  state  of  polices/configura>ons  on  the  chef   server   Resources:   A  statement  of  configura>on  policy  within  a  recipe   Describes  the  desired  state  of  an  element  in  the  infrastructure  and  steps  needed  to  configure      
  • 14. Learning Chef     Common  Chef  Terminology     Provider:    Defines  the  steps  that  are  needed  to  bring  the  piece  of  the  system  from  its  current  state  to  the    desired  state   A?ributes:    Specific  details  about  the  node,  used  by  chef-­‐client  to  understand  current  state  of  the  node,  the  state  of  the    node  on  the  previous  chef-­‐client  run,  and  the  state  of  the  node  at  the  end  of  the  client  run   Data-­‐bags:    A  global  variables  stored  as  JSON  data  and  is  accessible  from  the  Chef  server   Worksta9on:    A  computer  configured  with  Knife  and  used  to  synchronize  with  chef-­‐repo  and  interact  with  chef  server   Chef  Server:    Chef  server  is  the  hub  for  all  configura>on  data,  stores  cookbooks,  and  the  policies  applied  to  the  node   Knife:    Command  line  tool  which  provides  an  interface  between  the  local  chef-­‐repo  and  chef-­‐server   client.rb:      Configura>on  file  for  chef-­‐client  located  at  /etc/chef/client.rb  on  each  node     Ohai:    Tool  used  to  detect  a_ributes  on  a  node  and  then  provide  a_ributes  to  chef-­‐client  at  the  start  of    every  chef-­‐client  run                      
  • 15. Learning Chef     Common  Chef  Terminology     Node  Object:      Consists  of  run-­‐list  and  node  a_ributes  that  describe  states  of  the  node   Chef-­‐Repo:    Located  on  the  worksta>on  and  installed  with  the  starter  kit,  should  be  synchronized  with  a  version    control  system  and  stores  Cookbooks,  roles,  data  bags,  environments,  and  configura>on  files   Organiza9on:    Used  in  chef  enterprise  server  to  restrict  access  to  objects,  nodes  environments,  roles,  data-­‐bags  etc   Environments:    Used  to  organize  environments  (Prod/Staging/Dev/QA)  generally  used  with  cookbook  versions   Idempotence:    Means  a  recipe  can  run  mul>ple  >mes  on  the  same  system  and  the  results  will  always  be  iden>cal      
  • 17. Learning Chef     Chef  Server     Two  types  of  Chef-­‐server:     1.  OpenSource  Chef-­‐server   §  Free  version  of  Chef   §  Each  instance  of  the  server  must  be  configured  and  managed  locally  (includes  all  aspects  of   managing  the  server,  updates,  migra>ons,  scalability,  etc.     2.  Chef-­‐server  enterprise  (hosted)   §  Scalable  by  design     §  Available  organiza>ons   §  Always  available     §  Resource-­‐based  access  control   3.  Chef-­‐server  enterprise  (on-­‐premise)   §  Scalable  by  design     §  Available  organiza>ons   §  Hosted  on-­‐premise  behind  your  firewall   §  Managed  yourself        
  • 18. Learning Chef     Chef  Server:  Enterprise     §  Allows  crea>on  of  organiza>ons   §  Organiza>ons    separate  the  infrastructure,  policies,  and  cookbooks   §  Nodes  are  registered  in  organiza>ons   §  Nothing  can  be  shared  between  organiza>ons   §  Enterprise  chef  server  can  contain  many  different  organiza>ons   §  OpenSource  chef  the  local  individual  server  acts  as  an  organiza>on  and  does  not  allow  crea>on  of   organiza>ons   §  Organiza>ons  can  represent  different  companies,  department,  infrastructures,  applica>ons,  and  so  forth   §  For  each  organiza>on  in  order  to  start  bootstrapping  nodes  you  need  to  download  the  starter  kit   §  Starter  kit  provides  security  creden>als  (valida>on.pem  keys)  to  authen>cate  each  node  to  the  chef  server     §  Chef  enterprise  scales  by  design  to  handle  thousands  of  nodes  and  different  organiza>ons    
  • 19. Learning Chef     Chef  Server:  Role  of  the  server     §  Stores  system  configura>on  informa>on  (policies  for  nodes)   §  Authen>cates  worksta>ons  and  nodes   §  Delivers  configura>ons  to  nodes   §  Chef  server  holds  the  configura>on  and  the  node  checks-­‐in  to  receive  instruc>ons  on  its  desired  state   §  The  node  downloads  configura>on  instruc>ons  from  the  server  and  does  all  of  the  work    
  • 21. Learning Chef     Chef  Worksta>on     §  Developing  cookbooks  and  recipes   §  Synchronizing  chef-­‐repo  with  git/svn  (source  control)   §  Using  knife  to  upload  and  manage  node  and  chef  server  configura>ons  and   policies   §  Organiza>ons   §  Nodes   §  Environments   §  Data  bags            
  • 22. Learning Chef     Chef  Worksta>on:  Organiza>on  Starter  Kit     §  Each  organiza>on  has  a  starter  kit  which  provides  the  chef-­‐repo  as  well  as   security  creden>als  for  communica>ng  with  the  server   §  Knife.rb  configura>on  file  is  located  in  the  chef-­‐repo  (starter  kit)   §  Starter  kit  can  be  re-­‐downloaded  from  the  chef-­‐server          
  • 23. Learning Chef     Chef  Worksta>on:  Organiza>on  Starter  Kit     §  Each  >me  you  download  a  new  starter  kit  the  security  keys  for  that  repo  to  the   server  are  reset   §   As  a  result  you  have  to  redistribute  the  security  keys  to  other  team  members  if  a   new  starter  kit  for  the  organiza>on  is  downloaded     §  During  bootstrap  oragniza>on-­‐validator.pem  is  copied  to  the  node  as   valida>on.pem   §  During  the  first  chef-­‐client  run  the  valida>on.pem  signs  the  client.pem  key  which   is  used  to  authen>cate  the  node  against  the  chef  server        
  • 24. Learning Chef     Chef  Worksta>on:  Organiza>on  Starter  Kit     §  Security  considera>ons  for  valida>on.pem   §  It  should  be  removed  first  when  the  chef-­‐client  convergence  runs   §  If  chef-­‐client  locks  then  key  is  located  on  node  if  node  is  compromised   then  your  en>re  infrastructure  is     §  Chef-­‐client  (super  market  cookbook)  provides  this  func>onality   §  Can  always  write  your  own  recipe  to  remove  valida>on.pem  and  run  it   first  in  the  run_list   §  file  "/etc/chef/valida>on.pem"  do   §    ac>on  :delete   §  End        
  • 25. Learning Chef     Chef  Worksta>on:  Knife     Knife  is  the  command  line  tool  used  to  provide  an  interface  between  your  local   chef-­‐repo  and  the  chef-­‐server     §  Crea>ng  cookbooks   §  Uploading  cookbooks  to  chef  server   §  Managing  roles  and  run_lists   §  Searching  chef-­‐server  node  object  data   §  Bootstrapping  nodes   §  Essen>ally  everything  we  need  to  do  as  a  DevOps  admin              
  • 26. Learning Chef     Chef  Worksta>on:  Knife     Chef  and  knife  interface  can  be  installed  to  OSX  and  Linux:    curl  –L  h_ps://www.opscode.com/chef/install.sh  |  sudo  bash     Download  and  install  Chef  manually  for  windows:    h_p://www.getchef.com/chef/install/     This  course  will  use  a  Linux  CentOS  6.5  Image  as  the  worksta>on                        
  • 27. Learning Chef     Chef  Worksta>on:  Knife  configura>on  file  (knife.rb)     §  Is  found  inside  the  chef-­‐repo  which  is  available  inside  the  starter  kit  of  an   organiza>on   §  Configure  proxy  selngs  here  if  worksta>on  is  behind  a  proxy                              
  • 28. Learning Chef     Chef  Worksta>on:  Using  knife  to  bootstrap  a  node     Bootstrapping  connects  the  worksta>on  to  the  node  to  install:     §  Installs  knife   §  Ohai:   Used  to  detect  a_ributes  on  a  node  and  report  them  to  chef-­‐client  at  the  start  of   every  client  run  it  is  required  for  chef-­‐client  to  work  and  it  builds  the  node  object     §  Ruby   §  Chef-­‐client   §  A  few  other  addi>onal  items                  
  • 29. Learning Chef     Chef  Worksta>on:  Using  knife  to  bootstrap  a  node     Knife  bootstrap  <address>  -­‐x  user  –P  password  –N  nodename     §  For  star>ng  in  this  course  we  will  define  a  node  name   §  In  produc>on  it  is  best  prac>ce  not  to  define  –N  and  let  the  FQDN   work  as  the  node  name   Note:  For  linuxacademy.com  lab  servers  when  bootstrapping  use  your   public  hostname                        
  • 31. Learning Chef     Chef  Server  &  Nodes     A  node  can  be  anything  that  can  run  the  chef-­‐client  agent   •  Smart  phones   •  Switches   •  APIs   •  FreeBSD  servers   •  Unix  Servers   •  Windows  Servers   •  Linux  Servers   •  Etc.                        
  • 32. Learning Chef     Chef  Server  &  Nodes     Chef  server  stores  all  policy  and  configura>on  informa>on  for  nodes   The  node  uses  the  client.pem  file  (created  by  validator.pem)  during  the  chef-­‐ client  run  in  order  to  authen>cate  against  the  chef  server     Chef-­‐client  run:   •  Authen>cate  against  the  chef-­‐server  using  client.pem     •  Builds  the  node  object  and  runs  ohai   •  Syncronizes  with  the  chef-­‐server  (sends  node  object  informa>on  and  receives   cookbooks/policies)   •  Executes/compiles  the  desired  policies   •  Runs  the  node  object   •  Completes                    
  • 34. Learning Chef     Chef  Configura>on  Concepts     Policy:   §  A  collec>on  of  system  configura>ons  that  you  define  (roles/data  bags/ environments)   §  The  policy  states  the  state  that  each  resources  should  be  in  but  not  how  to  get   there   §  Chef-­‐client  will  pull  the  policy  and  configure  the  node  so  that  it  matches  the   state  of  the  policy   §  Policy  concept  examples:   §  If  it  should  be  installed   §  If  it  is  not  installed  then  install  it   §  If  it  is  already  installed  then  do  nothing   §  A  file  should  exist  if  not  create  it   §  If  a  file  exists  but  does  not  have  correct  content              
  • 35. Learning Chef     Chef  Configura>on  Concepts     Resources:  Defines  the  desired  state  for  a  single  configura9on  item  present  on  a   node  that  is  under  management  by  Chef   §  Does  the  configura>on  on  a  node  and  maps  to  providers   §  Recipes  are  stored  in  cookbooks   §  Represent  a  piece  of  the  system  and  its  desired  state   §  Building  blocks  of  Chef  configura>on   §  When  chef-­‐client  is  run  on  a  node  the  resource  is  executed  by  the   provider  which  is  handled  by  Chef  and  the  OS  itself   §  Informa>on  as  to  what  provider  to  use  (ie  what  package  manager  to  use)   is  populated  when  ohai  is  run  at  the  start  of  each  chef-­‐client  run        
  • 36. Learning Chef     Chef  Configura>on  Concepts     Most  common  resources  in  configura>on  management     Package:   Used  to  manage  packages  such  as  installing  a  required  package   Template:     Used  to  manage  the  contents  of  a  Ruby  template  in  the  cookbook   Service:   Manage  system  services   What  run-­‐levels  to  start  the  service  in   Current  state  of  the  service  (running/stopped/etc)                    
  • 37. Learning Chef     Chef-­‐client  nodes  concepts     §  Nodes  can  be  configured  to  automa>cally  running  chef-­‐client  in  intervals   §  When  convergence  occurs  the  node  can  put  itself  back  into  compliance   (desired  state  and  how  to  get  there)   §  Chef  server  does  not  know  the  status  of  a  node  un>l  a  convergence  is  run   §  Something  could  happen  to  cause  the  node  to  get  out  of  compliance  but   a  convergence  will  check  policies/configura>on  and  put  the  node  back   into  compliance  based  off  your  defined  configura>ons                      
  • 38. Learning Chef     Key  concepts:     Recipes  are  made  up  of  a  collec>on  of  resources     Cookbooks  are  made  up  of  a  collec>on  of  recipes     Nodes  receive  their  policy  based  off  of  roles  and  individual  node  configura>ons     A  run  list  defines  the  order  in  which  you  want  your  recipes  to  run  during  convergence     Configura>on  dri#  occurs  when  the  desired  state  of  the  node  does  not  match  the   desired  state  as  defined  in  the  policies  on  the  chef  server     Configura>on  dri#  can  be  resolved  by  automa>ng/running  the  chef-­‐client  agent                    
  • 40. Learning Chef     Key  concepts:     A_ributes  are  specific  details  about  a  node       A_ributes  describe:   •  The  current  state  of  the  node   •  What  the  sate  of  the  node  was  at  the  end  of  the  previous  chef-­‐client  run   •  What  the  state  of  the  node  should  be  at  the  end  of  the  current  chef-­‐client  run   A_ributes  can  be  defined  by:   •  The  state  of  the  node  (ohai)   •  Cookbooks  (Our  a_ribute  files)   •  Roles   •  Environments                    
  • 41. Learning Chef     A_ribute  Precedence     A#er  the  node  object  is  rebuilt  in  the  chef  run,  all  a_ributes  loaded  in  the  chef-­‐client  are   then  compared.  The  node  is  updated  based  on  a_ribute  precedence  and  at  the  very  end   of  the  convergence  (chef-­‐client)  the  node  object  is  uploaded  to  the  chef  server       Node  object  defines  the  current  state  of  the  node  (made  up  of  a_ributes)   Node  object  is  stored  on  the  chef  server  so  that  it  can  be  searched   Node  object  is  updated  at  each  convergence     If  there  are  a_ributes  with  the  same  names  then  a_ribute  precedence  determines  which   a_ribute  is  applied  to  the  node  and  the  node  object.                      
  • 42. Learning Chef     A_ribute  Precedence:  Levels  of  precedence     default:    Automa>cally  reset  at  the  start  of  every  chef  client  run  is  the  lowest  level  of  precedence     force_default:    Used  in  a  cookbook  or  recipe  to  override  an  exis>ng  “default”  a_ribute     Normal:    A  selng  that  persists  in  the  node  object     Override:    Automa>cally  reset  at  the  start  of  every  chef-­‐client  most  o#en  should  be  used  only  when  required   force_override:        used  to  ensure  that  an  a_ribute  defined  in  a  cookbook  (by  an  a_ribute  file  or  by  a  recipe)  takes    precedence  over  an  override  a_ribute  set  by  a  role  or  an  environment   Automa9c:      Contains  data  populated  by  Ohai  at  the  beginning  of  every  chef-­‐client  run  and  cannot  be  modified  and                always  has  the  highest  a_ribute  precedence                    
  • 43. Learning Chef     A_ribute  Precedence:  Levels  of  precedence                                            
  • 45. Learning Chef     Node  Object     Node  object  is  made  up  of  the  run  lists  which  define  what  recipes  to  run  during  a  chef-­‐client  as   well  as  the  aMributes  that  define  informa6on  about  the  node     A_ributes  are  built  during  the  chef-­‐client  run  process:   §  Data  about  the  node  is  collected  by  Ohai   §  The  node  object  previously  saved  during  the  last  chef-­‐client  run     §  The  rebuilt  node  object  from  the  current  chef-­‐client  run     Once  the  node  object  is  rebuilt  all  a_ributes  are  compared  and  then  updated  based  on  a_ribute  precedence     At  the  end  of  every  chef-­‐client  run  the  node  object  that  defines  the  current  state  of  the  node  is  uploaded  to   the  chef  server  to  be  searched.                      
  • 47. Learning Chef     Environments:  What  are  environments?     “An  environment  is  a  way  to  map  an  organiza6ons  real-­‐life  workflow  to  what  can  be   configured  and  managed  using  the  Chef  server”       Apply  different  cookbook  versions  to  specific  environments  (dev/prod/staging/qa/)     Define  Environment  level  a_ributes       Environments  allow  sharing  of  cookbooks  within  an  organiza>on                        
  • 48. Learning Chef     Environments:  Crea>ng  environments     •  Environment  informa>on  can  be  stored  in  JSON  files  or  .rb  files   •  Environments  will  be  located  in  chef-­‐repo/environments   •  Example  dev.rb  (development  environment  file)    name  "dev"    descrip>on  ”Development  environment”    cookbook  "security",  "=  0.1.0”    cookbook  ”motd",  "=  0.2.0"    cookbook  "apache",  "=  0.2.0"    override_a_ributes({                    “author"  =>  {                                      “name"  =>  true                    }    })              
  • 49. Learning Chef     Environments:  A_ributes     Two  types  of  a_ribute  precedence  can  be  set  on  the  environment  level     •  default  a  default  a_ribute  defined  in  the  environment  will  take  precedence  over  a   default  a_ribute  defined  in  a  cookbook  a_ribute  file.   •  Override  has  higher  precedence  than  default,  force_default,  and  normal                              
  • 50. Learning Chef     Environments:  Methods  of  assigning  a  node  to  an  environment     •  Modify  the  client.rb  file  with  an  environment  variable   •  Knife-­‐flip  to  do  it  from  the  worksta>on     •  Assign  it  manually  on  the  node                        
  • 51. Learning Chef     Environments:  Lab  goals     ü  Configure  two  environments:  Dev/Produc>on   ü  Modify  Apache  cookbooks  with  newer  versions   ü  Set  newer  versions  to  dev  and  older  versions  to  produc>on   ü  Configure  Client.rb  to  look  at  proper  environment                            
  • 53. Learning Chef     Search:     Chef  search  allows  queries  to  be  made  for  any  type  of  data  that  is  indexed  by  the  chef   server.  Search  queries  the  chef  server  for  stored  informa6on.     Can  Search:     §  Data  bags   §  Environments   §  Roles   §  Nodes                
  • 54. Learning Chef     Search:  Methods  of  search     Search  with  Knife:    Syntax:  knife  search  node  “key:pa_ern”  –a  (a_ribute)   §  Search  nested  a_ributes   §  “memory_total:*”  –a  memory.total     §  Can  use  basic  “wild  cards”  in  the  pa_ern  “ipaddress:192.168.*”   §  Can  search  based  off  ranges  “ipaddress:[192.168.*  TO  192.172.*]”       Search  inside  of  recipes    Example:        Use  Ruby  recipe  to  search  all  nodes  that  are  running  an  outdated  package                        
  • 56. Learning Chef     Data  Bags     A  data  bag  is  a  global  variable  that  is  stored  in  JSON  data  and  accessible  from  the  chef  server.  A   data  bag  is  indexed  for  searching  and  can  be  loaded  by  a  recipe  or  accessed  during  search.     Types  of  data  stored  in  a  data  bag:     ü  Users  to  be  added  to  a  system   ü  Admins  to  be  added  to  sudo   ü  API/DB  Creden>als  (More  secure  and  be_er  than  environment  a_ributes  for  creden>als)   ü  Much  more                    
  • 57. Learning Chef     Data  Bags     {    "id":  “anthony",    "comment":  ”Anthony  admin  user",    "uid":  2005,    "gid":  0,    "home":  "/home/anthony",    "shell":  "/bin/bash"     }                      
  • 59. Learning Chef     Roles     “A  role  is  a  way  to  define  certain  paMerns  and  processes  that  exist  across  nodes  in  an   organiza6on  as  belonging  to  a  single  job  func6on”     §  Up  un>l  this  point  we  have  assigned  recipes  to  be  run  for  each  node     §  Instead  of  upda>ng  run_lists  for  a  node  all  we  have  to  do  is  update  a  role  on   the  server   §  Prevents  us  from  having  to  manually  touch  all  nodes  that  need  the  change     §  A  role  is  essen>ally  a  lis>ng  of  recipes  and  a_ributes  that  are  to  be  executed  on  a   node   §  Instead  of  assigning  a  run  list  for  each  node  we  assign  the  node  a  role   §  A  base  role  can  be  assigned  inside  of  a  roles  run_list            
  • 60. Learning Chef     Roles:  Role  management  with  knife     §  Knife  role  create  role_name   §  Chef-­‐repo/roles/rolename.rb   §  Knife  role  from  file  chef-­‐repo/roles/rolename.rb   §  Knife  role  list  –w  (views  a  list  of  roles  on  the  chef  server)   §  Knife  role  delete  role_name                    
  • 61. Learning Chef     Roles:  Produc>on       How  can  we  spin  up  new  nodes  (like  auto  scaling)  without  having  to  manually  modify   run_lists  in  a  node?   §  Pass  in  cloud-­‐init  informa>on  about  the  node   §  Create  Virtual  Machine  Images  a#er  a  node  has  been  bootstrapped   §  Do  not  name  the  node  but  instead  let  it  use  the  FQDN  as  the  node  name   §  Modify  /etc/chef/first-­‐boot.json  to  include  the  “role”  of  the  node                    
  • 63. Learning Chef     Knife  Plugins     Knife  can  be  extended  with  the  use  of  plugins     §  Knife-­‐flip:  Manage  environments  for  nodes   §  Cloud  plazorms:  azure,  ec2,  google,  linode,  openstack,  rackspace,  etc   §  Custom  plugins                  
  • 64. Learning ChefProduction Work Flow & Unattended Installs
  • 65. Learning Chef     Work  Flow:     §  Nodes  should  be  bootstrapped  and  managed  from  the  worksta>on   §  Nodes  should  be  assigned  roles  and  environments     §  A_ributes  specific  to  roles/environments  should  be  configured  accordingly   §  For  auto  scaling  environments  such  as  AWS  “una_ended”  bootstrapping  should  be   used                  
  • 66. Learning Chef     Work  Flow:  Una_ended  Bootstrapping     In  order  to  have  an  una_ended  install  the  node  when  first  created  must  meet  the   following  criteria:     §  Must  be  able  to  authen>cate  to  the  chef  server   §  Must  be  able  to  configure  a  run_list     §  Must  be  able  to  access  the  chef-­‐validator.pem  so  that  it  may  create  a  new   client.pem  and  iden>ty  on  the  chef  server   §  Must  have  a  unique  node  name   §  Client.rb  file  must  have  proper  configura>on  so  that  it  knows  what  server  to   communicate  with   §  Modify  the  file.json  in  /etc/chef  to  include  the  run_list  for  the  node   §  This  will  ideally  include  a  way  to  automate  the  running  of  chef-­‐client          
  • 67. AWS CSA Certification Example: Simple code that when run will create an S3 bucket. Version control your infrastructure! {          "Descrip>on"  :  "This  template  will  create  an  s3bucket",        "Resources"  :  {          "S3Bucket"  :  {              "Type"  :  "AWS::S3::Bucket",              "Proper>es"  :  {                  "AccessControl"  :  "PublicRead",                  "BucketName"  :  "gigitygumdrops"              }          }      },        "Outputs"  :  {          "BucketName"  :  {              "Value"  :  {  "Ref"  :  "S3Bucket"  },              "Descrip>on"  :  "Created  bucket  for  storing  websites"          }      }   }  
  • 68. PRESENTATION TITLE List Title: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pellentesque facilisis felis. Suspendisse ipsum erat, facilisis at euismod vel, consequat vitae nulla. Curabitur fringilla, ligula a sagittis venenatis, odio velit ornare ligula, non semper ligula eros eget neque. Ut sagittis vulputate est, in mollis libero varius eget. Cras felis felis, feugiat a sem a, pharetra elementum arcu. In odio lectus, placerat ut felis vitae, ullamcorper facilisis elit. Nam posuere metus et velit commodo tincidunt. " Linux List Item Number 1 " Linux List Item Number 2 " Linux List Item Number 3 " Linux List Item Number 4 " AWS List Item Number 1 " AWS List Item Number 2 " AWS List Item Number 3 " AWS List Item Number 4
  • 69. PRESENTATION TITLE Image Title:Content area for image description or caption. Even regular content simply associated with the image. Content area for image description or caption. Even regular content simply associated with the image.  
  • 70. PRESENTATION TITLEChart Title: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean pellentesque facilisis felis. Suspendisse ipsum erat, facilisis at euismod vel, consequat vitae nulla. Lorem Ipsum Dolor