how to be a chef (developer edition)
DESCRIPTION
Talk about Opscode Chef, a tool that helps to configurate services for servers.TRANSCRIPT
![Page 1: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/1.jpg)
How to be a Chef(Developer Edition)
Rodrigo AyalaDeveloper
sábado, 1 de junio de 13
![Page 2: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/2.jpg)
@RodrigoAyala
sábado, 1 de junio de 13
![Page 3: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/3.jpg)
(Web) Apps are a bunch of software interconnected in a nice way
sábado, 1 de junio de 13
![Page 4: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/4.jpg)
But software lives on servers
sábado, 1 de junio de 13
![Page 5: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/5.jpg)
And we can’t to play dumb with that
sábado, 1 de junio de 13
![Page 6: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/6.jpg)
tions?
sábado, 1 de junio de 13
![Page 7: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/7.jpg)
Cloud, or local server
sábado, 1 de junio de 13
![Page 8: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/8.jpg)
Local server
sábado, 1 de junio de 13
![Page 9: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/9.jpg)
Local server
Pros:
sábado, 1 de junio de 13
![Page 10: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/10.jpg)
Local server
Pros:✓ You know where your data lives
sábado, 1 de junio de 13
![Page 11: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/11.jpg)
Local server
Pros:✓ You know where your data lives✓ The equipment is yours and you can personalize as you want
sábado, 1 de junio de 13
![Page 12: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/12.jpg)
Local server
Pros:✓ You know where your data lives✓ The equipment is yours and you can personalize as you want
Cons:
sábado, 1 de junio de 13
![Page 13: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/13.jpg)
Local server
Pros:✓ You know where your data lives✓ The equipment is yours and you can personalize as you want
Cons:✓ You are responsible to give power and a good Tº to the server
sábado, 1 de junio de 13
![Page 14: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/14.jpg)
Local server
Pros:✓ You know where your data lives✓ The equipment is yours and you can personalize as you want
Cons:✓ You are responsible to give power and a good Tº to the server✓ The environment should be able to support catastrophes. (TIER)
sábado, 1 de junio de 13
![Page 15: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/15.jpg)
Local server
Pros:✓ You know where your data lives✓ The equipment is yours and you can personalize as you want
Cons:✓ You are responsible to give power and a good Tº to the server✓ The environment should be able to support catastrophes. (TIER)✓It needs a lot of configuration (and that needs a lot of time)
sábado, 1 de junio de 13
![Page 16: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/16.jpg)
Cloud
sábado, 1 de junio de 13
![Page 17: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/17.jpg)
Cloud
Pros:
sábado, 1 de junio de 13
![Page 18: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/18.jpg)
Cloud
Pros:✓ You don’t need an huge initial investment to buy (expensive) servers
sábado, 1 de junio de 13
![Page 19: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/19.jpg)
Cloud
Pros:✓ You don’t need an huge initial investment to buy (expensive) servers✓ You can dynamically create an IT architecture
sábado, 1 de junio de 13
![Page 20: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/20.jpg)
Cloud
Pros:✓ You don’t need an huge initial investment to buy (expensive) servers✓ You can dynamically create an IT architecture
Cons:
sábado, 1 de junio de 13
![Page 21: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/21.jpg)
Cloud
Pros:✓ You don’t need an huge initial investment to buy (expensive) servers✓ You can dynamically create an IT architecture
Cons:✓ If for any reason the cloud service is down, you can’t do anything but wait
sábado, 1 de junio de 13
![Page 22: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/22.jpg)
Cloud
Pros:✓ You don’t need an huge initial investment to buy (expensive) servers✓ You can dynamically create an IT architecture
Cons:✓ If for any reason the cloud service is down, you can’t do anything but wait✓It needs a lot of configuration (and that needs a lot of time)
sábado, 1 de junio de 13
![Page 23: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/23.jpg)
Cloud
IaaS PaaS
sábado, 1 de junio de 13
![Page 24: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/24.jpg)
Cloud
IaaS PaaS
Infrastructure as a Service
✓Flexible✓Cheap
sábado, 1 de junio de 13
![Page 25: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/25.jpg)
Cloud
IaaS PaaS
Platform as a Service
✓First deploy in just minutes✓You don’t have to worry about software updates
sábado, 1 de junio de 13
![Page 26: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/26.jpg)
Cloud
IaaS PaaS
¿ ?
sábado, 1 de junio de 13
![Page 27: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/27.jpg)
sábado, 1 de junio de 13
![Page 28: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/28.jpg)
Configuration Management toolWritten in RubyOpen Source
sábado, 1 de junio de 13
![Page 29: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/29.jpg)
88.3K lines of code7.497 commits
Since March 2008https://github.com/opscode/chef
* Metrics by http://www.ohloh.net/p/opscode-chef
sábado, 1 de junio de 13
![Page 30: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/30.jpg)
Let’s see how it works
sábado, 1 de junio de 13
![Page 31: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/31.jpg)
Chef
sábado, 1 de junio de 13
![Page 32: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/32.jpg)
ChefChef Server
Chef Solo
sábado, 1 de junio de 13
![Page 33: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/33.jpg)
Chef Server
Chef Client
Chef Client
Chef Client
Chef Server
(Repository)
sábado, 1 de junio de 13
![Page 34: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/34.jpg)
Chef Solo
Forever Alone version
sábado, 1 de junio de 13
![Page 35: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/35.jpg)
Chef Solo
Chef Solo Chef Solo Bootstraped
sábado, 1 de junio de 13
![Page 36: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/36.jpg)
Let’s see how it works
sábado, 1 de junio de 13
![Page 37: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/37.jpg)
Cookbookhttp://community.opscode.com/cookbooks
https://github.com/opscode-cookbooks
sábado, 1 de junio de 13
![Page 38: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/38.jpg)
★ Java★ postgreSQL★ MySQL★ SELinux★ RVM★ etc
Cookbook
sábado, 1 de junio de 13
![Page 39: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/39.jpg)
Recipes
sábado, 1 de junio de 13
![Page 40: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/40.jpg)
Recipes
Are included on cookbooks
Written in Ruby
There are functions available as DSL
You can use ERB templates with Recipes
sábado, 1 de junio de 13
![Page 41: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/41.jpg)
Resources
Used on recipes
Define actions that can be taken
There are functions available as DSL
Service, yum_package, execute or directory are a few examples of this
http://docs.opscode.com/chef/resources.html
sábado, 1 de junio de 13
![Page 42: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/42.jpg)
template '/etc/sudoers' do source 'sudoers.erb' mode '0440' owner 'root' group platform?('freebsd') ? 'wheel' : 'root' variables( :sudoers_groups => node['authorization']['sudo']['groups'], :sudoers_users => node['authorization']['sudo']['users'], :passwordless => node['authorization']['sudo']['passwordless'], :include_sudoers_d => node['authorization']['sudo']['include_sudoers_d'], :agent_forwarding => node['authorization']['sudo']['agent_forwarding'], :sudoers_defaults => node['authorization']['sudo']['sudoers_defaults'] ) not_if { node[:some_value]}end
Recipe example
sábado, 1 de junio de 13
![Page 43: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/43.jpg)
Run list
sábado, 1 de junio de 13
![Page 44: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/44.jpg)
{ "run_list":[ "recipe[user]", "recipe[sudo]", "recipe[main::user]", "recipe[yum::epel]", "recipe[nginx]", "recipe[redis::server]", "recipe[build-essential]", "recipe[rvm::user]", "recipe[main]", "recipe[nginx_conf]", "recipe[main::nginx]", "recipe[main::dirs]" ] ],
sábado, 1 de junio de 13
![Page 45: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/45.jpg)
Let’s cook!
sábado, 1 de junio de 13
![Page 46: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/46.jpg)
How to start
$ gem install knife-solo$ gem install chef-solo
$ gem install chef
sábado, 1 de junio de 13
![Page 47: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/47.jpg)
How to start
$ knife solo bootstrap user@ipnumber nodes/ip.json -i pemfile.pem
sábado, 1 de junio de 13
![Page 48: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/48.jpg)
https://github.com/opscode/chef-repo
Empty cookbook
sábado, 1 de junio de 13
![Page 49: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/49.jpg)
“Bundler” for Chef
https://github.com/applicationsonline/librarian-chef
sábado, 1 de junio de 13
![Page 50: How to be a Chef (Developer Edition)](https://reader033.vdocument.in/reader033/viewer/2022052622/558e9dc11a28ab6b528b4673/html5/thumbnails/50.jpg)
Gracias!
sábado, 1 de junio de 13